VMware vSphere 5.1 Cookbook
上QQ阅读APP看书,第一时间看更新

Configuring the DHCP server for PXE boot

You need a DHCP server available in the same subnet as that of the machines on which ESX server will be Auto Deployed.

There are three ways you can set the IP addressing for the Auto Deployed hosts via DHCP:

  1. Create a DHCP scope for the subnet to which the ESXi servers will be connecting.
  2. If there is already an existing DHCP server with a scope for subnet then edit the scope options 66 and 67 accordingly.
  3. Create a reservation using the MAC address of the host.

Creating a scope is the most common method, since the whole purpose of Auto Deploy is to spawn a considerably large number of servers. The How to do it… section will guide you through the steps required to create a DHCP scope.

How to do it…

The following steps will help you create a new DHCP scope and configure it with the TFTP information. However, if you already have an existing scope servicing the subnet then you could start with step 12, to configure the scope options.

  1. Bring up the DHCP Snap-in, right-click on IPv4, and click on New Scope.
  2. At the New Scope Wizard, click on Next, specify a name and an optional description, and click on Next.
  3. On the next screen, choose the IP address range for the scope by specifying the start and the end IP address of the range.
  4. On the next screen, add an optional exclusion range or a DHCPOFFER delay, if required. Otherwise, just click on Next to continue.
  5. Choose a DHCP lease duration and click on Next.
  6. The New Scope wizard will now prompt you to choose whether to configure the additional information such as the Default gateway, DNS servers, and so on. Select Yes, I want to configure these options now and click on Next.
  7. At the Router (Default Gateway) wizard page, add the IP address of the default gateway.
  8. On the next screen, specify the parent domain, resolve the DNS servers IP address, and add it.
  9. On the next screen, specify the WINS sever details if needed and click on Next.
  10. Choose to activate the scope and click on Next.
  11. Then, click on Finish to create and activate the scope. Once done, the scope will be listed in the inventory.
  12. Right-click on Scope Options and click on Configure Options.
  13. Under the General tab of the Scope Options window, scroll-down and select the check box against the option 066 Boot Server Host Name; supply the string value with the FQDN or IP address of the TFTP server.
  14. Next, select 067 Bootfile Name and supply the string value undionly.kpxe.vmw-hardwired, which we made a note of from the Auto Deploy plugin page at the vCenter Server.

How it works…

When a machine is chosen to be provisioned with ESXi and is powered-on, it does a PXE boot by fetching an IP address from the DHCP server. The DHCP scope configuration option 66 and 67 will direct the server to contact the TFTP server and load the bootable gPXE image and an accompanying configuration file.