In the end, the import was a success, and my colleague met their deadline. You can read more about the process here. This took a little longer than expected but was straightforward. While the previous import attempt would work great with a vCenter cluster, it was simply not going to work in this situation. After that, select Finish and the import begins. The wizard walks you through each step, give the imported appliance a name, choose the OVF, datastore, deployment type (thick or thin provisioned), and verify the configuration. No worries, I could still connect to the web interface of the host and manually import using the HTML5 interface. This is a limitation that VMware enforces. I read the error message, and sure enough, the host is not a part of a vCenter cluster and therefore does not have proper licensing to complete the import using PowerCLI. Something happened when I began to import the previously exported VM appliance. In my instance, this failed because I didn’t notice that I was actually connecting to another vCenter cluster. PS6> $vmHost | Import-vApp -Source 'C:\Exported-OVF\My_VM_Template\My_VM_Template.ovf' -Datastore $myDatastore -Forceīut wait! This doesn’t work. PS6> $myDatastore = Get-Datastore -Name "MyDatastore1" You can then use both objects to pass to the Import-Vapp cmdlet to import it. To do so, you’ll need to query the datastore to import it into along with the VM host. You should now have a file sitting on your local file system. When complete, you should have an appliance ready to be deployed into another vCenter environment. This process will take a few minutes, and wasn’t a very large appliance to begin with. With the template appliance now offline, resume running the Export-VApp cmdlet attempted earlier. PS6> Shutdown-VMGuest -VM 'My_VM_Template'
IMPORT OVF VMWARE TO HYPER V CODE
Modify your code a little more and be sure to first shut down the VM using the Shutdown-VMGuest cmdlet. You cannot export a running VM to an OVF. PS6> Export-VApp -VM 'My_VM_Template' -Destination 'C:\Exported-OVF\'īut there’s an issue. Knowing this, you can then run Export-VApp against the VM template specifying the destination folder. I already have a path in mind so I’m going to be using the C:\Exported-OVF directory but yours may vary. The Export-VApp cmdlet will export the powered off VM as an OVF to the current directory you session is in by default if you do not specify a path. But first, since this is a learning experience for me and maybe you, I’ll educate myself a little more on the proper use for each. You can do this using the Get-Command -Module PowerCLI cmdlet.īoth of these cmdlets appear to be exactly what you need. Once you’ve connected, you need to know what verbs to use. I gathered the necessary information from my colleague, and began connecting to the cluster: PS6> Connect-VIServer -Server -Credential ( Get-Credential) Never wanting to miss a chance to use PowerShell or PowerCLI, I jumped in head first to help.