Copy ESXi vm image to vSphere - vmware

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.

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.

moving Esxi 5.5 VMs to Esxi 6.7

I have a production server that hosts 3 VM's over Esxi 5.5.
Back in the day, I used a customized HP image to get ESXi installed on the Proliant server.
I have purchased a new server with Esxi 6.7 installed and wonder if I can move my 3 VM's hosted on the old HP server onto my new server (running ESXi 6.7).
The HP server sits 1500Km away so is challenging to test.
Did anyone come across any challenges removing VM's from one Host to another running different ESXi versions?
Thank you
You won't have any problems in the transportation process, but need to decide which transportation method use.
You can install vCenter Server Appliance then migrate with Storage vMotion.
If you do not want to install vCenter, you can turn the VMs power off and get an OVF copy to export (more on OVF here on vmware.com's site). You can then add this again from the deploy OVF section.
Link below for Vcenter installation.
https://www.tayfundeger.com/vcenter-server-appliance-6-7-kurulumu-bolum-1.html
https://www.tayfundeger.com/vcenter-server-appliance-6-7-kurulumu-bolum-2.html
Thanks.
VM objects are fairly backwards compatible and most go back quite a few years and a handful of versions, so you should be fine between those particular versions.
The biggest consideration is normally how to get the VM object data from point A to point B. Example:
Are you using storage based replication?
Are you SCPing the data directly from the hosts?
Are you exporting the VMs, transporting the data, and importing them?
Etc.
Yes, you can. The things you must take into account are:
1 - Hardware version. It's not possible to downgrade HW version through the ESXi UI. This won't be a problem in your case, as you are moving the VMs to a higher ESXi version that still supports ESXi 5.5's HW version. Once you have the VMs in the target server you can decide to upgrade to the most recent HW version for your new platform.
2 - VMFS version. ESXi 6.7 allows the use of VMFS-5 or VMFS-6, which is a newer version of the VMWare file system. You can indeed move VMs from VMFS-5 to VMFS-6. Nonetheless, unless it's unavoidable to do so, I would use the same VMFS version, as performing a cross-file system migration can make you fall into some incompatibilities that you should avoid.
3 - You will have to move your VMs over IP. If you don't own a VMWare license that allows you to migrate them, you can use an ESXi backup tool from 33hops.com that is compatible with unlicensed Free ESXi.
This XSIBackup-DC is a well-tested tool that allows to live migrate VMs over IP in licensed or unlicense versions of ESXi.

Is vmware vCenter server necessary for esxi + terraform

I am currently investigating terraform, is it possible to create VM with Terraform on Esxi 6 without vCenter Server? Since I only have free version of Esxi 6 installed. Thank you in advance.
I have a provider available that can talk directly to esxi without vcenter.
https://github.com/josenk/terraform-provider-esxi
I figure, that using Terraform, specifically the official vSphere provider without vCenter might be possible, but because Terraform internally uses the govmomi library that in turn uses the vSphere API it is not possible on the free Hypervisor, because it only allows read-only access to the vSphere API.
Hence, you need at least the Essential License and with it comes vCenter.
You can import an image without the APIs.
You can't clone images. Attempting to do so would give you errors such as https://communities.vmware.com/thread/310721?db=5 Can't clone a VM (The operation is not supported on the object").
The next question is if importing is enough. I don't know.
It does require vcenter. Vsphere essentials kit is an inexpensive option for a lab / dev environment setup.

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

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.