Clonehd fails with --variant ESX option

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Marzocchi
Posts: 6
Joined: 4. Jan 2011, 00:48
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Suse 10 Enterprise

Clonehd fails with --variant ESX option

Post by Marzocchi »

I've been trying to export a VDI image to VMDK ESX format using clonehd from the 4.1.2 release. Win7SP 2 host OS. I keep getting errors like the following:

Code: Select all

C:\Program Files\Oracle\VirtualBox>VBoxManage clonehd "G:\my.vdi" "E:\my_new.VMDK" --format VMDK --variant ESX
0%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage.exe: error: Failed to clone hard disk. Error message: Could not create the clone medium 'E:\my_new.VMDK' (VERR_INVALID_PARAMETER)
However, if I remove the --format and --variant options the image clone process works. Of course my purpose for the export is to convert to the ESX format VMDK so that I can bring up the Guest on VMware vSphere to test in a production environment. The invalid parameter error suggests that either the --format or --ESX options are not valid when exporting from a VDI but I haven't found any documentation that says the combination is wrong. Perhaps it's a bug? Any help would be appreciated.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Clonehd fails with --variant ESX option

Post by mpack »

ESX implies conversion to a fixed size image, so perhaps it needs to be "--variant Fixed,ESX"?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Clonehd fails with --variant ESX option

Post by Perryg »

Looking at the code the esx is more than likely the problem. It states esx (vmdkESX) as a (stand-alone) variant but trying this fails.
Could you post the remaining two lines, or is this all you get? When I try I get four lines of error messages.
Removing the variant is all it takes for me to clone this so it must be due to the variant and could be a bug introduced with the format change in 4.*

Code: Select all

Progress state: VBOX_E_FILE_ERROR
VBoxManage: error: Failed to clone hard disk
VBoxManage: error: Could not create the clone medium '/drive/tara1/VirtualBox-VMs/Ubuntu-10.04/Ubuntu-10.04-test.vmdk' (VERR_VD_INVALID_TYPE)
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Medium, interface IMedium
VBoxManage: error: Context: "int handleCloneHardDisk(HandlerArg*)" at line 719 of file VBoxManageDisk.cpp
I stopped this but it was working

Code: Select all

debian@debian:~$ VBoxManage clonehd /drive/tara1/VirtualBox-VMs/Ubuntu-10.04/Ubuntu-10.04.vdi /drive/tara1/VirtualBox-VMs/Ubuntu-10.04/Ubuntu-10.04-test --format vmdk
0%...10%...^C
I also tried what mpack suggested and it fails with the same error.
Marzocchi
Posts: 6
Joined: 4. Jan 2011, 00:48
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Suse 10 Enterprise

Re: Clonehd fails with --variant ESX option

Post by Marzocchi »

Thanks for the feedback. The only error I get is the line I posted initially. I also tried starting from a .VMDK image and converting it to an ESX variant (see below) but got the same error as when I try to export from a .VDI image. If I remove the --variant option and just use "--format VMDK" the clone works so that confirms the observation that --variant ESX is the issue and it doesn't have to do with the starting image format.

Code: Select all

C:\Program Files\Oracle\VirtualBox>VBoxManage clonehd "G:\my.vmdk" "E:\my_esx.vmdk" --variant ESX
0%...
Progress state: VBOX_E_FILE_ERROR
VBoxManage.exe: error: Failed to clone hard disk. Error message: Could not create the clone medium 'E:\my_esx.vmdk' (VERR_INVALID_PARAMETER)
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Clonehd fails with --variant ESX option

Post by Perryg »

My VirtualBox is from the future and has some extra debug features but I though t I would ask.

They changed the format of VBox at 4.* and added GUI cloning a release or so back. I bet this is where it broke (although i have never tried it previously either).
I would post a trouble ticket at bugtracker or I will if you don't want to setup a new account. Just let me know.
Sadly this will not help you in the short term.
Marzocchi
Posts: 6
Joined: 4. Jan 2011, 00:48
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Suse 10 Enterprise

Re: Clonehd fails with --variant ESX option

Post by Marzocchi »

Hi Perryg,

If you would post a ticket that would be great. Perhaps you've got some pull being a moderator here at the forum :)
Please also link the ticket here so I can follow it.

Thanks!
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Clonehd fails with --variant ESX option

Post by Perryg »

Bugtracker Ticket 9673
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Clonehd fails with --variant ESX option

Post by mpack »

Um, I tried "--variant Fixed,ESX" and it worked fine.

I guessed that the devs might have wanted the implied conversion from sparse to flat to be explicit, given the yelps of pain that might happen when people see how much disk space is gone!
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Clonehd fails with --variant ESX option

Post by Perryg »

Really. Wonder why it spewed the same error message for me? Linux/Windows maybe?
I just tried again and receive the same error.

Don, what version of VirtualBox are you using ?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Clonehd fails with --variant ESX option

Post by mpack »

I tested it with v4.1.2, i.e. the current release, Windows XP Pro SP2 32bit host. Are you sure you got the same error as the OP? For example, could the error have been lack of disk space for a humungous flat file? (I tested it with a very small DOS6.22 VDI). Did you type the variant field exactly as "--variant Fixed,ESX" (i.e. no spaces in the list!). AFAIK VBoxManage is the same on all platforms, so I don't see how this could be a Windows/Linux thing, unless of course you hit a platform limit, e.g. targeted (say) a FAT32 partition with an image >4GB.

Oh, one more thing: I had a look at the VMDK descriptor afterwards - it had definitely created an ESX disk: createType field="vmfs", first extent type given as VMFS. Extent naming consistent with ESX naming conventions, i.e. extent was called "vmname-flat.vmdk".
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Clonehd fails with --variant ESX option

Post by Perryg »

OK this is weird. I ran this again to see the exact error massage and it is still grinding away.

Code: Select all

VBoxManage clonehd /drive/tara1/VirtualBox-VMs/Ubuntu-10.04/Ubuntu-10.04.vdi /drive/tara1/VirtualBox-VMs/Ubuntu-10.04/Ubuntu-10.04-test.vmdk --format vmdk --variant Fixed,ESX
I would have thought that I must have typed it wrong (lots going on) but I used the up arrow to re-print the command I had previously used. So excluding the third time is the charm theory, now I need to find out why it failed before.
Marzocchi
Posts: 6
Joined: 4. Jan 2011, 00:48
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Suse 10 Enterprise

Re: Clonehd fails with --variant ESX option

Post by Marzocchi »

Update on my tests. I was able to convert an existing VMDK file to ESX format with:

Code: Select all

C:\Program Files\Oracle\VirtualBox>VBoxManage clonehd F:\my.VMDK F:\my_ESXi.VMDK --variant Fixed,ESX

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone hard disk created in format 'VMDK'. UUID: d9c56dba-9b56-4cf8-9cba-3613dcfa8863
The clone took about 3 ours (200GB disk). It appears that the syntax for the --variant option was the key as mpack noted, without the "Fixed" statement I get the error. I have not yet tested cloning a VDI to VMDK ESX variant but it looks like that worked for Perryg. Next I'll test the image on VMware.
Post Reply