Cloning A Virtual Machine With VMKFSTools (Works With ESXi)

Keeping with my recent trend of ESXi howto’s I thought i would through something up on cloning VM’s. Despite being one of the most useful features of using virtual hardware for labs it at first seems completely absent from ESXi.

But though not quite as easy as a right click it is possible.

Note: Though this can be done from the console by pressing ALT-F1 and typing “unsupported ” you may want to consider enabling SSH with this hack first.

  1. First thing you need to do once you have console access is find the root of your datastore for most this will be “/vmfs/volumes/<DATASTORE NAME>”.
  2. Once found make a new folder to house the newly cloned VM using “mkdir <DIRECTORY NAME>”.
  3. Next jump in to the folder for the VM you are looking to clone, you are looking for the name of the .vmdk file it will usually be <VM NAME>-000001.vmdk.
  4. Now that we have everything in place we can clone the VM with “vmkfstools -i <PATH TO SOURCE vmdk FILE> <PATH TO DESTINATION vmdk>” you will see a percent counter work up to 100%.
  5. Once the disk cloning is complete head back to the infrastructure client to create a new VM.
  6. You must choose Custom this will allow you to use the existing disk you just cloned.
  7. Set every thing else as necessary until you get to “Select A Disk” here use “Use An Existing Disk” and Next.
  8. On the next page you will be able to browse for the disk you cloned in the datastore select it and wrap up the VM creation.

Tidbit: placing “-d thin” between the source and destination disk paths when cloning will create a thin disk.

If you want to learn more about vmkfstools take a look here for some detailed usage

Also comments and questions are welcome.

No Comments Posted in ESXi, How To, Linux
VMware Tools for Linux No X Requierd

Step by step on installing VMware tools on a GUIless Linux install.

Note: the only real gain here is improved  network drivers.

Note2: Every thing here after installing the RPM must be done from a local console or bad things will happen.

[ROOT@Skynet]# mkdir /cdrom
[ROOT@Skynet]# mount -t iso9660 -o ro /dev/cdrom /cdrom
[ROOT@Skynet]# rpm -Uvh *.rpm
[ROOT@Skynet]#./vmware-install.pl
[ROOT@Skynet]#/etc/init.d/network stop
[ROOT@Skynet]#rmmod pcnet32
[ROOT@Skynet]#rmmod vmxnet
[ROOT@Skynet]#depmod -a
[ROOT@Skynet]#modprobe vmxnet
[ROOT@Skynet]#/etc/init.d/network start

VM Tools now installed!! and as an added bonus if you use ESXi you now get cool bits of info like below.

VMware Tools Linux no GUI

VMware Tools Linux no GUI

No Comments Posted in ESXi, How To, Linux
ESXi Unsupported BIOS setting CPUID is limited

Hit this error at work today installing ESXi on a Dell Optiplex seems to be common with them. Ether Dell is preventing the cpuid from being read or not reporting it properly. Following the 3 steps below will let the installer skip the cpuid check and proceed with the install.

  1. At the initial bootloader screen (when booting from the ISO), press TAB to edit the boot options
  2. Hold down the left-arrow key to move the cursor back to the beginning of the boot options, and add  nocheckCPUIDLimit” right after “vmkernel.gz”, so that the first part of the boot options BEFORE the first “—” reads: “mboot.c32 vmkernel.gz nocheckCPUIDLimit —”
  3. Press ENTER.

Edit:

To make this permanent once  in the infrastructure client navigate to Configuration –> Software –> Advanced Settings – > VMKernel –> vmkernel.boot.checkCPUIDLimit and uncheck

esxi cpuid limit fix

esxi cpuid limit fix

1 Comment Posted in How To
Install ESXi 3.5 to an IDE drive

Install ESXi 3.5 to an IDE drive

By default, if the ESXi install can not find a supported device to install to, then the installer will quit with the error message: “Unable to find a supported device to write the VMware ESX Server 3i 3.5.0 image to.” If it is the case that the IDE drive in your host is recognized by ESXi, then you will be able to modify the install script TargetFilter.py to recognize your IDE device as a supported install device. You can find the list of devices that ESXi can recognize here.

This demo was created using a VMware Workstation VM which only had a 4 GB IDE drive.

ESX on IDE install error

ESX on IDE install error

ESX IDE install error

Install Process

  • If you have encountered the error shown above, you can press ALT-F1 to access the console of the ESXi install. You’ll be prompted for a login and you can use ‘root’. The password for root with be blank. As mentioned above, this process assumes you have an IDE drive that ESXi can recognize. You can use the command lspci to show the list of devices that ESXi can recognize and then compare that with this list of devices. Also if you run fdisk -l, you should see your IDE drive listed.
  • After you have console access you will enter the command vi /usr/lib/vmware/installer/Core/TargetFilter.py (note that the path and filename are case-sensitive).
  • Scroll down in the document until you find the section “def IDEFilter(lun)”. You will be changing the text:

return interface.GetInterfaceType() == ScsiInterface.SCSI_IFACE_TYPE_IDE
to
return interface.GetInterfaceType() == ScsiInterface.SCSI_IFACE_TYPE_ISCSI

If you have not used vi before, move the cursor to the end of “TYPE_IDE” and the press the Insert key. The press backspace to delete IDE and type in ISCSI. Then press the ESC key, type in the command :wq and press Enter to save the file and exit.

  • You will now be back at the console. If you had stopped the installer at the screen show below, you can press ALT-F2 to return to the screen and press Enter to start the install, but it will still generate the error shown in the image above. You will need to press ALT-F1 and then type in install and press enter.
  • When you run the install command, it is important to note that the installer will switch you back to the ALT-F2 (DCUI) screen. Press ALT-F1 to return to the console again. You will see the below screen again with the prompt to press Enter to install. Do so and the install will proceed.
ESX on IDE install start screen

ESX on IDE install start screen

ESXi Install Screen

  • Press F11 on the next screen and you should then see your IDE drive as show below. Press Enter to continue and after a few minutes the install should complete and you will be prompted to reboot.
ESX on IDE install ide drive

ESX on IDE install ide drive

ESXi IDE instal drive list

  • After the reboot, you will be able to connect with the VI client and see that ESXi has installed to and created a VMFS partition on your IDE drive.

ESXi on IDE drive

ESX on IDE install complete

ESX on IDE install complete

No Comments Posted in How To, Linux
Tagged , , , ,