VMware

SCampbell

SCampbell's Profile

  • Name: Stephen Campbell 
  • Email: (Private)
  • Member Since: Apr 18, 2005
  • Last Logged In: Nov 5, 2009 3:53 PM
  • Status Level: Enthusiast Enthusiast (215 points)
  • Location: Ottawa Canada
  • Occupation: Senior Consultant, Marchview Consultants Ltd.
  • Homepage: http://www.marchview.com
  • Biography: Infrastructure and application consultant working mostly with Microsoft and VMware technologies.

SCampbell's Latest Content


May 25 update: I guess I should have read the install docs before reading a document about deploying vSphere ESX 4 using PXE. There is a pretty comprehensive and readable discussion of PXE boot in the ESX and vCenter Server Installation Guide. You can ignore this entry.

I wanted to understand how to boot ESXi across the network using PXE. There were lots of hints, but small, crucial pieces were missing because everyone assumes you already know everything about PXE and I didn't.

PXE is defined at wikipedia http://en.wikipedia.org/wiki/Preboot_Execution_Environment. Basically you use a dhcp server to provide the DNS name or IP Address of a tiny ftp server (tftp) and the name of a bootstrap program to load, along with the usual information about IP addresses, subnets, default gateway, and DNS names.

The thing I had a lot of trouble with was what bootstrap program to use.

I'm just starting on this stateless booting process, so I haven't included any discussion of configuring the ESX server once it's booted. That's next. For now I just wanted to get the loader to work and ESXi to start.

So here's how I did it in using Windows environment

  1. I followed the good starting point vsp_4_pxe_boot_esxi.pdf available on the VMware website in the technical library. This describes how to use winrar and winimage to extract the juicy bits from the ESXi ISO image. I put these files from the first partition of the dd file into an empty working folder. The dd file is inside the bz2 file of the same name. The bz2 file is inside image.tgz at /usr/lib/vmware/installer, and image.tgz is inside the ESXi iso.
    30/04/2009 07:07 PM 150 boot.cfg
    30/04/2009 07:07 PM 12,724,149 cim.vgz
    30/04/2009 07:07 PM 1,150,353 cimstg.tgz
    30/04/2009 07:07 PM 138 license.tgz
    30/04/2009 07:07 PM 138 mod.tgz
    30/04/2009 07:07 PM 138 oem.tgz
    30/04/2009 07:07 PM 1,228 pkgdb.tgz
    30/04/2009 07:07 PM 46,173,366 sys.vgz
    30/04/2009 07:07 PM 2,044,404 vmk.gz
    30/04/2009 07:07 PM 16,805 vmkboot.gz
  2. I spent most of my "learning" time (i.e., my "how the freekity freek does this stuff work" time) trying to get the stuff in the third partion to work, and trying to understand what I needed. This partition includes the file ldlinux.sys, and I expected it to be a loader. In the end, I downloaded syslinux-3.80.zip from http://www.kernel.org/pub/linux/utils/boot/syslinux/ and copied /core/pxelinux.0, /com32/menu/menu.c32 and /com32/mboot/mboot.c32 to my same folder. I configured the DHCP scope option for the boot file to use pxelinux.0
  3. I then followed the hints at http://www.itstuff.ca/2007/09/pxe-aka-pre-execution-environment-part.html to create an empty folder pxelinux.cfg and a single file called default in the pxelinux.cfg folder. In there, I put the suggested content from the vsp_4_pxe_boot_esxi.pdf:
    default menu.c32
    menu title PXE Boot VMware ESXi
    timeout 100
    label ESXi
    menu label Boot VMware ESXi
    kernel mboot.c32
    append vmkboot.gz --- vmk.gz --- sys.vgz --- cim.vgz --- oem.tgz --- license.tgz ipappend 2
    label Hard
    menu label Boot from local drive
    localboot 0
  4. I used tftpd32 (http://tftpd32.jounin.net/) as my dhcp and tftp server, using the itstuff.ca reference above to configure dhcp and tftp. I also tried Microsoft dhcp which worked fine, and Solarwind tftp which did not work for me. Finally, I pointed the tftpd32 at my working folder. Note that you need to be careful putting dhcp on a network. Make sure there are no other dhcp servers on the same network.
  5. Change the BIOS on the ESX server to boot from the network first. Once the disk is initialized, even without an OS the PXE boot won't work unless it's first in the list.
  6. Now when I start my ESX server, it does a dhcp reservation, is given the instructions to load pxelinux.0 from my tftp server, launches pcelinux.0 which in turn reads the files from the pxelinux.cfg folder and next thing you know, you have an out-of-the-box ESXi server running.

You can have multiple files in the pxelinux.cfg folder to provide the pxe loader configuration information based on the MAC address or the IP address of the ESX server. This article http://syslinux.zytor.com/wiki/index.php/PXELINUX provides some insight into how that all works.

My next step is configuring the ESXi server. The server has no persistent state since there's no OS installed on local disk, or may there is no local disk, so it must be configured "fresh" each time it's started; usually from the vCenter server.

Another mini project is to set up my ESXi to access my new Starwind iSCSI service. The free version has been greatly expanded to increase total allowed disk to 2TB, and allow multiple concurrent connections to the disk - perfect for Windows 2008 clusters, and hopefully VMware shared storage. See http://www.starwindsoftware.com/


0 Comments Permalink

Nov 4: The {code} block now seems to be working properly, including handling of formatting characters such as [, which is great. So just go ahead and use the {code} block as you would expect and ignore this post.

Original post:
I have been a bit frustrated with how my code snippets are formatted in the forums.

Having the inline tags is great, except when your samples use those tags, and the formatting of the {code}
tag generates confusing line breaks for IE or chrome.

So my approach is as follows:

  • Use the plain text editor
  • Place code in this block {quote}...\{quote}
  • Replace any [ with backslash [
  • (Optional) End each statement with a ; even if there is a single statement on the line. If the display is wrapped the snippet may still work.
  • If it's a complete script or long snippet, attach the script file for people to download and use.
Here's an example of what I think we end up with. The indents are lost, but each line seems to be intact.
## A sample script with formatting
Connect-VIServer $env:myVCServer;
$VMHost=@{}; Get-VM | Foreach-Object { $VMHost[$_.Name]=$_.Host.Name; }
$VMCluster=@{}; Get-Cluster | Foreach-Object { $ClName=$_.Name; (Get-VM -Location $_ | Foreach-Object { $VMCluster[$_.Name]=$ClName; }) }
$VMHost.getEnumerator() | Foreach-Object {
$Item=new-object PSObject;
$Item | Add-Member -Type NoteProperty -Name "Name" -Value $_.Key;
$Item | Add-Member -Type NoteProperty -Name "Host" -Value $VMHost[$_.Key];
$Item | Add-Member -Type NoteProperty -Name "Cluster" -Value $VMCluster[$_.Key];
$Item;
} | Sort Cluster, Host, Name | Export-CSV VM-List.csv

Oct 31: The site will soon be changed so that the

{noformat}
flag shows new lines properly. Here's an example with the code tag so you want watch when things start to work.

{code:plain}
## A sample script with formatting
Connect-VIServer $env:myVCServer;
$VMHost=@{}; Get-VM | Foreach-Object { $VMHost[$_.Name]=$_.Host.Name; }
$VMCluster=@{}; Get-Cluster | Foreach-Object { $ClName=$_.Name; (Get-VM -Location $_ | Foreach-Object { $VMCluster[$_.Name]=$ClName; }) }
$VMHost.getEnumerator() | Foreach-Object { 
  $Item=new-object PSObject;
  $Item | Add-Member -Type NoteProperty -Name "Name" -Value $_.Key;
  $Item | Add-Member -Type NoteProperty -Name "Host" -Value $VMHost[$_.Key];
  $Item | Add-Member -Type NoteProperty -Name "Cluster" -Value $VMCluster[$_.Key];
  $Item;
  } | Sort Cluster, Host, Name | Export-CSV VM-List.csv

2 Comments 0 References Permalink

Just a short one to get started.

A while ago, I happily followed xtravirt's excellent procedure to create my ESX guest VM under VMware Workstation some time ago, and experienced the confusion as the ability to launch guests within my ESX environment disappeared.

However, I have been using my Infrastructure3-in-a-box mainly for configuration work so that ability wasn't important to me.

On Saturday I upgraded my Workstation from 6.0 to 6.5. Imagine my consternation when it took over an hour to boot my ESX and ESXi servers. Under 6.0 it had been booting in an acceptable 5 minutes or so.

After frantic searching and comparing the new xtravirt documentation with the old, I was able to narrow down the modifications to the .vmx file for my ESX guest. It's now back to booting in under 5 minutes and my happiness has returned.

The old bits (remove these)

virtualHW.version = "4"
monitor_control.restrictBackdoor = TRUE
monitor_control.vt32 = TRUE


The new bits (add these)
virtualHW.version = "7"
monitor_control.restrictBackdoor = TRUE
monitor.virtual_mmu = "software"
monitor.virtual_exec = "hardware"


I have seen conflicting reports whether virtualHQ.hardCompatibility="ESX" is correct, but it works for me.

If you are building new ESX guests or Infrastructure-in-a-box, please follow the instructions at www.xtravirt.com

0 Comments Permalink

Communities