VMware Cloud Community
gscott0032
Contributor
Contributor
Jump to solution

VSphere CLI - Unable to clone virtual disk : A specified parameter was not correct: dc

Hello all. I am having issue being able to clone an uploaded VMDK. I have the VCLI downloaded on a Windows laptop and am running the commands through Strawberry PERL. My command looks like the following: 

vmkfstools.pl --server xx.xxx.xx.x --vihost xxxxxxx.xx.xxx --username xxxxxxx --password xxxxxxxxxxxx -i /vmfs/volumes/Datastore Name/NutanixDisks/PVM0325.vmdk /vmfs/volumes/Datastore Name/NutanixDisks/PVM0325Clone.vmdk

I get the following error message: 

Unable to clone virtual disk : A specified parameter was not correct: dc

I cannot determine what the cause of the error is, and what DC means in this scenario. I cannot find any documentation on this error message. Any help would be greatly appreciated. Thanks!

 

Reply
0 Kudos
1 Solution

Accepted Solutions
a_p_
Leadership
Leadership
Jump to solution

As expected, that's a VMware Workstation file format, which does not work on an ESXi host.

What you may do is to install VMware Workstation, and use the vmware-vdiskmanager command line utility to convert the virtual disk into an ESXi supported format.

Alternatively, you may create a dummy VM in VMware Workstation with the .vmdk attached as its virtual disk, then connect to the ESXi host from within VMware Workstation, and use to upload option to migrate the VM to ESXi.

André

View solution in original post

20 Replies
continuum
Immortal
Immortal
Jump to solution

Suggestion:
figure out if the command itself works - then something is wrong with perl or vspherecli.
So does
cd /vmfs/volumes/Datastore Name/NutanixDisks/
vmkfstools -i PVM0325.vmdk PVM0325Clone.vmdk
work ?

 


________________________________________________
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
a_p_
Leadership
Leadership
Jump to solution

>>> ... clone an uploaded VMDK ...

Where does this vmdk come from? Can you confirm that it has an ESXi supported format, i.e. not e.g. a VMware Workstation format?

André

Reply
0 Kudos
gscott0032
Contributor
Contributor
Jump to solution

I unfortunately don't have the access to PUTTY in because of company restrictions, which is why I'm having to go through the CLI route. Therefore, I won't be able to test vmkfstools unless there is another way that I'm not aware of. 

Tags (1)
Reply
0 Kudos
gscott0032
Contributor
Contributor
Jump to solution

The VMDK was downloaded via WINSCP through Nutanix. We are working on converting Nutanix --> ESXI. I have the file VDisk downloaded from Nutanix, and converted it to a .VMDK using QEMU. I have tried uploading the file to a datastore in VSphere for attachment. After trying to attach to a fresh VM, the following error message occurred because of incompatability with ESXI. 

Unsupported or invalid disk type 2 for 'scsi0:1'. Ensure that the disk has been imported.

I saw this video : https://www.youtube.com/watch?v=UaVixedAVdQ

Which shows that you need to convert the VMDK before using using "vmkfstools -i /vmfs/volumes/datastore/test/test.vmdk /vmfs/volumes/datastore/test/testCLONE.vmdk"

 

Reply
0 Kudos
continuum
Immortal
Immortal
Jump to solution

QEMU ? - does that have an option to convert to raw disk images similar to dd ?
Very likely the conversion is the cause of the problem - by the way - what made you think that QEMU is an appropriate tool for this job ?

Can you somewhere use
hexdump -C name.vmdk | less
and show us just the first few lines of the output ? maybe on the host where you used QEMU ?

 


________________________________________________
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
a_p_
Leadership
Leadership
Jump to solution

Which .vmdk files were created with the QEMU conversion (file names, and sizes)?

Please run the following Powershell command

$vmdkfiles=Get-Item *.vmdk ; foreach ($vmdkfile in $vmdkfiles) {write-host "`n$vmdkfile"; Get-Content $vmdkfile.name -Encoding Byte -TotalCount 80 | Format-Hex }

and post the result.

André

Reply
0 Kudos
gscott0032
Contributor
Contributor
Jump to solution

I was following along with https://masteringnutanix.com/2020/09/02/ahv-to-hyper-v-vmware-kvm/

Is there a better approach?

Reply
0 Kudos
gscott0032
Contributor
Contributor
Jump to solution

Used WINSCP to download the file locally which was 120 gigs. 

Filename for that was the UUID of the Virtual machine. 

Converted to PVM0325.VMDK using QEMU which reduced the size to 69.8 gigs which was the amount used in Nutanix. 

Here is the output : 

Path:

00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

00000000 4B 44 4D 56 01 00 00 00 03 00 00 00 00 00 00 0F KDMV............
00000010 00 00 00 00 80 00 00 00 00 00 00 00 01 00 00 00 ...............
00000020 00 00 00 00 14 00 00 00 00 00 00 00 00 02 00 00 ................
00000030 15 00 00 00 00 00 00 00 33 3C 00 00 00 00 00 00 ........3<......
00000040 80 78 00 00 00 00 00 00 00 0A 20 0D 0A 00 00 00 x........ .....

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

As expected, that's a VMware Workstation file format, which does not work on an ESXi host.

What you may do is to install VMware Workstation, and use the vmware-vdiskmanager command line utility to convert the virtual disk into an ESXi supported format.

Alternatively, you may create a dummy VM in VMware Workstation with the .vmdk attached as its virtual disk, then connect to the ESXi host from within VMware Workstation, and use to upload option to migrate the VM to ESXi.

André

continuum
Immortal
Immortal
Jump to solution

I just copied a WS 16 KDMV-vmdk to ESXi 7.0.3 and could import it with
vmkfstools -i kdmv.vmdk esxi-thin.vmdk -d thin

 


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

gscott0032
Contributor
Contributor
Jump to solution

I tried downloading VMWorkstation and running the following command which I found on a forum. The hex looked the exact same and failed with the same error. 

vmware-vdiskmanager.exe -r C:\windows\config\logs\pvm0325\pvm0325.vmdk -t 0 \\corp.fin\users\XXXXX\6\XXXXX\XXXXX\PVM0325.vmdk

 

I did create a dummy VM in workstation with the attached disk and it spun up fine and I was able to upload it to ESXI. However, we are trying to convert 1,500 machines so we are trying to automate this process which is why I was looking for a command line argument to achieve this. 

Reply
0 Kudos
gscott0032
Contributor
Contributor
Jump to solution

I did find another software  StarWind V2V that I heard was a possible solution. Whenever I ran that against the VMDK, it gave me two different files back. A -flat file and a regular file. Would I just need to upload these two files to the datastore and attach? Would this work? 

Reply
0 Kudos
continuum
Immortal
Immortal
Jump to solution

> A -flat file and a regular file. 
That could be VMFS - createType or monolithicFlat - createType.
The flat file is the same for both formats but the descriptor vmdk differs- VMFS is ESXi-compatible while monolithicFlat is not.
But converting both formats is trivial and done in a second.
Wonder why you ask such vague questions - if you show the descriptorfiles we can tell you what to do exactly.

Ulli


________________________________________________
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
gscott0032
Contributor
Contributor
Jump to solution

Let me run through everything again. 

I am in charge of converting 1,500 virtual machines from Nutanix AHV to VMWare ESXI. I downloaded the Virtual Disks from Nutanix AHV using WinSCP. I converted these virtual disks to VMWare-Workstation compatible VMDKs using QEMU. This is the point where I'm currently at. I have a VMWare-Workstation compatible VMDK, but I'm trying to figure out different ways to convert this to an ESXI-compatible disk to upload to ESXI. Attaching the disk to a VMWare-Workstation Virtual Machine and then uploading that to ESXI works great, but we are trying to automate this process since we have 1500 machines left to convert. I have attempted to use VMWare-VDiskManager.exe to convert this to a compatible ESXI VMDK, but the command that I used didn't convert it to the correct format as mentioned above (I have the full command I used). Since that didn't work, I tried using a third party software called StarWind V2V which supposedly gets it to the correct format for uploading. Whenever I selected the VMWare-Workstation VMDK in StarWind and converted it, it gave me two different files back. One of those being a PVM0325222.VMDK file and the other being a PVM0325222-flat.VMDK file. The .VMDK file it gave was 1KB in size and the content was the following:

# Disk DescriptorFile
version=1
encoding="windows-1252"
CID=fe321470
parentCID=ffffffff
isNativeSnapshot="no"
createType="vmfs"

# Extent description
RW 251658240 VMFS "PVM03252222-flat.vmdk" 0

# The Disk Data Base
#DDB

ddb.adapterType = "ide"
ddb.geometry.cylinders = "16383"
ddb.geometry.heads = "16"
ddb.geometry.sectors = "63"
ddb.longContentID = "debd125381058faca35bb8b2fe321470"
ddb.thinProvisioned = "1"
ddb.uuid = "60 00 C2 9a 57 be 7b 29-af 46 13 32 1c 94 0d 30"
ddb.virtualHWVersion = "4"

 

The PVM03252222-flat.VMDK was 125GB. I uploaded both of these to a datastore hosted on ESXI and neither register as Virtual Disks (attached), they both just register as files. 

gscott0032_0-1652449554246.png

 

Reply
0 Kudos
continuum
Immortal
Immortal
Jump to solution

> RW 251658240 VMFS "PVM03252222-flat.vmdk" 0

Remove the zero at the end of the line.
Then reload datastorebrowser - now both files should display as one.
Thanks to the unlimited wisdom of the engineers datastorebrowser skips the flat-file and falsely displays the size of the descriptor.vmdk

But the result is supposed to be most user friendly 😉
By the way - show me a Nutanix vmdk and I may have a nicer workaround - never seen a Nutanix vmdk

Ulli


________________________________________________
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
gscott0032
Contributor
Contributor
Jump to solution

Deleted the 0 and reloaded the datastore browser. Still showing as two different files. 

gscott0032_0-1652452108714.png

Would it help to see the hex of the flat.vmdk? 

Reply
0 Kudos
continuum
Immortal
Immortal
Jump to solution

Oops - you may also need to change
encoding="windows-1252"
to
encoding="UTF-8"

Does the size match ?
The value following RW should equal the size in sectors of the flat file.

 


________________________________________________
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
gscott0032
Contributor
Contributor
Jump to solution

I actually see an error I made earlier with the VMWare-VDiskManager.exe. I used a -t 0 switch instead of a -t 4 which is what makes it ESXI compatible. Going to try converting using this utility and uploading to the datastore. I trust a VMWare product more than a third party software. 

Reply
0 Kudos
continuum
Immortal
Immortal
Jump to solution

> Would it help to see the hex of the flat.vmdk? 

You should see aa 55 at offset 0001f0.

Ulli


________________________________________________
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