The following method proved to work even for pre-vSphere ESX servers (e.g., Dinosaurs like 2.5.4) vmdk files and same methodology also worked for True Image Server images.
Steps:
1. Use Veeam’s great free tool FastSCP to upload the original.vmdk file (nothing else, just that single vmdk file is enough, not even vmx or any other associated files) to /vmfs/san/import/original.vmdk. In case you didn’t know, Veeam FastSCP is way faster than the old WinSCP or accessing VMFS from VI Client.
2. Putty SSH into ESX host and change su -, then cd to directory /vmfs/san/import/, then issue the command “vmkfstools -i original.vmdk www.abc.com.vmdk”
(note: Of course, you can use “-d thin” means thin provisioning, but I won’t recommend it as it’s waste of time and takes 2-3 times longer to convert to version 7, you will see why later)
I would also suggest DO NOT remove the original.vmdk until you have successfully completed the whole migration process.
3. Create a new VM as usual (for example, www.abc.com), when the wizard asked for disk size, just put 1GB (it’s going to be overwritten anyway later) . For best performance, select VMXNET3 during the configuration. (We shall add PVSCSI later, see step 5.)
Now, go back to putty, simply issue “mv www.abc.com* /vmfs/san/www.abc.com/”, it will ask you if you want to overwrite the two default files (www.abc.com.vmdk and www.abc.com-flat.vmdk), say yes to both.
4. Now right click and select Re-config (you must do this, or your VM won’t boot), Select everything and then change everything, including Windows License and Workgroup name, time, etc. Then you can boot this VM and login as usual. Btw, you will find network is not ready as it’s DHCP, you can change to static IP later, after login, VM sysprep will do all the trick for you and it will also reboot itself and re-configure something more.
5. In order to have ESX 4 newly added PVSCSI for your disk controller, you will need to Add a new disk of say 10MB and MUST choose a Virtual Device Node between SCSI (1:0) to SCSI (3:15) and specify whether you want to use Independent mode, then change the disk controller to PVSCSI, while keeping the original disk as whatever it is for now.
If you try to add PVSCSI to disk11 controllr without boot the VM, then you will get a famous blue screen BSOD as you haven’t installed or updated the VMware Tools for PVSCSI. Boot the VM, login and let VMTools to install all the necessary drivers for you including PVSCSI and VMXNET3.
Details see:
http://xtravirt.com/boot-from-paravirtualized-scsi-adapter
http://www.vladan.fr/changement-from-lsilogic-paralel-into-pvscsi/
Official from VMware (KB Article: 1010398)
Now shutdown your VM again, go to the original disk controller and change it to PVSCSI and power again. You’ve got it! Simple as that!
Of course, there is always some reason you DO NOT want to use VMware PVSCSI
http://blog.scottlowe.org/2009/07/05/another-reason-not-to-use-pvscsi-or-vmxnet3/
6. You may also want to re-configure the VM using re-configure now, what you need now is to right click the VM and choose “Re-Configure”, but before doing so, you will of course also need to install the corresponding sysprep in Virtual Center first.
For example, install Windows 2003 Sysprep files, you can download the file from
http://www.microsoft.com/downloads/details.aspx?FamilyID=93f20bb1-97aa-4356-8b43-9584b7e72556
Instructions: Run the filename.exe /x and extract the files into a folder, within you will find deploy.cab, extra again to C:\ProgramData\VMware\VMware vCenter Converter\sysprep\svr2003 (This is for ESX 4.1 VMware Converter). You will also need to do the same for C:\ProgramData\VMware\VMware vCenter\sysprep\svr2003 if you want to use sysprep for w2k3 template deployment later.
Use sysprep to edit the computer name, re-enter the Windows activation code and other stuff if necessary.
Now Power-On the VM, and login, it will automatically use sysprep to upgrade everything for you, just relax and watch the whole magical thing to happen, it will reboot the server, once it’s done, the only last step is to change the Display Hardware Acceleration to Full.
7. That’s it! Not yet! After reboot, when I tried to re-configure the IP again, I found
“The IP address you entered for this network adapter is already assigned to another adapter ‘VMware PCI Ethernet Adapter’. The reason is ‘VMware PCI Ethernet Adapter” is hidden from the Network connections folder because it is not physically in the computer.”
Solution:
- Select Start > Run.
- Enter cmd.exe and press Enter. This opens a command prompt. Do not close this command prompt window. In the steps below you will set an environment variable that will only exist in this command prompt window.
- At the command prompt, run this command:
set devmgr_show_nonpresent_devices=1
- In the same command prompt run this command:
Start devmgmt.msc (press Enter to start Device Manager.)
- Select View > Show Hidden Devices.
- Expand the Network Adapters tree (select the plus sign next to the Network adapters entry).
- Right-click the dimmed network adapter, and then select Uninstall.
- Close Device Manager.
- Close the Command Prompt
Actually you would want to Uninstall all the previous NIC Cards just to make sure and have a clear environment.
8. To change back to Uniprocessor for VM
According to Microsoft, “If you run a multiprocessor HAL with only a single processor installed, the computer typically works as expected, and there is little or no affect on performance.” But if you’re like me and just want to be absolutely sure that there won’t be issues, switching back to the uniprocessor HAL in Windows Server 2003 is pretty easy:
- Make sure you have at least Windows Server 2003 Service Pack 2 installed.
- Shut down the virtual machine.
- Change number of virtual processors to 1
- Power on the virtual machine.
- In Windows, go to Device Manager -> Computer.
- Right-click “ACPI Multiprocessor PC” and choose “Update Driver…“.
- Select “No, not this time” option -> “Install from a list or specific location” -> “Don’t search. I will choose the driver to install.” -> select “ACPI Uniprocessor PC.”
- Reboot the virtual machine.
9. VMware ESX 4 Reclaiming Thin Provisioned disk Unused Space
http://www.virtualizationteam.com/virtualization-vmware/vsphere-virtualization-vmware/vmware-esx-4-reclaiming-thin-provisioned-disk-unused-space.html
The summary of the solution is to use sdelete & Storage Vmotion on the virtual machine to free up that unused space.
That’s all!!! You have just successfully imported or migrated a VM from a previous old ESX version to the latest ESX 4.1 and this method should work for all ESX versions, and what’s best, you upgraded all your existing VM to VMware Version 7 with PVSCSI and VMXNET3 enhanced drivers that you can really take the benefits with technology like vStorage/VAAI/Veeam Change Block Tracking (CBT), etc.
That’s all, for more info about Import or Convert VM into ESX, see
http://blog.lewan.com/2009/12/22/vmware-vsphere-using-vmware-converter-to-import-vms-or-vmdks-from-other-vmware-products/
10. To extend disk in real-time without downtime for Windows Server 2003/2000. (Windows 2008 has the magic build, you can expand/strink the partition on the fly)
a. You can use Diskpart to extend any non-bootable partition (e.g. , D:\) on the fly. *Need to disable Page file first!!!
b. You can use Dell’s Extpart to extend bootable partition (e.g., C:\) on the fly under ONE CONDITION, the extended partition need to be RIGHT-BEHIND C:\ partition. (You can use Acronis Disk Director’s Rescue Media to do this)
Update:
I found sometimes when importing an old VMDK file or Acrnois image, the default disk controller is IDE, which you definitely need to change it to SCSI for much better performance.
Converting a virtual IDE disk to a virtual SCSI disk (KB Article: 1016192)
To convert the IDE disk to SCSI:
1.Locate the datastore path where the virtual machine resides. For example:
/vmfs/volumes/
2.From the ESX Service Console, open edit the primary disk (.vmdk) in a text editor.
3.Look for the line:
ddb.adapterType = “ide”
4.To change the adapter type to LSI Logic change the line to:
ddb.adapterType = “lsilogic”
To change the adapter type to Bus Logic change the line to:
ddb.adapterType = “buslogic”
5.Save the file.
6.From VMware Infrastructure or vSphere Client
a.Click Edit Settings for the virtual machine.
b.Select the IDE virtual disk.
c.Choose to Remove the Disk from the virtual machine.
d.Click OK.
Caution: Make sure that you do not choose Remove from disk.
7.From the Edit Settings menu for this virtual machine:
1.Click Add > Hard Disk > Use Existing Virtual Disk.
2.Navigate to the location of the disk and select to add it into the virtual machine.
3.Choose the same controller as in Step 3 as the adapter type. The SCSI ID should read SCSI 0:0.
8.If a CDROM device exists in the virtual machine it may need to have the IDE channel adjusted from IDE 0:1 to IDE 0:0. If this option is greyed out, remove the CDROM from the virtual machine and add it back. This sets it to IDE 0:0.