Monday, September 16, 2013

Renaming .vmdk file using the virtual disk using the ESX/ESXi host console interface

  1. Navigate to the virtual machine's directory using a command similar to:
    cd "/vmfs/volumes/Datastore Name/Directory Name/"
  2. Obtain a listing of the files within a directory using the command:
    ls -l
    For example:
    total 320
    -rw------- 1 root root        8684 Aug 30 10:53 examplevm.nvram
    -rw------- 1 root root 21474836480 Aug 30 10:26 examplevm-flat.vmdk
    -rw------- 1 root root         482 Aug 30 11:26 examplevm.vmdk
    -rw------- 1 root root           0 Aug 30 10:33 examplevm.vmsd
    -rwxr-xr-x 1 root root        2724 Aug 30 12:20 examplevm.vmx
    -rw------- 1 root root         264 Aug 30 12:20 examplevm.vmxf
    -rw-r--r-- 1 root root       39168 Aug 30 10:53 vmware.log
  3. Rename a virtual disk using a command similar to:
    vmkfstools -E OldName.vmdk NewName.vmdk
    For example:
    vmkfstools -E examplevm.vmdk examplevm-renamed.vmdk
    Note: Specify the descriptor file; the associated extent file is renamed in the process.
  4. Validate the files were renamed by listing the files within the directory using the command:
    ls -l
    For example:
    total 320
    -rw------- 1 root root        8684 Aug 30 10:53 examplevm.nvram
    -rw------- 1 root root 21474836480 Aug 30 10:26 examplevm-renamed-flat.vmdk
    -rw------- 1 root root         482 Aug 30 11:26 examplevm-renamed.vmdk
    -rw------- 1 root root           0 Aug 30 10:33 examplevm.vmsd
    -rwxr-xr-x 1 root root        2724 Aug 30 12:20 examplevm.vmx
    -rw------- 1 root root         264 Aug 30 12:20 examplevm.vmxf
    -rw-r--r-- 1 root root       39168 Aug 30 10:53 vmware.log

No comments: