VMware vSphere – How to Import and Export OVF and OVA Files

KB ID 0000562

Problem

I prefer to think of OVF Templates as “Zip” files for Virtual Machines and Virtual Appliances. Where as the OVA file is the complete appliance pre packaged. There are two things you will want to do with an OVF Template;

1. Export a VM to an OVF Template

2. Import an OVF Template (Note: VMware call this “Deploy an OVF Template”)

Note: There are tools for OVF templates for other VMware virtualisation products, this is just for vSphere / ESX.

Tech Note: I find it a lot simpler to do this from PowerCLI now, see the article below;

VMware: Export a VM to OVA With PowerCLI

Solution

Export a Virtual Machine to OVF (vSphere v6)

Note: Machine must be Powered Off and have No Snapshots!

Select the VM > Templates > Export OVF Template.

Change the name, annotation as required > OK.

Your files will be downloaded, (the location will depend on your browser settings!)

 

Export a Virtual Machine to OVF (vSphere v3, v4 and v5)

Note: Machine must be Powered Off and have No Snapshots!

1. Connect to your host with the VI client > With your virtual machine powered off > Select it > File > Export > Export to OVF Template.

2. Select a location to save the files to > OK.

3. Depending on the size of the VM this can take a while.

4. It will give you the following message when it’s finished.

5. Here are the files that it has created.

Import / Deploy an OVF Template to a Virtual Machine

HTML5 Web Client: You can select Deploy OVF Template from either the Cluster or Host Level.

Flash Web Client: If importing OVA or OVF files into vSphere via the vSphere Web client, you can import them at the vCenter, Host, or Cluster Level.

 

From this point forward: The procedure is the same for both Flash and HTML5 clients, Ill show the process using the HTML5 client.

Choose Files > Navigate to and select ALL the applicable files > Next.

  

Give the new VM a name, and, (if applicable) select a folder to put it into > Next > Select a host to deploy to > Next.

Review details > Next > Choose the storage, (and optionally disk format) > Next.

Select the Port Group you want to connect the new VM to > Next > Again review the details > Finish.

 

Import / Deploy an OVF Template to a Virtual Machine (vSphere v3, v4 and v5)

1. To create a VM from an OVF template, connect to your host with the VI client > File > Deploy OVF Template.

2. Browse to the location that the .ovf file is stored > Next.

3. Read the details > Next.

4. Give the new VM a name > Next.

5. Select the disk format (Thick or Thin) you want the new VM to use.

What does Lazy Zeroed and Eager Zeroed Mean?

Data on disks is stored as a 1 (one) or a 0 (zero), so if all the blocks on the disk are set to zero, when you put data on the disk, it only has half the work to do (i.e. write the ones). Eager Zeroed, puts zeros on all the blocks on the disks straight away, Lazy Zeroed puts all zeroes in a block the first time the block is read.

6. Read the summary, and if you want to power on the VM on completion, tick the box > Finish.

7. Depending upon the amount of data this can take a while.

8. It will give you the following message when it’s finished.

9. And here is your VM, imported, powered up, and working.

Related Articles, References, Credits, or External Links

Original Article Written 26/01/12

VMware ESXi – Converting ‘Thick’ Provisioned Drives to ‘Thin’, and ‘Thin’ to ‘Thick’

KB ID 0000579 

Problem

Thin provisioning of hard drives is pretty cool stuff, full support for thin provisioning was brought in with vSphere version 4. Put simply a thin proviosioned drive is as big as it needs to be, and a thick provisioned drive is set to its maximum size when it’s created. The virtual machines that use these hard drives don’t know, and assume that their hard drive is a set size (even if it is thin proviosioned).

Thick provisioned drives should be used for machines/applications that will have intensive input/output (RAW mappings are also better for this). But what happens if you want to convert them? From Thin to Thick is very simple (see below), But from Thick to thin is a little more convoluted.

Note: You can change drive provisioning by running the Converter on the virtual machine, and change the disk provisioning as part of the conversion process (click here for details).

Solution

ESXi Converting Thick to Thin Provisioned Drives

1. Here you can see I’ve got a VM (Server 2008 R2) with a 40GB vmdk file (Hard Drive). You can also see it’s in a datastore called ‘RAID5’. Before you start make sure the VM using this disk is shut down.

2. Log into your ESX box via SSH, I’m logged in as ‘root’ if you are not don’t forget to ‘su’. To find out what the symbolic link is for the RAID5 datastore issue the following comand;

[box] ls -l /vmfs/volumes/ [/box]

From the output below we can see RAID5 is called “4f214fe5-c5ce77b0-a889-00110a59a5d6”.

3. Using the Symlink and the path (from the datastore browser, see step one) you can construct the command, use the following syntax;

[box] vmkfstools -i /vmfs/volumes/{volume-symbolic-link}/{folder}/{original-drive-name}.vmdk /vmfs/volumes/{volume-symbolic-link}/{folder}/{new-drive-name}.vmdk -d ‘thin’ -a lsilogic [/box]

If you didn’t turn off the machine (I did tell you in step one!) you will see the following;

4. Now we have a “New” thin provisioned drive cloned form the old one, go to the properties of your VM (Edit Settings). And remove the old drive.

5. Then add in your new “Thin” Drive.

6. It should look a little like this.

7. Now power up your VM and, once you are happy, don’t forget to DELETE the old thick provisioned drive.

ESXi Converting Thin to Thick Provisioned Drives

1. This is much simpler to do; browse the datastore in question and locate the vmdk file you want to convert. Right click it and select “Inflate”.

8. The drive will be converted.

9. You can also see its progress in the VI client’s “Recent Taks”.

 

Related Articles, References, Credits, or External Links

Virtual Center (VIM) Resizing Guest Hard Drive Sizes With VMware Converter

Re sizing Windows Volumes / Drives in VMware vSphere / ESX