0

I'm automating a deployment on a vmware esxi host using some custom shell scripts and I would need to know in advance the IP this VM is going to get from a DHCP prior to it being installed.

I know the MAC address in before hand. Is it possible to issue a request to the dhcp manually using the mac address reserved for the VM in order to figure out what address the DHCP will be offering and if so how?

N.B: DHCP reservation is not the solution I am trying to find, but I understand it's the most reasonable/logic - see why in my comment below.

CaseyJones
  • 103
  • 3
  • 1
    `I'm automating a deployment on a vmware host` - VMware is a company. Which VMware product are you using? `I would need to know in advance the IP this VM is going to get from a DHCP prior to it being installed` - Configure a DHCP reservation for the MAC address in question. – joeqwerty Aug 09 '15 at 21:54
  • Yup, DHCP reservation is the answer. – EEAA Aug 09 '15 at 22:13

1 Answers1

1

Yes, create a reservation for the mac on your DHCP server.

tomstephens89
  • 981
  • 1
  • 11
  • 23
  • Let's just say this is not really practical because my network department does not want to be involved in these requests. However, it's also safe to assume that leases have a very long duration – CaseyJones Aug 09 '15 at 23:05
  • Get a new network department. Seriously. This is really basic stuff. If they don't want to do it, have them delegate DHCP responsibilities to you for a segment of the network and then you can do it. Go up the chain of command if needed. – EEAA Aug 10 '15 at 00:40
  • Forge a DHCP request with the MAC of your target VM. Ensure it is ACK'd so the DHCP server activates the lease. – albal Aug 10 '15 at 02:16
  • Thanks @albal - that's the option I was thinking of and was hoping someone would have a quick trick as to how to go about it. – CaseyJones Aug 10 '15 at 07:55
  • I agree with @EEAA . Creating a DHCP reservation is really basic fundamental stuff. It isn't a mission. Chain of command time, departments need to work together instead of closing doors to each other. This is why private cloud deployments with self managed pools of resources is taking off so well for application and dev guys, no waiting for unhelpful network teams. – tomstephens89 Aug 10 '15 at 08:27
  • I agree with everyone that this is a basic need, however, I do not want to be in the line of politics, which will basically wear and slow me down. I have decided to consult the RFCs and try to write some code to do just this! – CaseyJones Aug 11 '15 at 00:23