2 # Copyright 2016-2017 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
22 This README file explains how to use OVF Converter Tool to generate OVF file from .qcow2, .img (raw) disk images.
26 This readme file contains the following sections:
38 OVF Converter Tool is a Command Line Interface (CLI) basically designed to generate OVF files from disk image such as .qcow2, and .img (raw format) which are other than .vmdk.
39 Given a path to .qcow2 image this tool can generate .vmdk and .ovf files.
40 User can optionally specify name and location of ovf file. Also, one can use command line options to give disk size (GB), memory (MB), number of cpus, OS type, disk controller required for VM which will get deployed using generated OVF.
41 Generated OVF file can be used to deploy VM in Vmware vSphere or vCloud Director.
43 Note- Currently this tool supports only Ubuntu platform.
49 This tool requires the following software package:
50 o apt-get package manager
59 Install.sh script in this folder will install all of these
65 User needs root privileges to install OVF Generator Tool.
66 Follow below setups for installation of OVF Converter Tool.
67 1. Make install.sh script in this folder executable by running below command
69 2. Run install.sh script as:
73 #################################################################
74 ##### Installing Require Packages #####
75 #################################################################
76 Hit:1 http://us.archive.ubuntu.com/ubuntu xenial InRelease
77 Get:2 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
78 Get:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
79 Get:4 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
80 Fetched 306 kB in 1s (286 kB/s)
81 Reading package lists... Done
82 Reading package lists... Done
83 Building dependency tree
84 Reading state information... Done
85 Note, selecting 'libxslt1-dev' instead of 'libxslt-dev'
86 libxslt1-dev is already the newest version (1.1.28-2.1).
87 python-dev is already the newest version (2.7.11-1).
88 python-lxml is already the newest version (3.5.0-1build1).
89 libxml2-dev is already the newest version (2.9.3+dfsg1-1ubuntu0.1).
91 t version (1:2.5+dfsg-5ubuntu10.6).
92 0 upgraded, 0 newly installed, 0 to remove and 72 not upgraded.
94 #################################################################
96 #################################################################
97 root@ubuntu:/home/vmware/OVF_converter#
98 root@ubuntu:/home/vmware/OVF_converter#
100 3. Now tool is installed at /usr/local/bin and available for all users
101 4. User can access commands of OVF Generator Tool as:
102 ovf_converter path [output location] [ovf name][memory][cpu][disk][ostype][disk_controller]
107 o Get version of tool as:
109 Command - ovf_converter -v
111 root@ubuntu:/home/vmware/OVF_converter# ovf_converter -v
113 root@ubuntu:/home/vmware/OVF_converter#
115 o See all command line options of tool as:
116 Command - ovf_converter -h
118 root@ubuntu:/home/vmware/OVF_converter#
119 root@ubuntu:/home/vmware/OVF_converter# ovf_converter -h
120 Usage: ovf_converter_cli.py [-h] [-v] [-o OUTPUT_LOCATION] [-n OVF_NAME]
121 [-m MEMORY] [-c CPU] [-d DISK] [-s OSTYPE]
122 [-dc DISK_CONTROLLER]
125 OVF converter to convert .qcow2 or raw image into OVF
127 positional arguments:
128 path absolute path to source image which will get convert
132 -h, --help show this help message and exit
133 -v, --version shows version of OVF Converter tool
134 -o OUTPUT_LOCATION, --output_location OUTPUT_LOCATION
135 location where created OVF will be kept. This location
136 should have write access. If not given file will get
137 created at source location (optional)
138 -n OVF_NAME, --ovf_name OVF_NAME
139 name of output ovf file. If not given source image
140 name will be used (optional)
141 -m MEMORY, --memory MEMORY
142 required memory for VM in MB (default 1 GB)(optional)
143 -c CPU, --cpu CPU required number of virtual cpus for VM (default 1 cpu)
145 -d DISK, --disk DISK required size of disk for VM in GB (default as
146 in source disk img) (optional)
147 -s OSTYPE, --osType OSTYPE
148 required operating system type as specified in user
149 document (default os type other 32 bit) (optional)
150 -dc DISK_CONTROLLER, --disk_Controller DISK_CONTROLLER
151 required disk controller type (default controller SCSI
152 with lsilogicsas) (SATA, IDE, Paravirtual, Buslogic,
153 lsilogic, lsilogicsas) (optional)
156 o Create OVF file from qcow2 or raw disk image as:
157 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"
159 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
160 #### Start OVF conversion ####
161 Getting source image information
162 Converting source disk image to .vmdk
163 .....................................................
165 Output OVF is at: /home/vmware/centos_ovf/centos_qcow2.ovf
166 #### Completed OVF conversion ####
171 After installation of tool logs will get created at /usr/local/bin/OVF_converter/logs/ovf_converter.log file.
172 User can use these logs for debugging or trouble shooting.