How can I deploy an ovf using vmrun? - vmware

Using VMware fusion I generally create new virtual machines using File->New->Import an existing virtual machine. I then select the ovf I have that I want to import from. I wanted to automate this process using vmrun and I was wondering how to register a new machine using this ovf.

You can't do it using vmrun. However, VMware OVF Tool is a command-line utility that allows you to import and export OVF packages to and from a wide variety of VMware platform products. Once you've imported the OVF, you can use vmrun to register the resulting VMX file, and do all the usual stuff with it.
Note that not all OVF files are equal. Some of them define vApps, which consist of multiple guests, and IIRC the tool will reject the input in that case.

Related

Can Packer build an AMI locally (that is, without connecting to AWS)?

Assume I have some special use-case. Please no answers like "why do you want to do this?" Simply put, is this supported behavior, and if so, could you point me to the relevant documentation?
You can import into AWS for the following image formats:
Open Virtualization Archive (OVA)
Virtual Machine Disk (VMDK)
Virtual Hard Disk (VHD/VHDX)
Raw
Packer supports:
vmware which can be exported as an OVF template.
hyper-v which can be exported as virtual machine or virtual hard disks.
AWS provides further instructions on how to import your VM as image here.

I need to migrate server from physical to GCP cloud

I'm looking for ways to migrate the server from physical to GCP cloud but there is a lot of challenges to be considered.
My plans are :
Lift and shift the data | thinking of this if not using velostrata
Migrate using GCP velostrata.
Migrate using velostrata was not so clear there is no defined way to do it. link -> https://cloud.google.com/migrate/compute-engine/docs/4.5/how-to/prepare-vms-servers/physical-servers
By going through the documentation it looks to be migrated to VMware first then to the GCP cloud.
Can you guys let me simplified the steps and confirmation on this?
GCP has a couple of options to migrate instances.
Import disk
The import tool supports most virtual disk file formats, including VMDK and VHD
This feature has the following limitations:
Linux virtual disks must use grub as the bootloader.
UEFI bootloaders are not supported for either Windows or Linux.
Linux virtual disks must meet the same requirements as custom images,
including support for Virtio-SCSI Storage Controller devices.
When installed on Windows virtual disks, application-whitelisting
software, such as Cb Protection by Carbon Black, can cause the import
process to fail. You might need to uninstall such software prior to
import.
If you are importing a virtual disk running RHEL, bring your own
license (BYOL) is supported only if the python-boto package is
installed on the virtual disk prior to import.
Operating systems on virtual disks must support ACPI
If you decide to go this route I recommend you to look and use the compatibility precheck tool
Velostrata
Velostrata supports 4 different sources of machines.
On-premise VM
Azure
AWS
Physical server
The guide you share indicates that you need to download "Migrate for Compute Engine Connector ISO image" (included in the link), save it in an USB and make it bootable.
Then you will need to continue with the steps here
You can also use the path you suggest to do a P2V migration to VMware environment using a tool such as VMconverter
Once your machine is in a VMware environment follow the on-premise Velostrata migration guide

xenserver vm import: what arguments pass to xe vm-import command in remote-config=

I wants to import vm from vmware to xenserver using xenserver conversion manager using xe command"
xe vm-import filename='' force=true host-password=<> host-username=<> preserve=false remote-config= ? sr-uuid=<> type=ESXServer
you can also see the command using xe help vm-import.
But I don't know what arguments pass in remote-config=
I hope the following two options directly answer your question as they are the shortest paths.
From VMWare, export your desired VM to a shared disk (or your desktop) -- making sure the output is in OVF format. From XenCenter, use the import utility: browsing to your shared disk and selecting the OVF file in question.
Depending on your version of XenServer there exists a virtual appliance to assist with pulling in VMs from VMware/VSphere. These are licensed options for the record, so opensource XenServer will not facilitate the functions of these solutions.
I will focus on XenServer 6.5, which download resources can be found at:
http://www.citrix.com/downloads/xenserver/product-software/xenserver-65.html
You will want to browse to the bottom of the page for "Optional Components" and download the XenServer Conversion Manager VPX 6.5.0 and/or Console tool for batch conversion.
After importing the appliance, the documentation on using it can be found in the Administration Guide.
From VMware, the VM should be exported to OVF form

How to compare vm Templates between two VMware vsphere environment?

I'm using two different vsphere environments for deploying my application. I'm using a template of pre-installed RHEL, and from time to time I want to update the template on both environment (usually for security reasons). While I'm updating one template and export-import to the other vsphere.
I tried to find some data to compare the templates (to ensure that I'm really use same one) such a checksum, without success.
To make it difficult my two vsphere are not in the same version, one is 5.1 the other is 5.5.
Thanks
You can export each template to OVA/OVF. Once this is done, inside the OVA or in the OVF folder there is an .mf file, with SHA1 file hashes for the files that make up the template. You should be able to compare those hashes between the templates and validate templates are identical.
Alternatively, once the OVA files are downloaded, you may choose to compute your own fileshashes based on whatever algorithm you prefer.
You are most likely interested in the vmdk file hashes, as the VMX may be different across different ESX versions. If it is different, you will need to find another way to compare the VMX to ensure the configuration, not just the data are identical.

How do you deploy VirtualSystemCollection enabled OVF/OVAs to ESXi?

When building an OVF, you can specify a tag for VirtualSystemCollection that allows you to have multiple VMs to share the same base disk image, but any changes that the individual machines make are Copy-On-Write into a private disk area for each specific VM.
When you try to deploy images setup this way to EXSi, it complains Unsupported element 'VirtualSystemCollection'. It would appear that you need the commercial vCenter or vApp servers from VMWare to utilize this feature. (From what I've been able to grok so far)
Is there a way to do this through free software (Free like ESXi, or opensource)
The ultimate goal is that I want to have a single disk image that's used as a base - and to bring up a cluster of VMs that are then individually configured so that for a VM with a 500 meg disk, I only need '500M + (num_vms * delta_per_vm)' rather than '500M * num_vms'
An ESXi connected to a vCenter should support this via vApps but since you wanted a non-commercial solution, the closest things is to use VirtualBox.
The open source VirtualBox has multi-attach support to achieve this with different disk formats and it works very well. It also has special qcow, qemu copy on write disk support. Basically, you create a master disk and attach to multiple VMs. (Huge disk space saving.)
It can also happily import multiple VMs from a single OVA file with VirtualSystemCollection but unfortunately, it still requires manual intervention to tell VirtualBox that disks are shared after importing all the VMs. (Well, it defeats the appliance deployement in the first place...)
After creating master disk (or after deployment), attaching to multiple VMs can be done with GUI or with the following command:
VBoxManage storageattach "vm-name" --storagectl "sata1" --port 0 --device 0 --type hdd --medium base.vdi --mtype multiattach
For more information, see http://www.electricmonk.nl/log/2011/09/24/multiple-virtualbox-vms-using-one-base-image-copy-on-write/ and http://virtbjorn.blogspot.com.tr/2012/12/virtualbox-multi-attach-disk.html
If you really want to use VMWare ESXi, you can use data deduplication to achieve the same task on block level. (which is generally used with cloud hosting companies). You can see the deduplication success rates with open source tools here: http://opendedup.org/deduprates
In VMware products, a multi-tier appliance (VirtualSystemCollection) is called a vApp. In vSphere, vApps live in vCenter and not ESX. So yes, you need vCenter to import a VirtualSystemCollection.
If you are using Workstation, you can also try the free vApprun tool:
https://labs.vmware.com/flings/vapprun
Here is what I did successfully to have such OVF images imported into my free ESXi server.
In the OVF file a XML element VirtualSystemCollection defines the vApp.
You can manually edit the OVF file and remove or comment this part as shown bellow. This will allow to import the VM into ESXi without vCenter once the OVF image is converted using VMware OVF Tool.
<!-- ovf:VirtualSystemCollection ovf:id="dummy-id">
<ovf:Info>A collection of virtual machines</ovf:Info>
<ovf:Name>dummy-name</ovf:Name>
<ovf:StartupSection>
<ovf:Info>VApp startup section</ovf:Info>
<ovf:Item ovf:id="dummy-id" ovf:order="0" ovf:startAction="powerOn" ovf:startDelay="0" ovf:stopAction="powerOff" ovf:stopDelay="0"/>
</ovf:StartupSection-->
Keep the remaining part intact and remove the following line at the end.
</ovf:VirtualSystemCollection>
Also make sure you have the last ESXi Embedded Host Client installed to avoid other bug related problems during import.
https://labs.vmware.com/flings/esxi-embedded-host-client
Converting OVF to VMX can be done using VMWare OVF Tool. In command line it looks simply as following:
ovftool <path_to_source>/<myvm>.ovf <path_to_target>/<myvm>.vmx