VMware Cloud Community
goppi
Enthusiast
Enthusiast
Jump to solution

vmkfstool.pl

I'm trying to run vmkfstools.pl on ESXi without success as ssh is a not supported option.

However this always fails with a "Unable to clone virtual disk : A general system error occurred: Internal error".

Doing the same with unsupported ssh works as expected.

The command in question "vmkfstools.pl -server 192.168.1.1 -i /vmfs/volumes/Store/TEST/TEST.vmdk /vmfs/volumes/Store/TEST/new.vmfs -d thin"

Any ideas what's the problem?

Thanks a lot.

0 Kudos
1 Solution

Accepted Solutions
lamw
Community Manager
Community Manager
Jump to solution

It sounds like you're using the RCLI, RCLI on VIMA or RCLI vApp since your vmfkstools ends with .pl:

There are some bugs with vmkfstools.pl and you need to specify all required parameters such as the adapter type and there is an issue when converting to thick format, thin should work as expected but the syntax above is incorrect, it should be:

vmkfstoos.pl --server A.B.C.D --username USER -i SRC_VMDK -a ADAPTER_TYPE -d FORMAT DST_VMDK

(e.g.)
vmkfstools.pl --server 192.168.1.1 --username root -i /vmfs/volumes/Store/TEST/TEST.vmdk -a lsilogic -d thin /vmfs/volumes/Store/TEST/NEW.vmdk

Note you should be passing in the .vmdk discriptor file and not the *-flat.vmdk or any other files when using vmkfstools. Depending on your destionation disk you'll want to either use buslogic or lsilogic depending on your requirements, you can always just run vmkfstools --help for more options

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

View solution in original post

0 Kudos
7 Replies
depping
Leadership
Leadership
Jump to solution

Did you try using the RCLI or VIMA to do this?

Duncan

VMware Communities User Moderator

-


Blogging:

Twitter:

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
goppi
Enthusiast
Enthusiast
Jump to solution

I tried with RCLI

0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

It sounds like you're using the RCLI, RCLI on VIMA or RCLI vApp since your vmfkstools ends with .pl:

There are some bugs with vmkfstools.pl and you need to specify all required parameters such as the adapter type and there is an issue when converting to thick format, thin should work as expected but the syntax above is incorrect, it should be:

vmkfstoos.pl --server A.B.C.D --username USER -i SRC_VMDK -a ADAPTER_TYPE -d FORMAT DST_VMDK

(e.g.)
vmkfstools.pl --server 192.168.1.1 --username root -i /vmfs/volumes/Store/TEST/TEST.vmdk -a lsilogic -d thin /vmfs/volumes/Store/TEST/NEW.vmdk

Note you should be passing in the .vmdk discriptor file and not the *-flat.vmdk or any other files when using vmkfstools. Depending on your destionation disk you'll want to either use buslogic or lsilogic depending on your requirements, you can always just run vmkfstools --help for more options

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

0 Kudos
goppi
Enthusiast
Enthusiast
Jump to solution

Thanks for the hint.

Specifying the adpater type did the trick.

I assumed that this one could be omitted similar to vmkfstools via ssh.

0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

By default if you don't specify the disk format and adapter type it should use the source VMDK but there is a bug in the code that requires you to specify -a param and there are some oddities as I've said before if you're wanting to enforce thick format. Glad it worked out

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

0 Kudos
BryanStansel
Contributor
Contributor
Jump to solution

I am having a very similar issue using the VI Remote CLI tools from multiple machines, and operating systems , e.g. Windows and the Linux RCLI Appliance when accessing a VMware ESX Server 3i, 3.5.0, 123629 and Virtual Center 2.50. infrastructure.

The output from Windows:

C:\Program Files\VMware\VMware VI Remote CLI\bin>vmkfstools.pl --config .\config.cfg --vihost edclvmhp051.xxxxxxxxx.com --clonevirtualdisk /vmfs/volumes/4a09d9ba-c1022122-d9ce-001f295d144c/VPCB990003/VPCB990003.vmx /vmfs/volumes/4a09d9ba-c1022122-d9ce-001f295d144c/VPCB990003/VPCB990003_t.vmx --diskformat thin --adapterType lsilogic

Can't call method "type" on an undefined value at C:/Program Files/VMware/VMware

VI Remote CLI/Perl/lib/VMware/VICommon.pm line 1026.

End Disconnect

I would like to be able to leverage the CLI toolset and am not able to do so currently..

Please advise.

0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

You're passing in the wrong parameters when trying to clone a VM Disk, you need to specify the full path to your descriptor file (e.g. my_vm.vmdk)

Should be something like:

C:\Program Files\VMware\VMware VI Remote CLI\bin>vmkfstools.pl --config .\config.cfg --vihost edclvmhp051.xxxxxxxx.com --clonevirtualdisk /vmfs/volumes/4a09d9ba-c1022122-d9ce-001f295d144c/VPCB990003/VPCB990003.vmdk /vmfs/volumes/4a09d9ba-c1022122-d9ce-001f295d144c/VPCB990003/VPCB990003_t.vmdk --diskformat thin --adapterType lsilogic 

In the future please create a new thread with your question and try not to double post, you'll have plenty of individuals on the VMTN community that can assist

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

VMware Code Central - Scripts/Sample code for Developers and Administrators

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos