Install a TFTP server. Then, to set up PXE booting, do the following:
![]() | These binaries are also included with MSMHPC Tools. See Installing the MSMHPC Tools for more information. |
![]() | chain.c32 will not work with a mismatching version of pxelinux.0. If you are using automated deployment tools, replace pxelinux.0 with the latest version or find the matching version of chain.c32 for your version of SYSLINUX. |
The default PXE boot configuration file is pxelinux.cfg/default, a sample of which follows:
DEFAULT windows PROMPT 0 TIMEOUT 100 LABEL windows KERNEL chain.c32 APPEND hd0 1 LABEL linux KERNEL chain.c32 APPEND hd0 0
##################################################################### # # OS Switching Resource Manager # ##################################################################### RMCFG[prov] TYPE=NATIVE RESOURCETYPE=PROV # This signifies the resource manager is a provisioning RM. RMCFG[prov] ENV=OSSTRING=windows;RMNAME=HPC;PUBKEY=moabpublickey;DOMAIN=HPCDOMAIN;PROXY=http://WINDOWSHEADNODE:5343/MSMHPC # RMNAME refers to the RM configured in 4.0. # More information for this line is found in the moab.cfg file generated in section 1.1.1. RMCFG[prov] PROVDURATION=5:00 # This tells Moab how long it takes the node to reboot. RMCFG[prov] NODEMODIFYURL=exec://$HOME/scripts/os.switch.pl # This is the script Moab calls to switch the operating system.
Example os.switch.pl:
#!/usr/bin/perl # # Copyright (c) 2007-2010 Adaptive Computing Enterprises, Inc. # use strict; use warnings; use FindBin; use lib "$FindBin::Bin"; use Moab::MSMHPC; my ($host, undef, $newos, undef) = @ARGV; my $os; my $pxe_cfg_dir = '/tftpboot/pxelinux.cfg'; if (defined $newos) { (undef, $os) = split '=', $newos; } die "Usage: os.switch.pl--set OS= \n" . " os: 'linux' or 'windows'" unless defined $host and defined $os; $host = uc($host); if($os eq 'linux') { # Check that node is not already booting to the new OS chdir($pxe_cfg_dir) or die("Failed to change to $pxe_cfg_dir"); exit 0 unless readlink($host) ne $os; #switch boot os chdir($pxe_cfg_dir) or die ("Failed to change to $pxe_cfg_dir"); my $rc = system("ln -fs $os $host") >> 8; die "ln -fs $host $os FAILED with rc: $?" unless $rc == 0; # Reboot the node my $MSMHPC = Moab::MSMHPC->new(); $MSMHPC->remoteReboot($host); } elsif($os eq 'windows') { # Check that the node is not already being booted to the new OS chdir($pxe_cfg_dir) or die("Failed to change to $pxe_cfg_dir"); exit 0 unless readlink($host) ne $os; chdir($pxe_cfg_dir) or die ("Failed to change to $pxe_cfg_dir"); #switch boot os my $rc = system("ln -fs $os $host") >> 8; die "ln -fs $host $os FAILED with rc: $?" unless $rc ==0; #reboot the node $rc = system("ssh root\@$host shutdown -r now $os") >> 8; die "ssh root\@$host shutdown -r now FAILED with rc: $rc" unless $rc == 0; } else { die "Usage: os.switch.pl --set OS= \n" . " os: 'linux' or 'windows'"; } print "pending\n"; exit 0;
The script is called when Moab needs to change the operating system on a node. It changes the operating system running on a node by taking the destination operating system and compute node name as shell parameters.
Modify the examples supplied in this section as needed.
![]() |
To test switching from Windows to Linux, you need to fully configure Moab for switching. See section 3.0. |
The optional os.switch.pl.xcat script included in MSMHPC tools can be used in place of the PXE boot process, allowing you control MSMHPC using xCAT commands. The script only works with a full xCAT setup, including TFTP and DHCP servers. xCAT 2.6x is recommended.
To configure xCAT to work correctly with the os.switch.pl.xcat script, do the following:
"vm4",,"pxe","000.00.00.000"...
Copyright © 2011 Adaptive Computing Enterprises, Inc.®