Select first mode in openstack builder breaks with multiple nics

10 views
Skip to first unread message

John-Paul Robinson

unread,
Jul 17, 2019, 10:37:26 AM7/17/19
to Packer
hi folks

we are learning packer and enjoying it's utility in combo with terraform. :)

Running into a slight issue when trying to build an image for an instance in our local openstack that has two networks attached (one to a vlan that can have floating ips assigned and one for an internal vlan that can't). When packer goes to assign the floating ip it seems to request the instance nics and then assigns to the first one returned. When it's the "public" nic the assignment works. When its the "private" nic it fails. with the following

"==> openstack: Associating floating IP 'ba40e54d-535f-4dfe-93dc-f3b2f5072e11' (192.168.16.143) with instance port...
openstack: Error associating floating IP 'ba40e54d-535f-4dfe-93dc-f3b2f5072e11' (192.168.16.143) with instance port '4c9c4aa0-6af5-497a-a423-20d0aed0324f': Resource not found"

his first returned behavior seems to come from GetInstancePort() in networks.go, not sure how we might be able to control this https://github.com/hashicorp/packer/blob/master/builder/openstack/networks.go#L69

I'm looking to test a parameter that will set a preferred_net for the floating ip assignment but was wondering if there was an alternate recomeded solution.

Rickard von Essen

unread,
Jul 17, 2019, 2:14:58 PM7/17/19
to packe...@googlegroups.com
Did you try using the https://packer.io/docs/builders/openstack.html#ssh_interface option? It might solve your problem. 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/c1b943dc-afe5-426f-8c5f-af92178076f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John-Paul Robinson

unread,
Jul 17, 2019, 6:16:34 PM7/17/19
to Packer
This appears to be the same issue as reported in https://github.com/hashicorp/packer/issues/7171.  The problem is in GetInstancePort() and the default to return the default interface.  


The ssh_interface doesn't look like it will work.  The code shows it supports these values [public|private]_[ip|dns] which aren't really in the direction we are looking.

On Wednesday, July 17, 2019 at 1:14:58 PM UTC-5, Rickard von Essen wrote:
Did you try using the https://packer.io/docs/builders/openstack.html#ssh_interface option? It might solve your problem. 

On Wed, Jul 17, 2019, 16:37 John-Paul Robinson <jpro...@gmail.com> wrote:
hi folks

we are learning packer and enjoying it's utility in combo with terraform. :)

Running into a slight issue when trying to build an image for an instance in our local openstack that has two networks attached (one to a vlan that can have floating ips assigned and one for an internal vlan that can't). When packer goes to assign the floating ip it seems to request the instance nics and then assigns to the first one returned. When it's the "public" nic the assignment works. When its the "private" nic it fails. with the following

"==> openstack: Associating floating IP 'ba40e54d-535f-4dfe-93dc-f3b2f5072e11' (192.168.16.143) with instance port...
openstack: Error associating floating IP 'ba40e54d-535f-4dfe-93dc-f3b2f5072e11' (192.168.16.143) with instance port '4c9c4aa0-6af5-497a-a423-20d0aed0324f': Resource not found"

his first returned behavior seems to come from GetInstancePort() in networks.go, not sure how we might be able to control this https://github.com/hashicorp/packer/blob/master/builder/openstack/networks.go#L69

I'm looking to test a parameter that will set a preferred_net for the floating ip assignment but was wondering if there was an alternate recomeded solution.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packe...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages