2 # Copyright 2016-2019 VMware Inc.
3 # This file is part of ETSI OSM
6 # Licensed under the Apache License, Version 2.0 (the "License"); you may
7 # not use this file except in compliance with the License. You may obtain
8 # a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15 # License for the specific language governing permissions and limitations
18 # For those usages not covered by the Apache License, Version 2.0 please
19 # contact: osslegalrouting@vmware.com
23 This README file explains how to use OVF Converter Tool to generate OVF file from .qcow2, .img (raw) disk images.
27 This readme file contains the following sections:
39 OVF Converter Tool is a Command Line Interface (CLI) basically designed to generate OVF files from disk image such as
40 .qcow2, and .img (raw format) which are other than .vmdk. Given a path to .qcow2 image this tool can generate .vmdk
43 The user can optionally specify name and location of ovf file. Also, one can use command line options to give disk
44 size (GB), memory (MB), number of cpus, OS type, disk controller required for VM which will get deployed using
47 Generated OVF file can be used to deploy VM in Vmware vSphere or vCloud Director.
49 Note- Currently this tool supports only Ubuntu platform.
55 This tool requires the following software package:
56 o apt-get package manager
65 Install.sh script in this folder will install all of these software packages.
70 User needs root privileges to install OVF Generator Tool.
71 Follow below setups for installation of OVF Converter Tool.
72 1. Make install.sh script in this folder executable by running below command
74 2. Run install.sh script as:
78 #################################################################
79 ##### Installing Require Packages #####
80 #################################################################
81 Hit:1 http://us.archive.ubuntu.com/ubuntu xenial InRelease
82 Get:2 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
83 Get:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
84 Get:4 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
85 Fetched 306 kB in 1s (286 kB/s)
86 Reading package lists... Done
87 Reading package lists... Done
88 Building dependency tree
89 Reading state information... Done
90 Note, selecting 'libxslt1-dev' instead of 'libxslt-dev'
91 libxslt1-dev is already the newest version (1.1.28-2.1).
92 python-dev is already the newest version (2.7.11-1).
93 python-lxml is already the newest version (3.5.0-1build1).
94 libxml2-dev is already the newest version (2.9.3+dfsg1-1ubuntu0.1).
96 t version (1:2.5+dfsg-5ubuntu10.6).
97 0 upgraded, 0 newly installed, 0 to remove and 72 not upgraded.
99 #################################################################
101 #################################################################
102 root@ubuntu:/home/vmware/OVF_converter#
103 root@ubuntu:/home/vmware/OVF_converter#
105 3. Now tool is installed at /usr/local/bin and available for all users
106 4. User can access commands of OVF Generator Tool as:
107 ovf_converter path [output location] [ovf name][memory][cpu][disk][ostype][disk_controller]
112 o Get version of tool as:
114 Command - ovf_converter -v
116 root@ubuntu:/home/vmware/OVF_converter# ovf_converter -v
118 root@ubuntu:/home/vmware/OVF_converter#
120 o See all command line options of tool as:
121 Command - ovf_converter -h
123 root@ubuntu:/home/vmware/OVF_converter#
124 root@ubuntu:/home/vmware/OVF_converter# ovf_converter -h
125 Usage: ovf_converter_cli.py [-h] [-v] [-o OUTPUT_LOCATION] [-n OVF_NAME]
126 [-m MEMORY] [-c CPU] [-d DISK] [-s OSTYPE]
127 [-dc DISK_CONTROLLER] [--cdrom] [-w 14]
130 OVF converter to convert .qcow2 or raw image into OVF
132 positional arguments:
133 path absolute path to source image which will get convert
137 -h, --help show this help message and exit
138 -v, --version shows version of OVF Converter tool
139 -o OUTPUT_LOCATION, --output_location OUTPUT_LOCATION
140 location where created OVF will be kept. This location
141 should have write access. If not given file will get
142 created at source location (optional)
143 -n OVF_NAME, --ovf_name OVF_NAME
144 name of output ovf file. If not given source image
145 name will be used (optional)
146 -m MEMORY, --memory MEMORY
147 required memory for VM in MB (default 1 GB)(optional)
148 -c CPU, --cpu CPU required number of virtual cpus for VM (default 1 cpu)
150 -d DISK, --disk DISK required size of disk for VM in GB (default as
151 in source disk img) (optional)
152 -s OSTYPE, --osType OSTYPE
153 required operating system type as specified in user
154 document (default os type other 32 bit) (optional)
155 -dc DISK_CONTROLLER, --disk_Controller DISK_CONTROLLER
156 required disk controller type (default controller SCSI
157 with lsilogicsas) (SATA, IDE, Paravirtual, Buslogic,
158 lsilogic, lsilogicsas) (optional)
159 --cdrom whether to include a cd/dvd device (optional)
160 -hw VERSION, --hwversion VERSION
161 VMware ESXi hardware family version (optional)
164 o Create OVF file from qcow2 or raw disk image as:
165 Command - ovf_converter /home/vmware/centos_ovf/CentOS-7-x86_64-GenericCloud-1503.qcow2 -n centos_qcow2.ovf -m 2048 -c 4 -d 10 -s "Centos 32-bit" -dc "SATA"
167 root@ubuntu:/home/vmware/OVF_converter# ovf_converter /home/vmware/centos_ovf/CentOS-7-x86_64-GenericCloud-1503.qcow2 -n centos_qcow2.ovf -m 2048 -c 4 -d 10
168 #### Start OVF conversion ####
169 Getting source image information
170 Converting source disk image to .vmdk
171 .....................................................
173 Output OVF is at: /home/vmware/centos_ovf/centos_qcow2.ovf
174 #### Completed OVF conversion ####
179 After installation of tool logs will get created at /usr/local/bin/OVF_converter/logs/ovf_converter.log file.
180 User can use these logs for debugging or trouble shooting.
194 Adds support for cdrom
199 Adds support for hardware version
200 Improves progress indicator