Tag Archives: ESXi

Renaming a virtual machine and its files

When I was renaming some virtual machines in my test lab, I discovered that the file names are not renamed with the virtual machine. In the future this may be causing some problems so I was looking for a method to rename the files also. On the VMware site I’ve found a knowledgebase article about it. It describes the correct way to rename also the files. See KB Article: 1029513. Original link: http://kb.vmware.com/selfservice/search.do?cmd=displayKC&docType=kc&externalId=1029513

Purpose

This article provides steps to rename a virtual machine and its files.
These steps may be useful if you rename a virtual machine, but its files retain the original file names. You may want to rename the virtual machine disk files to prevent possible confusion.

Resolution

The content of the displayName configuration option is updated when you rename a virtual machine. However, the underlying files are not renamed.

Renaming the files

To rename the files:
  1. Log into the VMware vSphere Client.
  2. Locate the virtual machine in your host inventory.
  3. Begin a Storage vMotion or an offline Storage Migration of the virtual machine.For more information, see :
  4. The destination copy’s file names are be updated to your desired values.

If this is not an option, you may also rename the files by hand after the virtual machine has been powered down.

Manually renaming virtual machine files

Warning: Before proceeding, ensure that:

  • The virtual machine has a current backup and that it has been powered down.
  • The virtual machine does not have snapshots or virtual disks shared with other virtual machines.

To manually rename the virtual machine’s files:

  1. Log into the VMware vSphere Client.
  2. Locate the virtual machine in your host inventory.
  3. Power down the virtual machine.
  4. Right-click on the virtual machine and choose Remove from inventory.
  5. Connect to the terminal of the ESX server via SSH, System Management Interface, or directly at its console, and log in.Note: For additional instructions for ESXi, see Tech Support Mode for Emergency Support (1003677).
  6. Navigate to the directory containing the virtual machine. For example, cd /vmfs/volumes/<datastore>/<virtual machine>/.
  7. Run this command to rename the virtual disk files:vmkfstools -E “originalname.vmdk” “newname.vmdk”Note: Is it unnecessary to once again rename the originalname-flat.vmdk file after running the vmkfstools command.
  8. Copy the virtual machine configuration file (.vmx) using the command:cp “originalname.vmx” “newname.vmx”
  9. Edit the copied configuration file, such as (newname.vmx), using the vi editor:vi “newname.vmx”Note: For VMware ESX hosts, the nano editor is also available. If you are uncomfortable using the vi editor, seek assistance from a Linux/Unix administrator or file a Support Request and contact VMware Technical Support.
  10. Within the configuration file, modify all old instances of the virtual machine’s file names to the new file names. There should be at least the following to adjust:nvram = “originalname.nvram”
    displayName = “originalname”
    extendedConfigFile = “originalname.vmxf”
    scsi0:0.fileName = “originalname.vmdk”
    […]
    migrate.hostlog = “./originalname-UUID.hlog”

    Repeat this process for each virtual machine disk. Such as:

    scsi0:1.fileName = “originalname_1.vmdk”
    scsi0:2.fileName = “originalname_2.vmdk”

    Correct the VMkernel swap file reference:

    sched.swap.derivedName = “/vmfs/volumes/DatastoreUUID/originalname/originalname-UUID.vswp

    To

    sched.swap.derivedName = “/vmfs/volumes/DatastoreUUID/newname/newname-UUID.vswp

    Note: Be sure to rename both the .vswp file and the directory name for the swap file, bolded above.

  11. Correct any other remaining lines referencing the original path or file names.
  12. Save the file and exit the editor.
  13. Rename all the remaining files, except for the .vmx configuration file, to the new names desired. For example:mv “originalname.nvram” “newname.nvram”
  14. Change directory to the parent directory using cd .. and rename the directory for the virtual machine:mv “originalname” “newname”
  15. Using the VMware vSphere Client, browse the datastore and navigate to the renamed virtual machine directory.
  16. Right-click on the virtual machine’s configuration file (.vmx) and choose Add to inventory.Alternatively, you can use this command to inventory the virtual machine:vmware-cmd -s register “/vmfs/volues/DatastoreName/newname/newname.vmx”
  17. Power on the virtual machine.
  18. A question for the virtual machine displays in the Summary tab during power-on. Review the question by:
    • Clicking the Summary tab
    • Right-clicking the virtual machine in your inventory and selecting Answer question.When prompted, select I moved it, then click OK.Warning: Selecting I Copied It results in a change of the virtual machine’s UUID and MAC address, which may have detrimental effects on guest applications that are sensitive towards MAC address changes, and virtual machine backups that rely on UUIDs.

Additional Information

The command-line interpreter on ESX is case-sensitive and requires escaping of special characters used in some virtual machine file names. The above examples encourage the use of quotation marks around command arguments to ensure spaces and special characters are interpreted literally and do not require escape sequences.

For example, a virtual machine named “Original VM” is referenced either as:
“Original VM” with quotation marks, or Original\ VM.

Special characters such as opening and closing parentheses also require character escaping. For a virtual machine named “Original VM (1)”:
“Original VM (1)” with quotation marks, or Original\ VM\ \(1\).

The former quotation method simplifies the process considerably and improves readability.

Additional information on escape characters can be found in the Bash Reference Manual.

Upgrade paths for ESX/ESXi hosts

Purpose

There are several methods to upgrade ESX/ESXi. This article outlines the available upgrade paths.   Note: This is not a comprehensive guide on how to upgrade ESX/ESXi. For more information on performing an upgrade, see the links in this article.

Resolution

This table lists the methods available to upgrade your ESX/ESXi host, and identifies the version to which you can upgrade:

ESX/ESXi version that is currently installed Version that it can be upgraded to CD-ROM Installation Wizard *1 Using esxupdate from the Service Console *2 vSphere Remote CLI *3 Host Update Utility or Infrastructure Update *4 Update Manager *5 Offline Upgrade from Service Console *6
ESX 2.x ESX 3.0.x x x
ESX 3.0.x ESX 3.0.3, 3.0.3 U1, 3.5, 3.5 U1 – U5 x x
ESX 3.0.2 ESX 4.0 x x
ESX 3.0.3 ESX 3.5, 3.5 U1 – U5 x x x
ESX 3.0.3 ESX 4.0 x x x
ESX 3.5 ESX 3.5 U1 – U5 x x x x
ESX 3.5 ESX 4.1 x x
ESXi 3.5 ESXi 3.5 U1 – U5 x x x
ESX 3.5 ESX 4.0 x x x
ESXi 3.5 ESXi 4.0 x x
ESXi 3.5 ESXi 4.1 x
ESX 4.0 ESX 4.0 U1 – U2 x x x
ESX 4.0 ESX 4.1 x x x x
ESXi 4.0 ESXi 4.0 U1 – U2 x x x
ESXi 4.0 ESXi 4.1 x x

For more information about upgrading using:

Note: The Host Update Utility replaced Infrastructure Update and is available when you install the vSphere Client. It is a tool for upgrading ESX/ESXi hosts from 3.x to 4.0.x and for patching ESXi hosts only.  Patching ESX with this utility is not supported.  Also, as of vSphere 4.1 the Host Update Utility has been discontinued.

VMware vSphere 4.1 Released

Today VMware released a new version of their virtualization product VMware vSphere 4.1. There are a lot of new things and features in this product. Eric Siebert has created a good article with all the new stuff that comes with this release. You can find the original article here: http://vsphere-land.com/news/vsphere-41-the-links.html

Downloads.

Continue reading

Sysprep file locations and versions

Symptoms

  • When attempting to customize the deployment of a virtual machine the radio buttons are disabled (grayed out)
  • When a virtual machine is deployed from a template, the SID is always the same, despite the fact that you chose the option to generate a new SID during template deployment and guest operating system customization
  • When attempting to create a new virtual machine from a template in ESX 3.5, you receive the following error message:
Warning: Windows customization resources were not found on this server
  • You see this error in the guestcust.log file:
deploy doesn't contain known sysprep files

Purpose

This issue may occur if Microsoft’s Sysprep files are not found on the VirtualCenter host, are not the correct version, or are not in the location they are expected.

This article guides you through the process of determining the correct version of Sysprep to use and the correct locations for these files.

Resolution

Microsoft has a different version of Sysprep for each release and service pack of Windows. You must use the version of Sysprep specific to the operating system you are deploying. The differences are not immediately visible in the packaging and documentation of the service packs, so it is necessary to manually investigate.

The contents of the Sysprep deploy.cab file must be extracted to the Sysprep Directory on the VirtualCenter Server host. If the file downloaded from the Microsoft Web Site is a .cab file, the Installing the Microsoft Sysprep Tools appendix of the Basic System Administration guide details how to install the Sysprep Tools.

If the file downloaded from the Microsoft Web Site is a .exe file the following additional steps must be executed to extract the files from the .exe:

  1. Open a Windows command prompt. For more information, see Opening a command or shell prompt (1003892).
  2. Change to the directory where the .exe file is saved.
  3. Enter the name of the .exe file with the /x switch to extract the files. For example: WindowsServer2003-KB926028-v2-x86-ENU.exe /x
  4. When prompted, choose a directory for the extracted files.
  5. Browse the directory and copy the extracted files directly to the Sysprep Directory or extract the files from the deploy.cab and copy to the Sysprep Directory.

When the contents of the of the Sysprep deploy.cab file have been extracted to the Sysprep Directory on the VirtualCenter Server:

  1. Log in to the VirtualCenter Server as Administrator.
  2. Click Start > Programs > Accessories > Windows Explorer.
  3. Navigate to the Sysprep Directory as listed in the table below.
  4. Right-click on the sysprep.exe file and choose Properties.
  5. Click the Version tab. Record the number at the top next to File Version:.

The table below lists the Sysprep Version for the Windows Versions that are supported for Image Customization. Compare the Sysprep Version number with the Windows Version it is intended for:

Windows Version Sysprep Directory Sysprep Version
Windows 2000 Server SP4 with Update Rollup 1
Download at http://www.microsoft.com/downloads/details.aspx?FamilyID=0c4bfb06-2824-4d2b-abc1-0e2223133afb
<directory_path>\2k 5.0.2195.2104
Windows XP Pro SP2
Download at http://www.microsoft.com/downloads/details.aspx?FamilyId=3E90DC91-AC56-4665-949B-BEDA3080E0F6
<directory_path>\xp 5.1.2600.2180
Windows 2003 Server SP1
Download at http://www.microsoft.com/downloads/details.aspx?familyid=A34EDCF2-EBFD-4F99-BBC4-E93154C332D6
<directory_path>\svr2003 5.2.3790.1830(srv03_sp1_rtm.050324-1447)
Windows 2003 Server SP2
Download at http://www.microsoft.com/downloads/details.aspx?FamilyID=93f20bb1-97aa-4356-8b43-9584b7e72556
<directory_path>\svr2003 5.2.3790.3959(srv03_sp2_rtm.070216-1710)
Windows 2003 Server R2
Download at http://www.microsoft.com/downloads/details.aspx?familyid=A34EDCF2-EBFD-4F99-BBC4-E93154C332D6
<directory_path>\svr2003 5.2.3790.1830(srv03_sp1_rtm.050324-1447)
Windows 2003 x64
Download at http://www.microsoft.com/downloads/details.aspx?familyid=C2684C95-6864-4091-BC9A-52AEC5491AF7&displaylang=en
<directory_path>\svr2003-64 5.2.3790.3959(srv03_sp2_rtm.070216-1710)
Windows XP x64
Download at http://www.microsoft.com/downloads/details.aspx?familyid=C2684C95-6864-4091-BC9A-52AEC5491AF7&displaylang=en
<directory_path>\xp-64 5.2.3790.3959(srv03_sp2_rtm.070216-1710)
Windows XP Pro SP3
Download at http://www.microsoft.com/downloads/details.aspx?familyid=673a1019-8e3e-4be0-ac31-70dd21b5afa7&displaylang=en
<directory_path>\xp 5.1.2600.5512
Windows Vista System Preparation tools are built into the Windows Vista operating system and do not have to be downloaded. Not Applicable Not Applicable
Windows Server 2008 System Preparation tools are built into the Windows Server 2008 operating system and do not have to be downloaded. Not Applicable Not Applicable
Windows Server 2008 R2 System Preparation tools are built into the Windows Server 2008 R2 operating system and do not have to be downloaded. Not Applicable Not Applicable
Windows 7 System Preparation tools are built into the Windows 7 operating system and do not have to be downloaded. Not Applicable Not Applicable

Notes:

  • If vCenter Server is installed on Windows Server 2008, <directory_path> is %ALLUSERSPROFILE%\VMware\VMware VirtualCenter\sysprep which translates to C:\ProgramData\VMware\VMware VirtualCenter\sysprep by default.
  • If vCenter Server is installed on any other Windows operating system, <directory_path> is %ALLUSERSPROFILE%\Application Data\VMware VirtualCenter\sysprep\ which translates to C:\Documents and Settings\All Users\Application Data\VMware\VMware VirtualCenter\sysprep\ by default.

Additional Information

For additional information, see:

Source: VMware knowledge base http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1005593

Network Emulator Toolkit

Searching for a tool to simulate a poor network connection? Here is the solution. It’s called Network Emulator Toolkit (NEWT) and is available in a 32 Bits version and a 64 Bits version.

Download.
Network Emulator Toolkit 32-Bits.
Network Emulator Toolkit 64-Bits.

There is a new version of this tool, see the comment from Lonny Kruger. He wrote a blog about it. http://blogs.msdn.com/lkruger/archive/2009/06/08/introducing-true-network-emulation-in-visual-studio-2010.aspx

Upgrading ESX 4.0 to 4.0 Update 1 on HP Proliant systems can fail

Upgrading ESX 4.0 to 4.0 Update 1 on HP Proliant systems can fail or time out and leave the host in an unusable state if the host has HP Insight Management Agents running

Symptoms

On HP Proliant systems, when attempting to upgrade ESX 4.0 to ESX 4.0 Update 1 (U1), you may experience these symptoms:
  • Upgrade operation may fail or hang and can result in an incomplete installation
  • Upon reboot, the host that was being upgraded may be left in an inconsistent state and may display a purple diagnostic screen with the following error:

COS Panic: Int3 @ mp_register_ioapic

Continue reading

ESXi 4 on a USB memory stick

  1. First get the following tools: 7-Zip(Free), WinImage(Demo)
  2. Download the ESXi ISO (VMware-VMvisor-Installer-4.0.0-164009.x86_64.iso)
  3. Open the ISO with 7-Zip
  4. Open “image.tgz” with 7-Zip
  5. Browse to “\image.tgz.temptar\usr\lib\vmware\installer\VMware-VMvisor-big-164009-x86_64.dd.bz2\”
  6. Extract “VMware-VMvisor-big-164009-x86_64.dd”
  7. Open WinImage and go to Disk, click on “Restore Virtual Harddisk Image on physical drive”
  8. Select a physical drive
  9. Select “VMware-VMvisor-big-164009-x86_64.dd”
  10. And click “yes” to write the DD image to the USB Disk