Score:-1

How does vSphere DHCP assign IP addresses?

br flag

I have installed Ubuntu in a vSphere VM and due to some error, it got the wrong IP address. I asked IT to fix the DHCP entry and they did but the VM kept getting assigned the wrong IP. I could get it the correct IP address running dhclient but this was not persistent. The solution was to add

dhcp-identifier: mac

to /etc/netplan/99-dhcp.yaml.

Can someone explain how assigning IP addresses works by default in this case and why I have to manually set it to use the MAC address for DHCP?

vidarlo avatar
ar flag
vSphere doesn't. Talk with your IT department.
br flag
@vidarlo - not strictly true sorry, see below.
Score:1
br flag

Generally vSphere doesn't deal with IP, only ethernet - but there's two exceptions to this; if you're using NSX and if you've configured a 'Network Protocol Profile'.

Firstly just ask you VMware people if they use NSX, if they do then they'll have a lot of control of how DHCP works and can help you based on their designs.

If they don't have NSX then it could well be one of these 'Network Protocol Profiles' - this is a v7 name (it used to have a different name in previous versions but I've forgotten its name sorry) anyway it's set at the 'Datacenter' level, if you have appropriate permissions you could select the datacenter that contains thew cluster/host that manages your VM, then under 'Configure' you should see 'Network Protocol Profiles' - if one or more are in there then you can find the one that applies to your VM (they're usually assigned to port-groups or networks) and see how it's setup.

If you have none of these then I suspect you have an external/non-VMware-provided DHCP service running, again your server/networking people should be able to help.

gdkrmr avatar
br flag
Thanks for the answer. My current knowledge is that Ubuntu uses `/etc/machine-id` and sends that identifier to the dhcp server instead of the mac address. The config change just forces it to use the mac address instead of `/etc/machine-id`. So this would have nothing to do with VMWare. Does this make sense?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.