Solved

Rename VM folder and files on datastore

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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows 2012 R2 Unable to Expand C:\ Drive 9 94
Install esxi 6 14 46
Vcenter 8 47
Exchange Server DAG mailbox server VMware network configuration 7 31
This article will show you how to create an ISO CD-ROM/DVD-ROM image (*.iso), and MD5 checksum signature, for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5). It's a good idea to compare checksums, because many installations fail because of a corr…
HOW TO: Upload an ISO image to a VMware datastore for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere Host Client, and checking its MD5 checksum signature is correct.  It's a good idea to compare checksums, because many installat…
This Micro Tutorial walks you through using a remote console to access a server and install ESXi 5.1. This example is showing remote access and installation using a Dell server. The hypervisor is the very first component of your virtual infrastructu…
This video shows you how easy it is to boot from ISO images for virtual machines with the ISO images stored on a local datastore on the ESXi host.

789 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