VMware Cloud Community
JPrez
Contributor
Contributor

Can't Import a VM Successfully on ESXI 6.5 U2

Hello,

I previously had ESXI 6.5 and copied two files from the data store when the VM was powered off:

  • dIsk-0.vmdk
  • Server.ovf

Attempting to import these two files via vcenter (VM -> Deploy OVF Template) results in this confirmation screen:

The OVF package contains advanced configuration options, which might pose a security risk. Review the advanced configuration options below. Click next to accept the advanced configuration options.
PublisherNo certificate present
Download sizeUnknown
Size on diskUnknown (thin provisioned)
150.0 GB (thick provisioned)
Extra configuration

virtualHW.productCompatibility = hosted

nvram = Ubuntu 64-bit VPN Server.nvram

Once I click Next a few times and finish, a long pause at 0% in the task window appears followed by Failed to Deploy OVF Package, Transfer failed: Invalid response code: 500.

Tried using the ovftool, similar error:

--

Opening VI target: vi://root@192.168.0.253:443/

Deploying to VI: vi://root@192.168.0.253:443/

Transfer Failed

Error: Bad response code (500) from POST request

--

What am I doing incorrectly? 

Attempting to import this same VM into VM Player also fails.

Thanks

16 Replies
continuum
Immortal
Immortal

Dont know what you are doing wrong ...

I would open the ovf-file in a text-editor and translate it to the usual vmx-syntax manually.

A one piece vmdk is either "streamoptimized" or "monolithicSparse"  so importing it to to ESXi format can be done with

vmkfstools -i disk-0.vmdk esxi-compatible.vmdk

When that works - you can still figure out how to do the same with the standard procedures.


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos
JPrez
Contributor
Contributor

Out of curiosity, why would the vmkfstools be needed?   The VMDK file was exported from VMWare ESXI so I'd imagine it would be able to be imported?   Guess I'm just unclear on the response as I'm not sure what the proper syntax of a OVF file would be or why it would not be in the correct format to begin with.

Thanks

Reply
0 Kudos
ThompsG
Virtuoso
Virtuoso

Hi JPrez,

Its because in your post you refer to two files: a ovf and a vmdk. With ESXi a vmdk is normally made up of two pieces - the descriptor and the data file (flat). If you only had one vmdk file then it is likely to be one of the other types as mentioned by continuum

Kind regards.

Reply
0 Kudos
continuum
Immortal
Immortal

Native ESXi vmdk format is not at all space efficient as soon as you leave the VMFS filesystem - so the export function converts the vmdk to a format that is space efficient on filesystems like NTFS, EXT4 ... whatever.

To be precise:

OVF-export reads vmdk-type "vmfs", "vmfssparse" or "sesparse" and outputs a "streamoptimized" vmdk-type.

Thats the vmdk-part.

The ovf-file itself is a xml-format that basically is nothing but a vmx-textfile wrapped in some extralines.

> The VMDK file was exported from VMWare ESXI so I'd imagine it would be able to be imported?
Yes - you do that either via vmkfstools - if you want predictable results.

Or you  use import or export functions - which will act like a wrapper for vmkfstools - but are less reliable and less useful for troubleshooting.


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

JPrez
Contributor
Contributor

Any other ideas?

vmkfstools -i disk-0.vmdk new.vmdk

DiskLib_Check() failed for source disk The file specified is not a virtual disk (15).

If I open the vmdk with a text editor, I see:

KDMV          À     €                                   ÿÿÿÿÿÿÿÿ€       

                                                                                                                                                                                                                                                                                                                                                                                                                                                   # Disk DescriptorFile

version=1

CID=18d5e735

parentCID=ffffffff

createType="streamOptimized"

# Extent description

RDONLY 314572800 SPARSE "generated-stream.vmdk"

Thanks

Reply
0 Kudos
continuum
Immortal
Immortal

Ok

we may need to load a special module first

esxcli system module load -m multiextent

But I am not sure about this - thought this was no longer a problem.

If that does not help I would suggest to modify the embedded descriptor.

Do not read the vmdk-descriptor  with a texteditor - extract it and work with the extracted descriptor.

To extract use

dd if=disk-0.vmdk of=descriptor.txt bs=1 skip=512 count=1024

Attach descriptor.txt to your next reply.


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos
continuum
Immortal
Immortal

Most trivial reason ....

The file may have been renamed, Rename

disk-0.vmdk

to

generated-stream.vmdk

and then try vmkfstools -i again


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos
JPrez
Contributor
Contributor

Thanks for the info...

A few updates:

1)  renaming the vmdk to generated-stream.vmdk and running vmkfstools -i again resulted in the same error as before.

2) Here's the output of descriptor.txt:

# Disk DescriptorFile

version=1

CID=18d5e735

parentCID=ffffffff

createType="streamOptimized"

# Extent description

RDONLY 314572800 SPARSE "generated-stream.vmdk"

# The Disk Data Base

#DDB

ddb.adapterType = "lsilogic"

ddb.encoding = "UTF-8"

ddb.geometry.biosCylinders = "19581"

ddb.geometry.biosHeads = "255"

ddb.geometry.biosSectors = "63"

ddb.geometry.cylinders = "19581"

ddb.geometry.heads = "255"

ddb.geometry.sectors = "63"

ddb.longContentID = "005a73f61d025e6f3645d4a826b710ab"

ddb.toolsInstallType = "2"

ddb.toolsVersion = "10287"

ddb.virtualHWVersion = "14"

                                                      

Thanks                                                                                                                                                                                                                                                                                                                                                                                                          

Reply
0 Kudos
continuum
Immortal
Immortal

Please download the attached file

jp-descriptor-1.bin

put it into the same directory and inject it with

dd conv=notrunc,nocreat if=jp-descriptor-1.bin of=generated-stream.vmdk bs=1 seek=512 count=1024

This assumes that your vmdk is named "generated-stream.vmdk"


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos
JPrez
Contributor
Contributor

Looks like the command is failing:

dd: invalid argument 'nocreat' to 'conv'

Command Entered:

dd conv=notrunc,nocreate if=jp-descriptor-1.bin of=disk-0.vmdk bs=1 seek=512 count=1024

Thanks

Reply
0 Kudos
continuum
Immortal
Immortal

skip that parameter then - run

dd  if=jp-descriptor-1.bin of=disk-0.vmdk bs=1 seek=512 count=1024 conv=notrunc


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos
JPrez
Contributor
Contributor

So using that command I get:

1024+0 records in

1024+0 records out

Importing that VMDK and associated OVF is successful..but...it will not boot.  It says "Operating System Not Found"  according to VCenter the disk space used is 8.48KB so the actual virtual disk either didn't import correctly or something else has occurred.

Thanks

Reply
0 Kudos
continuum
Immortal
Immortal

Well - then we probably have to assume that your vmdk is not what it appears to be ?

Have you looked into the content already  - we do not know if the vmdk is  supposed to be bootable ...


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos
JPrez
Contributor
Contributor

First, thanks again for your suggestions and time.

Yes, it definitely appears to be a VMDK and has similar header type information as other working VMDKs.

One question, in the OVF file, is this normal:

  <File ovf:href="disk-0.vmdk" ovf:id="file1" ovf:size="0"/>

I would have thought a specific number related to the size of the VMDK would be present there but that's how it was exported.

Using the ovftool generates this:

Wrong file size specified in OVF descriptor for 'disk-0.vmdk' (specified: 0, actual 193325000

Reply
0 Kudos
Himadri
Contributor
Contributor

Try with try vmkfstools -i

Reply
0 Kudos
continuum
Immortal
Immortal

@ Himadri

Try reading the complete thread next time ....


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos