| kasar | 6477377 | 2018-05-30 04:19:00 -0700 | [diff] [blame] | 1 | ## |
| beierl | c6b00f0 | 2019-10-07 13:09:24 -0400 | [diff] [blame] | 2 | # Copyright 2016-2019 VMware Inc. |
| kasar | 6477377 | 2018-05-30 04:19:00 -0700 | [diff] [blame] | 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 | |
| beierl | c6b00f0 | 2019-10-07 13:09:24 -0400 | [diff] [blame] | 22 | |
| kasar | 6477377 | 2018-05-30 04:19:00 -0700 | [diff] [blame] | 23 | This README file explains how to use OVF Converter Tool to generate OVF file from .qcow2, .img (raw) disk images. |
| 24 | |
| 25 | CONTENTS OF THIS FILE |
| 26 | ===================== |
| 27 | This readme file contains the following sections: |
| 28 | |
| 29 | o Introduction |
| 30 | o Tool Requirements |
| 31 | o Installation |
| 32 | o Usage |
| 33 | o Trouble shooting |
| 34 | o Release History |
| 35 | |
| 36 | |
| 37 | Introduction |
| 38 | ================== |
| beierl | c6b00f0 | 2019-10-07 13:09:24 -0400 | [diff] [blame] | 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 |
| 41 | and .ovf files. |
| 42 | |
| 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 |
| 45 | generated OVF. |
| 46 | |
| kasar | 6477377 | 2018-05-30 04:19:00 -0700 | [diff] [blame] | 47 | Generated OVF file can be used to deploy VM in Vmware vSphere or vCloud Director. |
| 48 | |
| 49 | Note- Currently this tool supports only Ubuntu platform. |
| 50 | |
| 51 | |
| 52 | Tool Requirements |
| 53 | ================== |
| 54 | |
| 55 | This tool requires the following software package: |
| beierl | c6b00f0 | 2019-10-07 13:09:24 -0400 | [diff] [blame] | 56 | o apt-get package manager |
| 57 | o qemu-utils |
| 58 | o python 2.7 |
| 59 | o python-lxml |
| 60 | o libxml2-dev |
| 61 | o libxslt-dev |
| 62 | o python-dev |
| 63 | o python-pip |
| 64 | |
| 65 | Install.sh script in this folder will install all of these software packages. |
| kasar | 6477377 | 2018-05-30 04:19:00 -0700 | [diff] [blame] | 66 | |
| 67 | |
| 68 | Installation |
| 69 | ================== |
| 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 |
| 73 | chmod a+x install.sh |
| 74 | 2. Run install.sh script as: |
| 75 | ./install.sh |
| beierl | c6b00f0 | 2019-10-07 13:09:24 -0400 | [diff] [blame] | 76 | |
| kasar | 6477377 | 2018-05-30 04:19:00 -0700 | [diff] [blame] | 77 | Sample output - |
| beierl | c6b00f0 | 2019-10-07 13:09:24 -0400 | [diff] [blame] | 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). |
| kasar | 6477377 | 2018-05-30 04:19:00 -0700 | [diff] [blame] | 95 | |
| beierl | c6b00f0 | 2019-10-07 13:09:24 -0400 | [diff] [blame] | 96 | t version (1:2.5+dfsg-5ubuntu10.6). |
| 97 | 0 upgraded, 0 newly installed, 0 to remove and 72 not upgraded. |
| kasar | 6477377 | 2018-05-30 04:19:00 -0700 | [diff] [blame] | 98 | |
| beierl | c6b00f0 | 2019-10-07 13:09:24 -0400 | [diff] [blame] | 99 | ################################################################# |
| 100 | ##### Done ##### |
| 101 | ################################################################# |
| 102 | root@ubuntu:/home/vmware/OVF_converter# |
| 103 | root@ubuntu:/home/vmware/OVF_converter# |
| 104 | |
| kasar | 6477377 | 2018-05-30 04:19:00 -0700 | [diff] [blame] | 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] |
| 108 | |
| 109 | |
| 110 | Usage |
| 111 | =================== |
| beierl | c6b00f0 | 2019-10-07 13:09:24 -0400 | [diff] [blame] | 112 | o Get version of tool as: |
| kasar | 6477377 | 2018-05-30 04:19:00 -0700 | [diff] [blame] | 113 | |
| beierl | c6b00f0 | 2019-10-07 13:09:24 -0400 | [diff] [blame] | 114 | 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# |
| kasar | 6477377 | 2018-05-30 04:19:00 -0700 | [diff] [blame] | 119 | |
| beierl | c6b00f0 | 2019-10-07 13:09:24 -0400 | [diff] [blame] | 120 | o 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] |
| kasar | 6477377 | 2018-05-30 04:19:00 -0700 | [diff] [blame] | 126 | [-m MEMORY] [-c CPU] [-d DISK] [-s OSTYPE] |
| beierl | c6b00f0 | 2019-10-07 13:09:24 -0400 | [diff] [blame] | 127 | [-dc DISK_CONTROLLER] [--cdrom] [-w 14] |
| kasar | 6477377 | 2018-05-30 04:19:00 -0700 | [diff] [blame] | 128 | path |
| 129 | |
| beierl | c6b00f0 | 2019-10-07 13:09:24 -0400 | [diff] [blame] | 130 | OVF converter to convert .qcow2 or raw image into OVF |
| kasar | 6477377 | 2018-05-30 04:19:00 -0700 | [diff] [blame] | 131 | |
| beierl | c6b00f0 | 2019-10-07 13:09:24 -0400 | [diff] [blame] | 132 | 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 | |
| 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" |
| 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 #### |
| kasar | 6477377 | 2018-05-30 04:19:00 -0700 | [diff] [blame] | 175 | |
| 176 | |
| 177 | Trouble shooting |
| 178 | ================== |
| 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. |
| 181 | |
| 182 | |
| 183 | Release History |
| 184 | =============== |
| 185 | |
| 186 | Version 1.0 |
| 187 | ------------- |
| 188 | |
| beierl | c6b00f0 | 2019-10-07 13:09:24 -0400 | [diff] [blame] | 189 | Initial release |
| 190 | |
| 191 | Version 1.1 |
| 192 | ------------- |
| 193 | |
| 194 | Adds support for cdrom |
| 195 | |
| 196 | Version 1.2 |
| 197 | ------------- |
| 198 | |
| 199 | Adds support for hardware version |
| 200 | Improves progress indicator |