VMware Cloud Community
jtcdesigns
Contributor
Contributor

ESX 3.0.3 vmkfstools not working

Hi all, just joined this site looking for some help.. I started here when we had ESX 3.0 and now up to 3.0.3 looking to go to 3.5 soon when we get our new servers. My current issue is im trying to clone a template. As I have always done on the windows PC I open Putty username/password su - and im in root.... then I go with vmkfstools -i dirtotemplate/ /newdir but I get a Bash: vmkfstools: command not found so I searched for vmkfstools and found an executable vmkfstools file in /usr/sbin though now I did a search and cant find it. I believe someone said when you login as su - it moves it to another directory.. not sure... The point of the clone is so it will rename to what I want.. though could I just copy the directory to where I want it to be then in Winscp rename the files to what I want then add to inventory... start it.. and change computer name? This worked fine when I started here but I am wondering if the 3.0.3 upgrade messed something up. It worked from atleast 3.0 to 3.0.2

0 Kudos
9 Replies
jtcdesigns
Contributor
Contributor

ok update.. I dont think its vmkfstools its the options im putting in.. I wasn't putting everything in right.. but I do still need some help with it.. I have a pdf that I followed along with before on this..

Command-Line Operation

• Use Putty, login as ‘vmadmin’, su -

  1. vmkfstools –i

/vmfs/volumes/vmfs01/disk.vmdk –d 2gbsparse

/vmfs/volumes/vmfs01/win.2000.adv.sp4.vmdk

• Template is now read-only

I somehow got it to work before but am lost now.... im basically trying to clone this template I have which is a win 2003 sr2 system to another directory.. then rename it to mail and then add a second drive thats about 50GB... any help much appreciated. Its not often that I do this

0 Kudos
SuryaVMware
Expert
Expert

it should be in /usr/sbin ? what did you use to search?

did you try /usr/sbin/vmkfstool -i <templatedir/templatefile> <newdir/newfile> ?

Let me know if you need any further help.

<Edit>

I thought you are deploying a VM from template, If so you wouldn't need the 2gbsparse. However, if i am worng and you need the 2gbsparce format disk the commanline is below.

try vmkfstools -d 2gbsparse -i /vmfs/volumes/vmfs01/disk.vmdk<Source> /vmfs/volumes/vmfs01/win.2000.adv.sp4.vmdk<Destination>

-Surya

0 Kudos
jtcdesigns
Contributor
Contributor

thanks I feel like a complete idiot... shortly after I posted a reply I figured it out... all I have to do is

vmkfstool -i <templatedir/templatefile> <newdir/newfile>

that will copy over the file I need

then I go to the VI client and make a new virtual machine using that disk... follow instructions... done. I cant feel too dumb I guess its been a year since I have done this. My memory seems to be escaping me!

0 Kudos
jtcdesigns
Contributor
Contributor

well I thought things were ok... now I get this error.... Register VM The specified key, name, or identifier already exists. This shows up when I try to add new machine. I renamed the mail server that I used to use.. and rebooted so now there is no mail in the domain which it is now called mail-old. The new one is mail and I get that error... oddly I can add this machine to our second ESX machine but not the first one. makes no sense to me

0 Kudos
SuryaVMware
Expert
Expert

Open the .vmx file and change the displayname in it and the ntry to register it with vmware-cmd -s register </path/to/vmx/file>

That should take care of it. Remember the displayname should be unique.

-Surya

jtcdesigns
Contributor
Contributor

where am I changing the display name exactly? and by open you mean run the system? and what exactly is the vmware-cmd thing? I'm pretty new on this stuff.. I rarely need to adjust anything other than use esx ranger now and then

0 Kudos
SuryaVMware
Expert
Expert

Alrigh, You need to login to the ESX server using ssh and go to the directory where the .vmx file for the newly created VM is.

then use the vim/vi (unix command) to edit the.vmx file. Once you open the file look for the entry "Display Name" and change the value,which is a text string, to a unique name that is already not in use across your VI3 Datacenter.

Save the file and register the vm with vmware-cmd -s register </path/to/the/vmx/file>

Let me know ifyou need more help.

-Surya

jtcdesigns
Contributor
Contributor

I guess through common sense I just typed exactly what you had and here are my errors....

# vmware-cmd -s register /vmfs/volumes/san-esx02-live/mail/mail.vmx

VMControl error -999: Unknown error

# vmware-cmd -s register /vmfs/volumes/san-esx01-live/mail/mail.vmx

VMControl error -999: Unknown error

FYI: I have this copied in 2 locations esx02 will let me add to inventory and run it but esx01 wont.. and conveniently the original mail VM is on esx01. But I have this of course on another drive location so there is no conflicts. Now I did your command to both and those were the error. Also I cant remove mail-old from inventory. Which may be an issue in it of itself. If needed I can just run the thing on esx02 but prefer 01 for load balancing purposes.

0 Kudos
jtcdesigns
Contributor
Contributor

gotcha.. luckily I know some linux nerds in a chat room I go to for some of the newb questions but no one knows vmware. I changed it to mail1 and saved then registered and still got the same error message coming up

0 Kudos