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

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

Related

How to create a datastore for installing a VM

I have just installed VMware ESXi 7 as a virtual machine just for learning. I have seen it is feasible to create nested vms using VMware Player Workstation plus Intel chipset: my testing purpose is to create a virtual machine inside a virtualized ESXi server.
Actually I cannot install any vm, probably due to the fact I have not created any datastore yet.
In order to create a datastore I thought to edit the partition of the free space avalaible (for a linux vm 20GB are enough), but when I try to edit partition I get such summary in which I cannot configure anything at all (see pics).
Have you any suggestion?
When you install SO it's not a good practice to add it as a datastore. Please turn off you VM and add another disk to ESXI. After you boot up server again you will be able to create a new datastore.

Set CPU affinity for specific VM on VMware ESXI using govc CLI

I have shell scripts that I use to programmatically configure my virtual machines (VMs) on my VMware ESXi host. I use the "govc" command-line-interface (CLI) which provides a suite of commands to configure my VMs that run on my ESXI (i.e., powering on, setting ram, etc...)
I am trying now to set the CPU affinity for some of my virtual machines (i.e., VM #2 should use CPUs 9-16 whereas VM#1 should use CPU 2-8). However, I cannot find any govc command to do this programmatically, though I can very clearly see how to do this within the ESXI web-based GUI:
I reference the govc API for commands here, but again, I could not find anything. The CPU affinity should be set for a specific VM, and there should be an argument of CPU numbers separated by comma or with hyphen (-) for a range, I would imagine:
govc usage
How can I fix this problem with VMware ESXi and govc?
That's not a configuration that's been enabled at the govc level, as Doug mentioned in your issue.
Alternatively, you could use other CLIs, like PowerCLI which is PowerShell based, and has a lot more coverage area for more in-depth tasks like this, or the govmomi SDK, which has full API coverage.
As Kyle Ruddy stated, it couldn't be done via govc, but it can be done by finding your .VMX file for your respective VM on the ESXi datastore and simply add this line to your .vmx file.
sched.cpu.affinity = 1,2,3,4,5 // Values are separated by commas
You can double check your ESXi, by selecting the VM and going into its settings and you will see the CPU Scheduled Affinity Range that you set via the VMX file.
Of course , if you have a lot of CPUs, you can have some script (Bash, etc.) with a for loop populate the comma-delimited CPU values.

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

Copy ESXi vm image to vSphere

It is possible to copy image from a VMware ESXi 5.0 server to a vSphere 5.0 server.
Is there any compatibility issues?
Thanks
not a problem. i would use esxi File->Export->Export OVF Template. then you can deploy the exported ovf template into vsphere5 vcenter. I am assuming by vSphere 5.0 server you mean vcenter, as opposed to standalone hypervisor esxi5.0.
you could also just copy files with file system commands (with the vm shut down) from one place to another, but ovf is more robust and general more optimized.
if your vcenter still have extra license, you can also add the esxi5.0 host to the vcenter temporarily (if the host is reachable from the vcenter) and you can then just clone the vm.
I think you can choose host you want to up image. After you choose configuration/storage. Click right storage --> Browse Datastore, you can export/import image.

move a virtual machine from one vCenter to another vCenter

I have the following problem:
There two separate vCenters (ESXi). They cannot see each other or communicate in any way.
I can create a Clone of a VM in vCenter1 but then I want to move that Clone in vCenter2.
Is there a way that I can copy the Cloned VM (files) on an external HDD and move them in the other vCenter?
I've figure it out the solution to my problem:
Step 1: from within the vSphere client, while connected to vCenter1, select the VM and then from "File" menu select "Export"->"Export OVF Template" (Note: make sure the VM is Powered Off otherwise this feature is not available - it will be gray). This action will allow you to save on your machine/laptop the VM (as an .vmdk, .ovf and a .mf file).
Step 2: Connect to the vCenter2 with your vSphere client and from "File" menu select "Deploy OVF Template..." and then select the location where the VM was saved in the previous step.
That was all!
Thanks!
Yes, you can do this.
Copy all of the cloned VM's files from its directory, and place it on its destination datastore.
In the VI client connected to the destination vCenter, go to the Inventory->Datastores view.
Open the datastore browser for the datastore where you placed the VM's files.
Find the .vmx file that you copied over and right-click it.
Choose 'Register Virtual Machine', and follow whatever prompts ensue. (Depending on your version of vCenter, this may be 'Add to Inventory' or some other variant)
The VM registration process should finish with the cloned VM usable in the new vCenter!
Good luck!
For moving a virtual machine you need not clone the VM, just copy the VM files (after powering the VM off) to external HDD and register the same on destination host.
A much simpler way to do this is to use vCenter Converter Standalone Client and do a P2V but in this case a V2V. It is much faster than copying the entire VM files onto some storage somewhere and copy it onto your new vCenter. It takes a long time to copy or exporting it to an OVF template and then import it. You can set your vCenter Converter Standalone Client to V2V in one step and synchronize and then have it power up the VM on the new Vcenter and shut off on the old vCenter. Simple.
For me using this method I was able to move a VM from one vCenter to another vCenter in about 30 minutes as compared to copying or exporting which took over 2hrs. Your results may vary.
This process below, from another responder, would work even better if you can present that datastore to ESXi servers on the vCenter and then follow step 2. Eliminating having to copy all the VMs then follow rest of the process.
Copy all of the cloned VM's files from its directory, and place it on its destination datastore.
In the VI client connected to the destination vCenter, go to the Inventory->Datastores view.
Open the datastore browser for the datastore where you placed the VM's files.
Find the .vmx file that you copied over and right-click it.
Choose 'Register Virtual Machine', and follow whatever prompts ensue. (Depending on your version of vCenter, this may be 'Add to Inventory' or some other variant)
Copying the VM files onto an external HDD and then bringing it in to the destination will take a lot longer and requires multiple steps. Using vCenter Converter Standalone Client will do everything for you and is much faster. No external HDD required. Not sure where you got the cloning part from. vCenter Converter Standalone Client is simply copying the VM files by importing and exporting from source to destination, shutdown the source VM, then register the VM at destination and power on. All in one step. Takes about 1 min to set that up vCenter Converter Standalone Client.
You don't have to export your VMs at all. You can move the VM and clone to a TAXI host in vCenter 1. Then add the host to vCenter 2, and vMotion away whatever VMs to other hosts previously managed by vCenter 2. When done, you can add the TAXI host back to vCenter 1.
If you'd like to do this using the command line, you can do this if you have ESXi 6.0 (or possibly even ESXi 5.5) running, by using govc, which is a very helpful utility for interacting with both your vCenter and its associated resources.
Depending on your setup, you can
# setup your credentials
export GOVC_USERNAME=YOUR_USERNAME GOVC_PASSWORD=YOUR_PASSWORD
govc export.ovf -u your-vcsa-url.example.com -vm VM_NAME -dc VMS_DATACENTER export-folder
Then, you'll have your VM VM_NAME exported in the folder export-folder. From there, you can then
govc import.ovf -u your-other-vcsa-url.example.com -vm NEW_VM_NAME -dc NEW_DATACENTER export-folder/VM_NAME.ovf
That'll import it into your other vCenter. You might have to specify -ds NEW_DATASTORE too, if you have more than one datastore available, but govc will tell you so if you need to.
The commands above require that govc is installed, which you should, because it's far better than ovftool either way.