본문 바로가기

VMware

VMware OVFTool

반응형

VMware OVF 확장자 개요

VMware에서 제공하는 Open Virtualization Format (OVF)는 가상 머신 및 가상 응용 프로그램을 표준화된 방식으로 기술하고 패키징하는 데 사용되는 개방형 표준입니다. OVF는 다양한 가상화 플랫폼 간에 호환성을 제공하며, 가상 환경의 배포, 설치, 관리 프로세스를 단순화합니다.
가상머신을 OVF로 내보내기를 하면 기본적으로 .ovf 파일(가상머신 구성 명세)과 .vmdk 파일(가상디스크)을 기본 구성으로 하고, 추가로 몇몇가지의 파일이 더 발생할 수 있습니다. 예를들어 CD-ROM 마운트가 되어 있으면 ISO파일을 추가로 생성하고, 무결성 검증을 위해 .mf파일이 추가로 생성 될 수 있습니다.

VMWare OVFTool

ovftool은 VMware에서 제공하는 클라우드 인프라 관리 도구입니다. 이 도구는 가상화 환경에서 가상 머신 이미지를 생성하고 관리하는 데 사용됩니다. ovftool은 Open Virtualization Format (OVF) 파일을 사용하여 가상 머신을 배포하고, 이를 다른 가상화 환경으로 전송할 수 있습니다.
주요 기능은 다음과 같습니다:

  • OVF 파일 생성: 가상 머신을 OVF 파일로 변환하여 배포할 수 있습니다.
  • 가상 머신 배포: 생성된 OVF 파일을 사용하여 다른 가상화 환경으로 가상 머신을 배포할 수 있습니다.
  • 가상 머신 관리: 배포된 가상 머신의 상태를 모니터링하고 관리할 수 있습니다.

vSphere/vCenter 내보내기 vs VMware OVFTool

두 가지 방식 모두 ovf 또는 ova파일로 내보내기가 가능합니다. 다만, OVFTool 사용 시 다양한 옵션을 사용하여 자세하게 조정이 가능하고, 다양한 환경에서 사용할 수 있습니다. 또한, vSphere의 내보내기 기능 사용 시 시간 초과 및 각종 Bug(내보내기 도중 예기치 못한 종료) 등을 해결하기 위해 OVFTool을 사용하는 경우가 많습니다.

VMware OVFTool Download

VMware Ovf 공식 다운로드 사이트에 접속하여 사용자 환경에 맞는 OVFTool 다운로드

<https://developer.broadcom.com/tools/open-virtualization-format-ovf-tool/latest>

OVFTool 압축 파일을 받아 폴더에 풀고 exe파일을 명령줄에서 실행하면 사용할 수 있다.

VMware OVFTool Usage

OVFTool Usage: Export VM as ovf from vsphere

Command:

PS> .\\ovftool "vi://<계정>:<패스워드>@<HOST_IP>/<VM_이름>" ./<생성할_파일명>.ovf

Example:

PS C:\\Users\\dongh\\Desktop\\Utility\\VMware-ovftool-4.6.3-24031167-win.x86_64\\ovftool> .\\ovftool "vi://root:P@ssw0rd@192.168.70.61/windows2008" ./windows2008.ovf

Opening VI source: vi://root@192.168.70.61:443/windows2008
Opening OVF target: ./windows2008.ovf
Writing OVF package: .\\windows2008.ovf
Transfer Completed
Completed successfully

아래와 같이 .mf 파일, .ovf파일, .vmdk파일, .nvram 파일이 생성됩니다.


OVFTool Help

PS C:\\Desktop\\Utility\\VMware-ovftool-4.6.3-24031167-win.x86_64\\ovftool> .\\ovftool.exe --help
Usage: ovftool [options] <source> [<target>]
where
<source>: Source URL locator to an OVF package, VMX file, or virtual machine in
          vCenter or on ESX Server.
<target>: Target URL locator which specifies either a file location, or a
          location in the vCenter inventory or on an ESX Server.

If <target> is not specified, information about the source is displayed to the
console.

Options:
     --acceptAllEulas            : Accept all end-user licenses agreements
                                   without being prompted.
     --addDevice                 : Adds a virtual device for all
                                   VirtualHardwareSections. The syntax is
                                   --addDevice:<type>[=<opt1>=<val1>[,<opt2>=<val2>...]].
                                   Device type currently can be only 'vtpm'.
                                   Valid options for vTPM devices are:
                                   required(true, false), name(text). Applies
                                   to vi, vmx, vapprun, vCloud, ovf, and ova
                                   source locators.
     --allowAllExtraConfig       : Whether we allow all the ExtraConfig
                                   options. These options are a security risk
                                   as they control low-level and potential
                                   unsafe options on the VM.
     --allowExtraConfig          : Whether we allow ExtraConfig options. These
                                   options are a security risk as they control
                                   low-level and potential unsafe options on
                                   the VM.
     --annotation                : Add annotation to vi, vmx, vapprun, vCloud,
                                   OVF, and OVA source locators
     --authdPortSource           : Use this to override default vmware authd
                                   port (902) when using a host as source.
     --authdPortTarget           : Use this to override default vmware authd
                                   port (902) when using a host as target.
     --chunkSize                 : Specifies the chunk size to use for files in
                                   a generated OVF package. The default is not
                                   to chunk. The chunk size without unit is
                                   assumed to be in megabytes. Accepted units
                                   are b, kb, mb, gb; e.g., 2gb or 100kb.
     --compress                  : Compress the disks in an OVF package. Value
                                   must be between 1 and 9. 1 is the fastest,
                                   but gives the worst compression, whereas 9
                                   is the slowest, but gives the best
                                   compression.
     --computerName              : Sets the computer name in the guest for a VM
                                   using the syntax --computerName:<VM
                                   ID>=<value>. Only applies to vCloud targets
                                   version 5.5 or newer.
     --configFile                : Configuration file to use to load options
                                   from.
     --coresPerSocket            : Specifies the distribution of the total
                                   number of CPUs over a number of virtual
                                   sockets using the syntax
                                   --coresPerSocket:<VM ID>=<value>. Only
                                   applies to vCloud targets version 5.5 or
                                   newer.
 -ds/--datastore                 : Target datastore name for a VI locator.
     --decodeBase64              : Decode option values with Base64.
     --defaultStorageProfile     : The storage profile for all VMs in the OVF
                                   package. The value should be an SPBM profile
                                   ID. Only applies to VI targets version 5.5
                                   or newer.
     --defaultStorageRawProfile  : The storage profile for all VMs in the OVF
                                   package. The value should be raw SPBM
                                   profile. The value will overwrite that in
                                   --defaultStorageProfile. Only applies to VI
                                   targets version 5.5 or newer.
     --deploymentOption          : Selects what deployment option to use (if
                                   the source OVF package supports multiple
                                   options.)
     --disableVerification       : Skip validation of signature and
                                   certificate.
 -dm/--diskMode                  : Select target disk format. Supported formats
                                   are: monolithicSparse, monolithicFlat,
                                   twoGbMaxExtentSparse, twoGbMaxExtentFlat,
                                   seSparse (VI target), eagerZeroedThick (VI
                                   target), thin (VI target), thick (VI
                                   target), sparse, and flat
     --diskSize                  : Sets the size of a VM disk in megabytes
                                   using the syntax --diskSize:<VM ID>,<disk
                                   instance ID>=<value>. Only applies to vCloud
                                   targets version 5.5 or newer.
     --eula                      : EULA to be inserted in the first virtual
                                   system or virtual system collection in the
                                   OVF. If the EULA is in a file, use the
                                   option --eula@=filename instead.
     --exportDeviceSubtypes      : Enables export of resource subtype for
                                   CD/Floppy/Parallel/Serial devices. This can
                                   limit portability as not all device backings
                                   are supported on all hypervisors. The
                                   default is false.
     --exportFlags               : Specifies one or more export flags to
                                   control what gets exported. The supported
                                   values for VI sources are mac, uuid, and
                                   extraconfig. Supported value for vCloud
                                   sources are preserveIdentity. One or more
                                   options can be provided, separated by
                                   commas.
     --extraConfig               : Sets an ExtraConfig element for all
                                   VirtualHardwareSections. The syntax is
                                   --extraConfig:<key>=<value>. Applies to vi,
                                   vmx, vapprun, vCloud, ovf, and ova source
                                   locators.
     --fencedMode                : If a parent network exists on the vCloud
                                   target, this property specifies the
                                   connectivity to the parent. Possible values
                                   are bridged, isolated, and natRouted.
 -h /--help                      : Prints this message.
     --hideEula                  : In OVF probe mode, hides the EULA.
     --importAsTemplate          : Import VM as a Template when deployed on a
                                   VI target.
     --ipAllocationPolicy        : IP allocation policy for a deployed OVF
                                   package.Supported values are: dhcpPolicy,
                                   transientPolicy, fixedPolicy,
                                   fixedAllocatedPolicy.
     --ipProtocol                : Select what IP protocol to use (IPv4, IPv6).
     --lax                       : Relax OVF specification conformance and
                                   virtual hardware compliance checks. Use only
                                   if you know what you are doing.
     --locale                    : Selects locale for target.
     --machineOutput             : Output OVF Tool messages in a machine
                                   friendly manner.
     --makeDeltaDisks            : Build delta disk hierarchy from the given
                                   source locator.
     --maxVirtualHardwareVersion : The maximal virtual hardware version to
                                   generate.
     --memorySize                : Sets the memory size in megabytes of a VM
                                   using the syntax --memorySize:<VM
                                   ID>=<value>. Only applies to vCloud targets
                                   version 5.5 or newer.
     --multiDatastore            : List of target datastore names for a VI
                                   locator. datastore assignment is set using
                                   the syntax

                                   --mdatastore:<ovf:diskId>=<targetdatastore-name>.
                                   multiple mds parameteres are used to specify
                                   multiple datastore mappings. e.g.
                                   --mdatastore:vmdisk1=datastore1
                                   --mdatastore:vmdisk2=datastore2
                                   The multi datastore flags can not be used
                                   along with --datastore flag.
 -n /--name                      : Specifies target name (defaults to source
                                   name).
     --net                       : Set a network assignment in the deployed OVF
                                   package. A network assignment is set using
                                   the syntax --net:<OVF name>=<target name>.
                                   If the target is vCloud 5.5 or newer, a
                                   fence mode can also be specified using the
                                   syntax --net:<OVF name>=<target name>,<fence
                                   mode>. Possible fence mode values are:
                                   bridged, isolated, and natRouted.
 -nw/--network                   : Target network for a VI deployment.
     --nic                       : Specifies NIC configuration in a VM using
                                   the syntax --nic:<VM ID>,<index>=<OVF net
                                   name>,<isPrimary>,<ipAddressingMode>,<ipAddress>.
                                   Possible values for ipAddressingMode are:
                                   DHCP, POOL, MANUAL, and NONE. ipAddress is
                                   optional and should only be used when
                                   ipAddressingMode is set to MANUAL. Only
                                   applies to vCloud targets version 5.5 or
                                   newer.
     --noDestinationSSLVerify    : Skip SSL verification for target VI
                                   connections.
     --noDisks                   : Disable disk conversion.
     --noImageFiles              : Do not include image files in destination.
     --noNvramFile               : Do not include nvram file in destination.
     --noProxyVerify             : Skip Proxy SSL verification.
     --noSSLVerify               : Skip SSL verification for VI connections.
     --noSourceSSLVerify         : Skip SSL verification for source VI
                                   connections.
     --numberOfCpus              : Sets the number of CPUs for a VM using the
                                   syntax --numberOfCpus:<VM ID>=<value>. Only
                                   applies to vCloud targets version 5.5 or
                                   newer.
 -o /--overwrite                 : Force overwrites of existing files.
     --packageCert               : Package a source OVF files with a
                                   certificate file into an OVA as is with no
                                   modifications.
     --parallelThreads           : Specifies how many threads should be used
                                   for parallel transfer.
     --powerOffSource            : Ensures a VM/vApp is powered off before
                                   importing from a VI source.
     --powerOffTarget            : Ensures a VM/vApp is powered off before
                                   overwriting a VI target.
     --powerOn                   : Powers on a VM/vApp deployed on a VI target.
     --preCheck                  : Require pre check validations before
                                   import/export, default is true
     --privateKey                : Sign OVF package with the given private key
                                   (.pem file). The file must contain a private
                                   key and a certificate.
     --privateKeyPassword        : Password for the private key. Should be used
                                   in conjunction with privateKey if the
                                   private key requires password
                                   authentication. If required and not
                                   specified, the tool will prompt for the
                                   password.
     --prop                      : Set a property in the deployed OVF package.
                                   A property is set using the syntax
                                   --prop:<key>=<value>.
     --proxy                     : Proxy used for HTTP[S] access.
     --proxyCert                 : Specify full path to Proxy Certificate.
     --proxyNTLMAuth             : Enable NTLM authentication for proxy.
     --proxyPassword             : Proxy password.
     --proxyUsername             : Proxy user name.
     --pullUploadMode            : Pull mode used in uploading files to VI
                                   target, i.e. target pulls files.
 -q /--quiet                     : No output to screen except errors.
     --requireSignature          : Require validation of signature and
                                   certificate.
     --schemaValidate            : Validate OVF descriptor against OVF schema.
     --shaAlgorithm              : Select SHA digest algorithm when creating
                                   OVF package. Supported values are SHA1,
                                   SHA256 and SHA512. Default value is SHA256.
     --signCommand               : User callback to sign a manifest (.mf) file.
                                   The command will take the .mf file as a
                                   single argument and should generate a
                                   complimentary .cert in the same directory.
     --skipManifestCheck         : Skip validation of OVF package manifest.
     --skipManifestGeneration    : Skip generation of OVF package manifest.
     --sourcePEM                 : File path to PEM formatted file used to
                                   verify VI connections.
     --sourceSSLThumbprint       : SSL fingerprint of SOURCE. OVF Tool verifies
                                   the SSL fingerprint it gets from SOURCE if
                                   the value is set.
 -st/--sourceType                : Explicitly express that source is OVF, OVA,
                                   VMX, VI, vCloud, ISO, FLP, vApprun
     --sslCipherList             : Use this to override default OpenSSL ciphers
                                   suite.
     --sslVersion                : Use this to set preferred TLS/SSL version
                                   for HTTPS connections. The valid values are
                                   as following:
                                     TLSv1_0: Set preferred TLS/SSL version to
                                   TLSv1.0.
                                     TLSv1_1: Set preferred TLS/SSL version to
                                   TLSv1.1.
                                     TLSv1_2: Set preferred TLS/SSL version to
                                   TLSv1.2.
     --storageProfile            : Sets the storage profile for a VM using the
                                   syntax --storageProfile:<VM ID>=<value>.
                                   Only applies to vCloud targets version 5.5
                                   or newer.
     --targetPEM                 : File path to PEM formatted file used to
                                   verify VI connections.
     --targetSSLThumbprint       : SSL fingerprint of TARGET. OVF Tool verifies
                                   the SSL fingerprint it gets from TARGET if
                                   the value is set.
 -tt/--targetType                : Explicitly express that target is OVF, OVA,
                                   VMX, VI, vCloud, ISO, FLP, vApprun
     --vCloudTemplate            : Create only a vApp template. Default value
                                   is false
     --vService                  : Set a vService assignment in the deployed
                                   OVF package. A vService assignment is set
                                   using the syntax
                                   --vService:<dependencyId>=<providerId>.
     --verifyOnly                : Do not upload the source but only verify it
                                   against the target host. Applies to VI 4
                                   targets only.
     --verifyViTargetManifest    : Verify Sha1 digest of deployed files on a VI
                                   target.
 -v /--version                   : Prints the version of this tool.
     --viCpuResource             : Specify the CPU resource settings for
                                   VI-locator targets. The syntax is
                                   --viCpuResource=<shares>:<reservation>:<limit>.
     --viMemoryResource          : Specify the CPU resource settings for
                                   VI-locator targets. The syntax is
                                   --viMemoryResource=<shares>:<reservation>:<limit>.
 -vf/--vmFolder                  : Target VM folder in VI inventory (relative
                                   to datacenter).

For more help, type: --help <topic>, where topics are:
 locators    : For detailed source and destination locator syntax
 examples    : For examples of use
 config      : For syntax of configuration files
 debug       : For debug purpose
 integration : For a list of options primarily used when ovftool is exec'ed
               from another tool or shellscript.

 
감사합니다.

반응형