I am trying to rename Virtual Center server which is VM
1. vmware-cmd -s unregister /vmfs/volumes/datastore/vm/vmold.vmx
2. mv /vmfs/volumes/datastore/vm-old /vmfs/volumes/datastore/vm-new
3. cd /vmfs/volumes/datastore/vm-new
4. vmkfstools -E vm-old.vmdk vm-new.vmdk
5. find . -name ‘.vmx' -print -exec sed -e 's/vm-old/vm-new/g' {} \;
Number 5 is where I get error message missing an argument '-exec" ?????
What am I missing?
A easy way to do this is would be to right click the guest and rename it.
The vmotion the server to a new host and the files will all get renamed
as well
Vmotion? or do you mean cold migrate ( or storage vmotion )? a standard vmotion does nothing with the files. It simply moves the running of the VM from one host to another.
correct, vmotion will not do renaming. so since this VM is VC i cannotdo cold migrate
for other servers no problem
One thing you could do is just create a new VM with the correct name and attach your existing, correctly-named VMDK to this VM. You've unregistered the VM already, so I don't think you'd be losing much by creating a new VM. The only problem is that, since your /vmfs/volumes/datastore/vm-new already exists with the VMDK files, creating a new VM called vm-new will cause the new VMX file to go to /vmfs/volumes/datastore/vm-new_1. What you could do is the following to get around this:
1. Create /vmfs/volumes/datastore/vm-new_1 (or anything else, this is just a temporary location)
2. Move all of the VM files to the directory you created in #1 and, after verifying that it is empty, delete the /vmfs/volumes/datastore/vm-new directory.
3. Create a new VM called vm-new, have stored in datastore, and don't give it any virtual hard disks during the creation.
4. Move the VMDKs back to /vmfs/volumes/datastore/vm-new
5. Edit the VM configuration and add the existing virtual disk that is in /vmfs/volumes/datastore/vm-new.
Hope that helps! Please help me out by marking my response as "helpful" or "correct" if you feel that it was useful!
-Amit
I'm not sure what you are trying to do, but what I do know is your find statement is missing an slash
Yours:
find . -name '*.vmx*' -print -exec sed -e 's/vm-old/vm-new/g' {} \;
Should have:
find . -name '*.vmx*' -print -exec sed -e 's/vm-old/vm-new/g' \{} \;
The first curlybrace and the semicolon needs to be escaped with an backslash
(Donno if the line above is displaying correctly, sometimes the forum chucks some chars ... ah I needed
to slap some markup language arround the 'code')
Regards
Rabie
Thank you All. got my answer