how to attach multiple static ip through heat template

asked 2019-09-23 02:16:09 -0500

srini gravatar image

updated 2019-09-23 03:17:46 -0500

Hello, I had launched an instance with multiple static ip but only 1 ip is getting attached other are not available

> | e31f93cf-5b05-4095-a619-b171dff79927 | test                  | ACTIVE | a494_Provider_392=10.99.12.45; p02-private_Network_392=30.30.30.45; sarath_to_delete=1.1.1.2; sarath_to_delete_1=2.2.2.2 | CA4CI20_CP2_Deployer_30082019       
> 
> [root@test ~]# ip a
> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
>     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>     inet 127.0.0.1/8 scope host lo
>        valid_lft forever preferred_lft forever
>     inet6 ::1/128 scope host
>        valid_lft forever preferred_lft forever
> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP group default qlen 1000
>     link/ether fa:16:3e:5e:83:b5 brd ff:ff:ff:ff:ff:ff
>     inet 10.99.12.45/26 brd 10.99.12.63 scope global dynamic eth0
>        valid_lft 86398sec preferred_lft 86398sec
>     inet6 fe80::f816:3eff:fe5e:83b5/64 scope link
>        valid_lft forever preferred_lft forever
> 3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
>     link/ether fa:16:3e:75:98:4e brd ff:ff:ff:ff:ff:ff
> 4: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
>     link/ether fa:16:3e:22:6a:6b brd ff:ff:ff:ff:ff:ff
> 5: eth3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
>     link/ether fa:16:3e:75:8a:f0 brd ff:ff:ff:ff:ff:ff
> 6: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
>     link/ether 02:42:fa:25:39:ea brd ff:ff:ff:ff:ff:ff
>     inet 172.17.0.1/16 scope global docker0
>        valid_lft forever preferred_lft forever
> 
> 
> Heat template:
> 
>      type: OS::Nova::Server
>      properties:
>        name: test
>        flavor: oti_c8_c32_d300
>        key_name: crowd-key
>        availability_zone: zone-1
>        image: CA4CI20_CP2_Deployer_30082019
>        networks:
>          - port: { get_resource: instance_port4 }
>          - port: { get_resource: instance_port1 }
>          - port: { get_resource: instance_port2 }
>          - port: { get_resource: instance_port3 }
>    instance_port4:
>      type: OS::Neutron::Port
>      properties:
>        network_id: a494_Provider_392
>        security_groups:
>          - default
>        fixed_ips: [{ "ip_address": 10.99.12.45, "subnet_id": e1b3a6a5-a76b-49f8-ab23-845af011be6b}]
>    instance_port1:
>      type: OS::Neutron::Port
>      properties:
>        network_id: p02-private_Network_392
>        security_groups:
>          - default
>        fixed_ips: [{ "ip_address": 30.30.30.45, "subnet_id": 720d3985-8d8f-4570-9f0b-72499c1404dc}]
>    instance_port2:
>      type: OS::Neutron::Port
>      properties:
>        network_id: sarath_to_delete
>        security_groups:
>          - default
>        fixed_ips: [{ "ip_address": 1.1.1.2, "subnet_id": 4f276e31-3400-4e0e-8858-5d06d008e1a7}]
>    instance_port3:
>      type: OS::Neutron::Port
>      properties:
>        network_id: sarath_to_delete_1
>        security_groups:
>          - default
>        fixed_ips: [{ "ip_address": 2.2.2.2, "subnet_id": 6a666dab-3c6e-4b31-b5ef-bd094bf3bf16}]
>
edit retag flag offensive close merge delete

Comments

I see four interfaces attached: a494_Provider_392=10.99.12.45; p02-private_Network_392=30.30.30.45; sarath_to_delete=1.1.1.2; sarath_to_delete_1=2.2.2.2. The template works.

What do you mean by "not available"?

Bernd Bausch gravatar imageBernd Bausch ( 2019-09-23 03:19:49 -0500 )edit

after launching the instance 3 ip are not reacheacble .

if we login to the launched instance. this is the output . only eth0 the ip is assigned other network port network is not assigned

3: eth1: <broadcast,multicast> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether fa:16

srini gravatar imagesrini ( 2019-09-23 03:44:49 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-09-23 05:43:28 -0500

Normally, instances acquire IP addresses using DHCP. Most images that you can download from the internet only configure the first interface.

I am almost certain that this is your problem. How to solve this? I think the best solution is to add interface configuration settings to the CA4CI20_CP2_Deployer_30082019 image. You could also try to use cloud-init to change the NIC configuration when instances start.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2019-09-23 02:16:09 -0500

Seen: 177 times

Last updated: Sep 23 '19