Coder Social home page Coder Social logo

ovf-export's Introduction

ovf-export for libvirt

ovf-export generates OVF/OVA files from libvirt domains. Generated OVA/OVF files can be imported in other hypervisors, like VirtualBox or VMware Player/Workstation/ESXi.

Also, ovf package can be used for serializing custom OVF files. De-serializing is not supported at the moment. See "known issues" for details.

Beta software: this code works for me, but it may not work in your system. At the moment, the code is not tested with different environments. Feel free to propose patches.

Usage

Requirements:

  • qemu-img
  • tar (only when generating OVA files)

Installation

$ go install gitlab.com/Enrico204/ovf-export/cmd/ovf-export@latest

If you want to use this tool as library:

# Inside the project dir
$ go get gitlab.com/Enrico204/ovf-export

Usage

$ ovf-export -list
UUID                                    Name
--------------------------------------------------------
0962a56e96144bdd99bd83418c3e425a        debian10
61290c324b744d9095c6023520ddf72d        openindiana
e7904362d30b4179977804d073f070b4        win10

$ ovf-export -id 0962a56e96144bdd99bd83418c3e425a -output ~/debian10ovf -ova

Libvirt URL can be specified via env variable LIBVIRT_URL or using the command line flag -libvirt-url. It can be the path for the local socket, or hostname:port for TCP connection. The default value is /var/run/libvirt/libvirt-sock.

Use -help to list all command line flags:

$ ovf-export -help
  -cdrom
        Include CDROM/ISO images
  -id string
        Domain ID to export
  -libvirt-url string
        Libvirt URL
  -list
        List all inactive libvirt-utils domains (a.k.a. VMs)
  -no-manifest
        Skip generating manifest
  -output string
        OVF destination directory
  -ova
        Generate OVA after OVF

Known issues

  • When exporting a domain with an IDE controller, VMware Workstation refuses to import the OVA/OVF file due to "mismatch hash" for the VMDK (even if the hash matches). A workaround is remove the manifest before importing the image.
  • De-serializing a OVF file is not supported, and probably won't be supported soon due a limit in Go encoding/xml handling namespaced XML prefixes.
  • Currently, the program should be in the same machine as the libvirt daemon.
  • virtio disk bus is not supported. Use SATA or IDE.

LICENSE

This code is released under MIT license. See LICENSE for details.

ovf-export's People

Contributors

enrico204 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

ovf-export's Issues

unsupported target bus: virtio

Hi,

when I try to convert any virtual guest I receive the next message:

"unsupported target bus: virtio"

The command used is:

./ovf-export -id 25aaef79623a49b0899fca6bbd722b46 -output /OVA/

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.