Auto Deploy: How to PXE boot without the use of native VLAN’s

This post has already been read 18093 times!

Today I visited a client who’s routed network does not allow native VLAN’s.  Normally the VMkernel network to PXE-boot your ESXi hosts must be a native VLAN and it’s probably also designed that way.
VMware Auto Deploy

If you want to use VLANs in your Auto Deploy environment, you must set up the end to end networking properly. When the host is PXE booting, the network card must be set up to tag the frames with proper VLAN ID. You must do this manually by making the correct changes in the BIOS (if supported).

Configuring the correct VLAN on the network card’s bios worked great to download the PXE tramp file and boot up ESXi. But my booted ESXi host ended up not knowing the correct VLAN ID… not receiving DHCP offer.

Since VMware ESXi5 there is a new boot option parameter: vlanid This got me thinking about a possible solution and that is to add the VLANID tag in every boot.cfg file (but that file is auto generated by auto deploy… Let’s take a closer look at those boot files per host:

Access this URL in a web browser:
https://<auto-deploy-server>:6501/vmw/rbd/host/

Click on one of your hosts and click on the boot.cfg link to view information about the cached files being used to boot the server.  This looks like this:

bootstate=0
title=Loading VMware ESXi kernel=/vmw/cache/c9/598c7dea6b61e9a4a820fd2fa96438/tboot.4891a7c66e8112f5bfbba28856bd4afd kernelopt=BOOTIF=01-00-50-56-b7-62-9d


We would like to achieve this:

kernelopt=BOOTIF=01-00-50-56-b7-62-9d vlanid=199

Since all Auto Deploy file are auto generated from the SQLite DB it took me a while to figure out…

UPDATE: Seems that there is a nice PowerCLI cmdlet for configuring the vlanid:

example: Set-DeployOption "vlan-id" 199

Get-DeployOption

Retrieves the Auto Deploy global configuration options. This cmdlet currently supports the vlan-id option, which specifies the default VLAN ID for the ESXi Management Network of a host provisioned with Auto Deploy. Auto Deploy uses the value only if the host boots without a host profile.

check out the Auto Deploy PowerCLI Cmdlet Overview

I ended up looking in and editing the SQLite DB located at: C:\ProgramData\VMware\VMware vSphere Auto Deploy\Data\db

To edit the VLAN ID, you have to manually edit the table,

  • Stop the “VMware vSphere Auto Deploy Waiter” service on your Auto Deploy Server
  • Download SQLite.exe
  • Execute: D:\sqlite3.exe “C:\ProgramData\VMware\VMware vSphere Auto Deploy\Data\db”
  • use the following query and change 0 into the VLAN ID you require:
    UPDATE config_pairs SET value = '0' WHERE rowid = 16 AND "key" = 'vlan-id';

When the above trick is not working, and your SQLite experience is as bad as mine…
I ended up using RazorSQL:

  • Stop the “VMware vSphere Auto Deploy Waiter” service on your Auto Deploy Server
  • Download http://downloads.razorsql.com/downloads/6_0_3/razorsql6_0_3_windows.zip
  • Unpack and run razorsql.bat
  • Click to connect to database, select SQLite
  • Defina a profile name and select the Auto Deploy DB file (in my case: C:\ProgramData\VMware\VMware vSphere Auto Deploy\Data\db)
  • edit the vlan-id field in the “config_pairs” table
  • Save the table and (re)start the Auto Deploy Waiter service again.

This did the trick for me, the boot.cfg was rewritten per host to include the vlan-id at boot.

I‘m currently investigating if this workaround is supported by VMware. UPDATE, the above PowerCLI commandlet is supported…

Be sure to also check this great VMware KB article: Troubleshooting Auto Deploy

About Marco Broeken

Marco Broeken is Author of this blog and owner of vSpecialist Consulting and has 20 years experience in IT. Marco has been rewarded with the vExpert status from 2011 - 2018.

Comments

  1. Can anyone help with a question on operating auto deploy in an 802.1q environment without the use of the native vlan.
    I would like to know if a vlan does need to be specified within the gPXE file to ensure the ESXi server can connect to auto deploy once it has loaded the bootloader.

    i will be setting pxe boot on vlan with bios [HP BL685 CTRL-S]
    not sure if i need to stipulate a vlan id within gpxe stage though -[ tftp ]
    i will be setting auto deploy option vlan ID [deploy rule]

  2. I have two ESX hosts and am trying auto-depoly , first server HP Proliant BL460c G7 is booting from the image and its connecting to the VCenter without any issue and second server ProLiant BL460c G6 also using the same auto-depoly image , everything same but the issue is sometime its taking the IP from the DHCP and automatically connects to the VC but sometime it will boot using the DHCP IP and it will finish installing the image but it will fail to take the dhcp ip again to connect to the VC..it will show DHCP loopkup failed….tried so many options including the above recommendation but no luck…any idea..?

  3. I wondered if you had tried the following PowerCLI Cmdlet ?

    Set-DeployOption “vlan-id” 199

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.