blob: 1804a1dea9f22255ec8ac6d3c3d885744fdfa5b5 [file] [log] [blame]
kasar64773772018-05-30 04:19:00 -07001##
beierlc6b00f02019-10-07 13:09:24 -04002# Copyright 2016-2019 VMware Inc.
kasar64773772018-05-30 04:19:00 -07003# This file is part of ETSI OSM
4# All Rights Reserved.
5#
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
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
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
16# under the License.
17#
18# For those usages not covered by the Apache License, Version 2.0 please
19# contact: osslegalrouting@vmware.com
20##
21
beierlc6b00f02019-10-07 13:09:24 -040022
kasar64773772018-05-30 04:19:00 -070023This README file explains how to use OVF Converter Tool to generate OVF file from .qcow2, .img (raw) disk images.
24
25CONTENTS OF THIS FILE
26=====================
27This readme file contains the following sections:
28
29o Introduction
30o Tool Requirements
31o Installation
32o Usage
33o Trouble shooting
34o Release History
35
36
37Introduction
38==================
beierlc6b00f02019-10-07 13:09:24 -040039OVF 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
41and .ovf files.
42
43The user can optionally specify name and location of ovf file. Also, one can use command line options to give disk
44size (GB), memory (MB), number of cpus, OS type, disk controller required for VM which will get deployed using
45generated OVF.
46
kasar64773772018-05-30 04:19:00 -070047Generated OVF file can be used to deploy VM in Vmware vSphere or vCloud Director.
48
49Note- Currently this tool supports only Ubuntu platform.
50
51
52Tool Requirements
53==================
54
55This tool requires the following software package:
beierlc6b00f02019-10-07 13:09:24 -040056o apt-get package manager
57o qemu-utils
58o python 2.7
59o python-lxml
60o libxml2-dev
61o libxslt-dev
62o python-dev
63o python-pip
64
65Install.sh script in this folder will install all of these software packages.
kasar64773772018-05-30 04:19:00 -070066
67
68Installation
69==================
70User needs root privileges to install OVF Generator Tool.
71Follow below setups for installation of OVF Converter Tool.
721. Make install.sh script in this folder executable by running below command
73 chmod a+x install.sh
742. Run install.sh script as:
75 ./install.sh
beierlc6b00f02019-10-07 13:09:24 -040076
kasar64773772018-05-30 04:19:00 -070077 Sample output -
beierlc6b00f02019-10-07 13:09:24 -040078 #################################################################
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).
kasar64773772018-05-30 04:19:00 -070095
beierlc6b00f02019-10-07 13:09:24 -040096 t version (1:2.5+dfsg-5ubuntu10.6).
97 0 upgraded, 0 newly installed, 0 to remove and 72 not upgraded.
kasar64773772018-05-30 04:19:00 -070098
beierlc6b00f02019-10-07 13:09:24 -040099 #################################################################
100 ##### Done #####
101 #################################################################
102 root@ubuntu:/home/vmware/OVF_converter#
103 root@ubuntu:/home/vmware/OVF_converter#
104
kasar64773772018-05-30 04:19:00 -07001053. Now tool is installed at /usr/local/bin and available for all users
1064. User can access commands of OVF Generator Tool as:
107 ovf_converter path [output location] [ovf name][memory][cpu][disk][ostype][disk_controller]
108
109
110Usage
111===================
beierlc6b00f02019-10-07 13:09:24 -0400112o Get version of tool as:
kasar64773772018-05-30 04:19:00 -0700113
beierlc6b00f02019-10-07 13:09:24 -0400114 Command - ovf_converter -v
115 Sample output -
116 root@ubuntu:/home/vmware/OVF_converter# ovf_converter -v
117 1.0 - Initial Realse
118 root@ubuntu:/home/vmware/OVF_converter#
kasar64773772018-05-30 04:19:00 -0700119
beierlc6b00f02019-10-07 13:09:24 -0400120o See all command line options of tool as:
121 Command - ovf_converter -h
122 Sample output -
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]
kasar64773772018-05-30 04:19:00 -0700126 [-m MEMORY] [-c CPU] [-d DISK] [-s OSTYPE]
beierlc6b00f02019-10-07 13:09:24 -0400127 [-dc DISK_CONTROLLER] [--cdrom] [-w 14]
kasar64773772018-05-30 04:19:00 -0700128 path
129
beierlc6b00f02019-10-07 13:09:24 -0400130 OVF converter to convert .qcow2 or raw image into OVF
kasar64773772018-05-30 04:19:00 -0700131
beierlc6b00f02019-10-07 13:09:24 -0400132 positional arguments:
133 path absolute path to source image which will get convert
134 into ovf
135
136 optional arguments:
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)
149 (optional)
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)
162
163
164o 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"
166 Sample output -
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 .....................................................
172 Creating OVF
173 Output OVF is at: /home/vmware/centos_ovf/centos_qcow2.ovf
174 #### Completed OVF conversion ####
kasar64773772018-05-30 04:19:00 -0700175
176
177Trouble shooting
178==================
179After installation of tool logs will get created at /usr/local/bin/OVF_converter/logs/ovf_converter.log file.
180User can use these logs for debugging or trouble shooting.
181
182
183Release History
184===============
185
186Version 1.0
187-------------
188
beierlc6b00f02019-10-07 13:09:24 -0400189Initial release
190
191Version 1.1
192-------------
193
194Adds support for cdrom
195
196Version 1.2
197-------------
198
199Adds support for hardware version
200Improves progress indicator