When using a windows template, VMware's Virtual Center can help you customise the resulting virtual machine with a wizard, unfortunately it doesn't do this for Debian which happens to be my Linux distribution of choice.
To create the template I just installed a nice minimal installation onto a new VM, added the vmware tools, changed the VM to use paravirtual hardware then converted it to a template.
After each "Deploy from template" I simply run through the following:
It would be potential security risk to have all the VMs using the same SSH keys so I regenerate SSH keys for the VM with:
# rm /etc/ssh/ssh_host*
# dpkg-reconfigure openssh-server
Update packages
# apt-get update
# apt-get upgrade
Set the IP address (well it is likely to be a server) with:
# vi /etc/network/interfaces
Change host name as it isn't helpful to have duplicate host names due to the confusion it can cause me:
# vi /etc/hostname
Amend hosts file (to match the host name)
# vi /etc/hosts
Do a quick confidence reboot then go about installing the software onto the VM as usual to make it fit for the task you need it for.
I often find myself searching the internet for things I know can be done, but can't quite remember how to do. This blog attempts to bring some of these cerebrally elusive items together along with information or opinions on subjects I find myself interested in or having to do as a Sys Admin.
Monday, 5 December 2011
Thursday, 1 December 2011
Paravirtualizing vSphere guests
Although just setting up a virtual machine on a ESX server works well there are ways to improve the VM's performance and reduce some of the CPU overhead required when the VM interacts with the virtual hardware. The two ways I have used are installing paravirtualized drivers for network interface and for the storage controller.
Windows
If you are installing Windows from media or an ISO image:
I struggled with Windows XP box that I had imported using VMware Converter that only had an IDE drive. I tried deleting the hard drive (I was careful not to delete the underlying files), then I went to add the hard drive and set it to SCSI it would only allow IDE. I overcame this by shutting down the virtual machine, editing the relevant .vmdk file and changing the ddb.adapterType parameter to lsilogic like so:
ddb.adapterType = "lsilogic"
You should now be able to add the hard drive back in specifying the existing .vmdk file and set the SCSI adapter to "Paravirtual"
Debian 6
On a system that is already running and the VMware tools are installed. I ran all updates and it was simply a case of removing the existing network adapter and adding a new one of the type "VMXNET 3" and changing the SCSI adapter to "Paravirtual" and everything worked.
Update: Also check out this post on changing the IO scheduler on linux VMs squeezing more from your Linux VMs
Windows
If you are installing Windows from media or an ISO image:
- Edit the VM settings, replace any networks adapters with ones that are of the type "VMXNET 3."
- Change the SCSI controller type to "Paravirtual"
- On the floppy drive choose "use existing floppy image in datastore:", click browse, then find the relevant image in vmimages\floppies for your version of windows. Dont forget to "select connect at startup"
- Hit F6 during the initial installation to add the paravirtual SCSI drivers from the floppy image.
- The OS wont recognise the network card until the VMware tools are installed.
- Edit the VM settings, replace any networks adapters with ones that are of the type "VMXNET 3"
- Using the Vshpere client Edit the settings of your Windows VM, Click the "Add..." button, choose "Hard Disk", Choose "Create a new Virtual disk" and set a small size like 8 MB.
- If your VM already has a SCSI controller you will need to add an additional one. To get another controller you will need to choose a virtual device node which is from the second SCSI controller. I usually just select SCSI(1:0).
- Check device manager to ensure the the PVSCSI controller has been detected.
- Shutdown the VM, remove the hard drive you have just added and change the remaining SCSI adapter to type "Paravirtual"
- Start the machine, if all is well (you will see a blue screen if it isn't) you will have successfully changed windows to use a more efficient way to talk to it's boot drive.
I struggled with Windows XP box that I had imported using VMware Converter that only had an IDE drive. I tried deleting the hard drive (I was careful not to delete the underlying files), then I went to add the hard drive and set it to SCSI it would only allow IDE. I overcame this by shutting down the virtual machine, editing the relevant .vmdk file and changing the ddb.adapterType parameter to lsilogic like so:
ddb.adapterType = "lsilogic"
You should now be able to add the hard drive back in specifying the existing .vmdk file and set the SCSI adapter to "Paravirtual"
Debian 6
On a system that is already running and the VMware tools are installed. I ran all updates and it was simply a case of removing the existing network adapter and adding a new one of the type "VMXNET 3" and changing the SCSI adapter to "Paravirtual" and everything worked.
Update: Also check out this post on changing the IO scheduler on linux VMs squeezing more from your Linux VMs
Subscribe to:
Posts (Atom)