Connect with us

Gadgets

How to Export OVF Template of a VM in vCenter

[ad_1]

Read this guide to learn how to export a VM’s OVF template file in vCenter web client or with the VMWare PowerCLI PowerShell commands.

Before exporting a VM’s OVF template, you must power it off.

Option 1: Export a VM’s OVF Template via vCenter Web Client

  1. From the vCenter web client, locate the VM, right-click it, point to Templates and select Export OVF Template.
  1. Then, on the pop-up window, give the template a name (the default is the name of the VM), and click OK.

The template files will start downloading to your browsers download folder.

Then, on the pop-up window, give the template a name (the default is the name of the VM), and click OK. Then, on the pop-up window, give the template a name (the default is the name of the VM), and click OK.

The process exports 5 files. See my screenshot below for the files.

The process exports 5 files. See my screenshot below for the files. The process exports 5 files. See my screenshot below for the files.

Option 2: Export a VM’s OVF Template with PowerShell

Before proceeding with the steps below, you must Install VMWare PowerCLI Module PowerShell Module.

  1. Open PowerShell as administrator and connect to your vCenter server with this command. Change ipmvcsa.corp.itechguides.com to your vCenter server and corpadministrator to an account with permission to export OVF files.
Connect-VIServer -Server ipmvcsa.corp.itechguides.com -Credential (Get-Credential corpadministrator)

When you execute the command, PowerShell will open a pop-up window requesting the password to the account. Enter the password and click OK.

  1. Once you’ve successfully signed in to vCenter server, run this command to export a VM’s OVF template.

Change the VM’s name, y2k22template-1 to the name of your VM. Also, modify the path, “D:OVF Templatesy2k22template-1” to a path on the PC you’re running the command.

Get-VM y2k22template-1 | Export-VM -Destination "D:OVF Templates" -Format Ovf

The command will take a while to run and may take some time, depending on the size of the VM you’re exporting.

Export a VM's OVF Template with PowerShellExport a VM's OVF Template with PowerShell

When the command completes, the folder should have 5 files, similar to the files downloaded with the vCenter web client.

Conclusion

Exporting a VM as an OVF template offers a way to migrate a VM between two environments that are not connected. I have used this method to move VMs to a different site.

I explained how to perform this task via the vCenter web client and with PowerShell. However, I prefer the PowerShell method because it gives me more control.

I hope you enjoyed reading the guide! Let me know your thoughts regarding this guide by responding to the “Was this page helpful?” feedback request below.

[ad_2]

Victor Ashiedu

Source link