blob: 0e6117b9431dbcce4f59d36e255f95e53240bca7 [file] [log] [blame]
kasar64773772018-05-30 04:19:00 -07001##
2# Copyright 2016-2017 VMware Inc.
3# 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
22This README file explains how to use OVF Converter Tool to generate OVF file from .qcow2, .img (raw) disk images.
23
24CONTENTS OF THIS FILE
25=====================
26This readme file contains the following sections:
27
28o Introduction
29o Tool Requirements
30o Installation
31o Usage
32o Trouble shooting
33o Release History
34
35
36Introduction
37==================
38OVF 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.
39Given a path to .qcow2 image this tool can generate .vmdk and .ovf files.
40User 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.
41Generated OVF file can be used to deploy VM in Vmware vSphere or vCloud Director.
42
43Note- Currently this tool supports only Ubuntu platform.
44
45
46Tool Requirements
47==================
48
49This tool requires the following software package:
50o apt-get package manager
51o qemu-utils
52o python 2.7
53o python-lxml
54o libxml2-dev
55o libxslt-dev
56o python-dev
57o python-pip
58
59Install.sh script in this folder will install all of these
60software packages.
61
62
63Installation
64==================
65User needs root privileges to install OVF Generator Tool.
66Follow below setups for installation of OVF Converter Tool.
671. Make install.sh script in this folder executable by running below command
68 chmod a+x install.sh
692. Run install.sh script as:
70 ./install.sh
71
72 Sample output -
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).
90
91 t version (1:2.5+dfsg-5ubuntu10.6).
92 0 upgraded, 0 newly installed, 0 to remove and 72 not upgraded.
93
94 #################################################################
95 ##### Done #####
96 #################################################################
97 root@ubuntu:/home/vmware/OVF_converter#
98 root@ubuntu:/home/vmware/OVF_converter#
99
1003. Now tool is installed at /usr/local/bin and available for all users
1014. User can access commands of OVF Generator Tool as:
102 ovf_converter path [output location] [ovf name][memory][cpu][disk][ostype][disk_controller]
103
104
105Usage
106===================
107o Get version of tool as:
108
109 Command - ovf_converter -v
110 Sample output -
111 root@ubuntu:/home/vmware/OVF_converter# ovf_converter -v
112 1.0 - Initial Realse
113 root@ubuntu:/home/vmware/OVF_converter#
114
115o See all command line options of tool as:
116 Command - ovf_converter -h
117 Sample output -
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]
123 path
124
125 OVF converter to convert .qcow2 or raw image into OVF
126
127 positional arguments:
128 path absolute path to source image which will get convert
129 into ovf
130
131 optional arguments:
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)
144 (optional)
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)
154
155
156o 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"
158 Sample output -
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 .....................................................
164 Creating OVF
165 Output OVF is at: /home/vmware/centos_ovf/centos_qcow2.ovf
166 #### Completed OVF conversion ####
167
168
169Trouble shooting
170==================
171After installation of tool logs will get created at /usr/local/bin/OVF_converter/logs/ovf_converter.log file.
172User can use these logs for debugging or trouble shooting.
173
174
175Release History
176===============
177
178Version 1.0
179-------------
180
181Initial release