Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Is there any way to get the IP assigned to a VM from a particular subnet and embed it in Heat orchestration template(given that the network has multiple subnets and we are creating one port only for all subnets)?

Is there any way to get the IP assigned to a VM from a particular subnet and embed it in Heat orchestration template(given that the network has multiple subnets and we are creating one port only for all subnets)? I need this info for floating IP. As in case of port with multiple fixed addresses on a single port, we need to give the particular IP for creating floating IP.

The get_attr key is not very helpful. Here is the JSON representation.

        "TestVM_FIPTest1": {
            "type": "OS::Neutron::FloatingIP",
            "properties": {
                "floating_network_id": "public",
                "port_id": {
                    "get_resource": "TestVM_Test1sub2sub1_Port"
                },
                  "fixed_ip_address":
                  {
                        "get_attr": ["TestVM_Test1sub2sub1_Port", "fixed_ips", 1, "ip_address"]
                  }
            }
        }

The reason being I need to pass the index to get the IP assigned on the port. But there is no way of telling , from which subnet that IP is assigned (as there the multiple subnets mapped on that port) or which index has the IP assigned from the desired subnet

Right now I am using a single template to create all the resources at once.

click to hide/show revision 2
retagged

Is there any way to get the IP assigned to a VM from a particular subnet and embed it in Heat orchestration template(given that the network has multiple subnets and we are creating one port only for all subnets)?

Is there any way to get the IP assigned to a VM from a particular subnet and embed it in Heat orchestration template(given that the network has multiple subnets and we are creating one port only for all subnets)? I need this info for floating IP. As in case of port with multiple fixed addresses on a single port, we need to give the particular IP for creating floating IP.

The get_attr key is not very helpful. Here is the JSON representation.

        "TestVM_FIPTest1": {
            "type": "OS::Neutron::FloatingIP",
            "properties": {
                "floating_network_id": "public",
                "port_id": {
                    "get_resource": "TestVM_Test1sub2sub1_Port"
                },
                  "fixed_ip_address":
                  {
                        "get_attr": ["TestVM_Test1sub2sub1_Port", "fixed_ips", 1, "ip_address"]
                  }
            }
        }

The reason being I need to pass the index to get the IP assigned on the port. But there is no way of telling , from which subnet that IP is assigned (as there the multiple subnets mapped on that port) or which index has the IP assigned from the desired subnet

Right now I am using a single template to create all the resources at once.