Solved

Rename VM folder and files on datastore

Posted on 2010-09-22
5
3,110 Views
Last Modified: 2012-06-27
We've converted a VM 2008 box into a template.  The server was called NYSERV001 and we now want to call it 2008_Template.  I've renamed the VM template in vSPhere Client and is fine, but when i browse the datastore it still shows as folder NYSERV001 and the files within all include the name NYSERV001.  How do i change the name of the folder and files on the datastores to reflect the name change in the vSPhere Client to 2008_Template.

Cheers
0
Comment
Question by:kswan_expert
5 Comments
 
LVL 22

Expert Comment

by:65td
ID: 33740781
May have to convert back to a VM and then use the procedure from communites:
http://communities.vmware.com/thread/150288 
0
 
LVL 42

Expert Comment

by:paulsolov
ID: 33740783
You can do this a few ways.  

1. Clone and give it the destination name.  This will create a new folder and vmx and vmdk files

or

rename virtual machine

Here are the steps I take to rename a VM (It would be fairly easy to script, but its low on my list of things that need to be done)

Shut down the VM

Putty into the VMware server that the VM resides on

unregister the VM

vmware-cmd -s unregister <path to config file> (should be /home/vmware/OldServerName/OldServerName.vmx

Remove it from Virtual Center (Have to remove twice)

Rename the folder,vmx file, and vmdk file to match the new name
mv /home/vmware/OldServerName /home/vmware/NewServerName
mv /home/vmware/NewServerName/OldServerName.vmx /home/vmware/NewServerName/NewServerName.vmx
mv /vmfs/SANDiskName/OldServerName.vmdk /vmfs/SANDiskName/NewServerName.vmdk

Edit .vmx file
vi /home/vmware/NewServerName/NewServerName.vmx

(If you've never used vi before try nano... a little easier to use)

Replace OldServerName with NewServerName in .vmx file
This should hit
scsi0:0.name = "SANDiskName:OldServerName.vmdk
DisplayName = "OldServerName"
checkpoint.cptConfigName = "OldServerName"

register the VM

vmware-cmd -s register <path to new config file> (should be /home/vmware/NewServerName/NewServerName.vmx)

It will show up under Discovered VMs in Virtual Center. Drag and drop to whereever you want it.
0
 
LVL 10

Expert Comment

by:BloodRed
ID: 33744353
By far, the easiest way to do this is to either use Converter or just clone the VM using vCenter.  Manually moving files and modifying the .vmx file is prone to error and not recommended.
0
 
LVL 3

Accepted Solution

by:
michelkeus earned 500 total points
ID: 33745292
Actually the easiest way is to "Storage" vMotion them. I've put Storage between quotes as it is not really an Storage vMotion.

If you convert the template back to a VM and vMotion it. The vMotion wizard will ask you if you want to keep the files in the same Datastore. If you chose to migrate to other storage it will sync up the names on the Datastore with the name in the vCenter interface.

You can always move the template back the same way if you need the storage on the Datastore.
0
 

Author Closing Comment

by:kswan_expert
ID: 33835877
Nice.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When converting a physical machine to a virtual machine using VMware vCenter Converter Standalone or vCenter Converter Enterprise, if an adapter type is not selected during the initial customization the resulting virtual machine may contain an IDE d…
When we have a dead host and we lose all connections to the ESXi, and we need to find a way to move all VMs from that dead ESXi host.
Teach the user how to configure vSphere Replication and how to protect and recover VMs Open vSphere Web Client: Verify vsphere Replication is enabled: Enable vSphere Replication for a virtual machine: Verify replicated VM is created: Recover replica…
Teach the user how to install and configure the vCenter Orchestrator virtual appliance Open vSphere Web Client: Deploy vCenter Orchestrator virtual appliance OVA file: Verify vCenter Orchestrator virtual appliance boots successfully: Connect to the …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now