[Solved] IPAM IP not assigned to first VM in multi VM request

Hi All,
We have an IPAM service which has successfully been integrated to our Provisioning flow via the VMProvision_VM statemachine, as per attached image. This works fine for a single vm request. When the user request two VMs the second VM builds successfully but the first one never recieves an ip. I can see from the ipam system that two IPs were release. Both VM objects get created just the first without an ip.

add_nics_miq (1.2 KB)


It was an issue on the IPAM side.

1 Like

@dan, thanks for this post. Hope I can learn from you later to integrate ipam into VM creation process.

Hey @tjyang will keep you posted. Still finishing off the release flow…

Hi Dan,

Can you please help me with the detailed steps you have followed to integrate IPAM into manageIQ. I am a newbie to manageIQ and would help if you can provide some detailed process or stes to follow to achieve this.

HI @Ravikanth_B & @tjyang there has been some progress.

Our solution is based on an APi driven IPAM system. Most IPAMs operate in the same fashion. Our VMProvision_VM statemachine calls the reserve instance (note the on_entry method network_query). Our Retire flow calls the release instace.

Our IPAM networks are tagged and we use these tags in our network_query method to find the necessary ipam network_id, assigned to a state variable (set_state_var). With that the reserve method can make the reserve ip call. The response includes a ipam_id which we assign to an option (set_option). You need to store this ipam_id to make the release call. At PostProvision in VMProvision_VM we assign the ipam_id (get_option) to the provisioned vm as a custom attribute (custom_set_option). When VM is retire we get the custom atttribute to make the release call.

The methods use require ‘rest-client’

Check out Peter’s Mastering CF Automation. Make Objectwalker and reader your best friends and play alot. :slightly_smiling_face:

1 Like