A. Mikkelsen

VMware ESX scripts, commands, tools and other nice to know things that will make your virtualization days easier!!!!

Browsing Posts in ESX Migrate/Upgrade

When you upgrade your vSphere environment you normally also upgrade the VM’s virtual hardware to version 7, to take advantage of the new features. This is pretty normal procedure for all VMware admins.

But in some very very rare cases you might need to move a VM upgraded to hardware version 7, to a host that doesn’t support VM’s running hardware version 7.
From a host running ESX 4.x to a host running ESX 3.x

So what to do.
There is two ways you can accomplice this task.

The first way is to use the free VMware Converter tool.
Some great guides have been created by others so I don’t want to do it all over again.
The only thing is that it can take some time to convert the VM, but it is a proven and stable method.
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1028019
Or
http://www.techhead.co.uk/vmware-esx-how-to-downgrade-a-vms-vm-versionhw-level-from-7-4-0-to-4-3-x
Or
http://blog.vmpros.nl/2010/04/09/vmware-how-to-downgrade-vm-hardware-level-7-to-4/

The other way is to do it manually, this way is a lot faster, but there is a risk that it will corrupt the VM, so make sure you have a working backup.
Use this guide on your own risk

  • Powered off the VM
  • Make sure the VM doesn’t have any snapshots before proceeding
  • From the ESX console or from a Putty session, edit the VMs VMX file, using your favorite editor
    vi /vmfs/volume/DS1/WIN2008-001/WIN2008-001.vmx
  • Change the virtual hardware version from:
    virtualHW.version = “7”

    To

    virtualHW.version = “4”
  • You don’t need to change config.version = “8”, since ESX 3.x already uses this version
  • Change the virtual controller, because virtual hardware version 4 doesn’t understand the version 7 virtual controller, from:
    scsi0.virtualDev = “lsisas1068”

    To

    scsi0.virtualDev = “lsilogic”
  • From the ESX console or from a Putty session, edit the VMs VMDK pointer file/files (if more than one virtual disk), using your favorite editor
    vi /vmfs/volume/DS1/WIN2008-001/WIN2008-001.vmdk
  • Change the virtual hardware version from:
    ddb.virtualHWVersion = "7"

    To

    ddb.virtualHWVersion = "4"
  • You should now be able to power on the VM as virtual hardware version 4.

Friday I was at a customer to upgrade their ESXi 4.0 (free) to version 4.1.
This should have been an easy task, download CD, burn it and install.

This wasn’t the case, the new ESXi 4.1 wouldn’t install, it kept freezing during the extract of the cim.vgz file.
The problem occurred on both the Dell custom of ESXi 4.0 U1 and the standard ESXi 4.1.
We googled and googled but didn’t find a solution – in the end we blamed the error on the old bios version 1.1.4.

To my luck the customer still had the CD we installed the server with 9 months ago – ESXi 4.0.

We installed ESXi using the old CD and then everything was working – but we still needed to upgrade to ESXi 4.1.

So now what to do …….

Normally you use the hostupdate utility or the Remote CLI but the hostupdate utility is not included in the free version of ESXi and the we didn’t want to install the Remote CLI on the computer.
To my luck I had the hostupdate utility installed but i kept getting this error when trying to upgrade the ESXi host.

“Failed to read the upgrade package metadata.xml”

The solution to our problem was:

  1. Since it was a ESXi free with out support, we decided to use the “ESXi command line interface”, witch is unsupported.
    Follow this guide to enable it (http://www.bauer-power.net/2010/04/vmware-esxi-hack-to-allow-ssh.html).
  2. Download and extract the upgrade ZIP file from VMware.
  3. From the VIclient, upload the extracted files to the host datastore, using the “datastore browser”
    – I uploaded the files to a folder named “upgrade”
  4. Put the ESXi host in “Maintance Mode”
    – Since it is a ESXi, this can only be done when all VM’s are powered off.
  5. Connect the the ESXi console using ex. Putty.exe.
  6. Navigate to the upgrade directory.
    cd /vmfs/volumes/local-datastore/upgrade
  7. Begin the upgrade process
    esxupdate update -m metadata.zip
    
  8. When the upgrade is finished, reboot the host.
    reboot
  9. To verify the new build number:
    – Connect to the host using the VIclient
    – Select the host
    – Choose the “Summery” tab
    – Verify that the ESXi version number and build has been updated

Just found this very interesting article http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1013109 describing a problem with Windows 2008 and ESX 4 virtual hardware version 7.

In short the article states that you might have the disks go offline in a Windows 2008 VM if you

  • Upgrade virtual hardware from version 4 to 7
  • Installing a new VM with virtual hardware 7

There is two ways to get around this (taken from the VMware KB 103109)

————————

This can be resolved by changing the SAN Automount Policy on the system. See the Microsoft article http://support.microsoft.com/kb/973834 to change the SAN Policy to online.
The SAN policy is defined within the VDS environment of the system and is represented by the following values:
  • VDS_SP_UNKNOWN = 0x0
  • VDS_SP_ONLINE = 0x1
  • VDS_SP_OFFLINE_SHARED = 0x2
  • VDS_SP_OFFLINE = 0x3
On Windows Server 2008 Enterprise and Windows Server 2008 Datacenter, the default SAN policy is VDS_SP_OFFLINE_SHARED. On all other Windows Server 2008 editions, the default SAN policy is VDS_SP_ONLINE.
To query current SAN policy from the command line, start DISKPART and issue a SAN command:
C:\>DISKPART.EXE
DISKPART> san
SAN Policy : Offline Shared

DISKPART> exit

Alternatively, you can set the disk to Online after the hardware version upgrade.
To set the disk to Online:
  1. Log in to your system as an Administrator.
  2. Click Computer Management > Storage > Disk Management.
  3. Right-click the disk and choose Online.

Today when I needed to upgrade my VC database from MSSQL2000 to MSSQL 2005 i came upon these quick guides.

http://blog.core-it.com.au/?p=27

http://spininfo.homelinux.com/news/VirtualCenter/2008/01/06/Howto_Move_Migrate_Design_VC_DB_from_SQL2000_to_SQL2005__

If you want to perform an offline upgrade of an ESX 3.x host to the new vSphere  host there are a few ways.

Using a DVD:

/root/esxupgrade.sh storage1

Using the DVD ISO:

esxupgrade.sh -i /vmfs/volumes/storage1/esx4.iso /vmfs/volumes/storage1

storage1 – should be a VMDK local datastore attached to the host.
storage1 – should be at least 8.4GB in size.

Read the full guide here.

Read this post before upgrading.

Eric Siebert has writen a very good and explaining guide on how to troubleshoot snapshots on ESX 3.x.

Virtualization administrators can use snapshots on VMware ESX to travel back in time and figure out what went wrong with their virtual machines (VMs). But what do you do when your snapshots start acting funny? In this tip, we’ll troubleshoot potential problems that may come up when using snapshots on ESX.

Read it here or read my local copy.

Looking for a guide to upgrade your VMware ESX enviroment to ESX 3.5 and VC 2.5, then this guide from RTFM Education is a must read.

http://www.rtfm-ed.co.uk/?p=482

The people over at Lostcrations have created the first known third party plugin to VC 2.5.

It enables you to SVmotion your VM’s VMDK’s between different storage locations

Take a look at it
http://www.lostcreations.com/code/wiki/vmware/viplugins/svmotion

Just stumbled upon this nice tool to do SVmotion from a Windows server
http://communities.vmware.com/thread/122847?tstart=0

A. Mikkelsen

Powered by WordPress Web Design by SRS Solutions © 2018 A. Mikkelsen Design by SRS Solutions