Solved

Rename VM folder and files on datastore

Posted on 2010-09-22
5
3,066 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

VM backup deduplication is a method of reducing the amount of storage space needed to save VM backups. In most organizations, VMs contain many duplicate copies of data, such as VMs deployed from the same template, VMs with the same OS, or VMs that h…
This is an issue that we can get adding / removing permissions in the vCSA 6.0. We can also have issues searching for users / groups in the AD (using your identify sources). This is how one of the ways to handle this issues and fix it.
Teach the user how to use create log bundles for vCenter Server or ESXi hosts Open vSphere Web Client: Generate vCenter Server and ESXi host log bundle:  Open vCenter Server Appliance Web Management interface and generate log bundle: Open vCenter Se…
Teach the user how to join ESXi hosts to Active Directory domains Open vSphere Client: Join ESXi host to AD domain: Verify ESXi computer account in AD: Configure permissions for domain user in ESXi: Test domain user login to ESXi host:

706 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

18 Experts available now in Live!

Get 1:1 Help Now