ovf2vm is a tool for updating parameters in the ovf (xml) file generated by Packer (VirtualBox builder) and making the ovf fileimportable by to vSphere (VMware).
Clone the repository:
$ git clone [email protected]:qba73/vbox2vm.git
Create and activate virtualenv:
$ virtualenv -p python3 --system-site-packages venv
$ source venv/bin/activate
Install pytest:
$ pip install pytest
Run tests:
$ make test
Install ovf package for development:
$ make devinstall
Create python ovf package:
$ make sdist
The ovf distribution package is created in the dist directory.
Install ovf python package:
$ pip install dist/<package name>
Example
$ make sdist
$ ls -lt dist/
total 12
-rw-rw-r-- 1 jakub jakub 5090 Nov 23 10:52 ovf-0.1.1-py3-none-any.whl
-rw-rw-r-- 1 jakub jakub 3496 Nov 23 10:52 ovf-0.1.1.tar.gz
$ pip install dist/ovf-0.1.1-py3-none-any.whl
Get help
$ ovf --help
Usage: ovf [OPTIONS] OVFIN OVFOUT
Options:
--oss_id INTEGER VMware code for RedHat family. Default: 107
--oss_description TEXT
--oss_type TEXT VMware code for RedHat 64bit family. Default:
'rhel7_64Guest'
--virtual_system_type TEXT VMware virtual system type. Default: vmx-10
--help Show this message and exit.
Update params - virtsystype and os
$ ovf centos.ovf centos-vmware.ovf --virtual_system_type=vmx-10 --oss_id=107
Reading ovf file
Saved updated ovf file.
Update params - use default values
$ ovf centos7-packer-template.ovf centos7-out.ovf
Reading ovf file
Generating OVF vSphere file with params:
oss_id: 107, oss_description: CentOS 4/5/6/7 (64-bit), oss_type: rhel7_64Guest, virtual_system_type: vmx-10
Saved updated ovf file: centos7-out.ovf