Tuesday, January 27, 2015

Fun in VMware land

This afternoon I was trying to deploy a VM and I was encountering a hardware problem moving from one platform to another (failed .ovf deployment – incompatible device backing specified for device ‘n’).  Googling I found that this error usually relates to a piece of hardware added to the vm, such as a serial port or cd-rom, that is not present on a newly created vm.  I also found out that there is no way to configure the vm to add that hardware before attempting to import an .ova file. 

Fortunately while banging my head against the desk in frustration I happened to notice that one of the respondents in the thread mentioned editing the .ovf file. 

This made me realize that the .ova file is really just a compressed file that contains the virtual disks (.vmdk) the xml configuration file (.ovf) and a .mx file.  More importantly it can be extracted using 7Zip.  I extracted the .ovf file and edited out the piece of hardware that I thought was causing the problem and placed it back in the compressed .ova file. 

This didn’t work because the .ovf needs to be at the beginning of the archive and I couldn’t place it there.  More head banging followed and then I thought about it an realized that vsphere can import the files separately.  I tried this and was told the file was corrupt.  A final round of smacking my head into the brick wall and I came up with my solution.

If you encounter this problem the following steps appear to work
  1. Extract the .ova file into a folder using 7Zip 
  2. Using notepad edit the .ovf file. 
  3. Save the file (Save as  XXXXXX.ovf (XXXXXX being the original name) file type – All files) 
  4. Open powershell and navigate to the folder containing the files and run the Get-FileHash utility   
  5.       a. Get-FileHash –Algorithm SHA1 XXXXXX.ovf 
  6. Copy the hash Open the .mc file and delete the old SHA1 hash associated with the.ovf file and paste in the one you just generated.  Save the .mc file in the same manner as in step 3.  
  7. Open VSphere and import the .ovf file using the Deploy OVF option. 

No comments: