Skip to content

Source nat IP for an active VPC can be disassociated #6663

@shwstppr

Description

@shwstppr
ISSUE TYPE
  • Bug Report
COMPONENT NAME
VPC
CLOUDSTACK VERSION
4.13.1 - 4.17.0
CONFIGURATION

N/A

OS / ENVIRONMENT

N/A

SUMMARY

Source NAT IP of a VPC can be disassociated while its VR is stilt in the running state. This causes MAC address-IP address conflict when the same IP is assigned to a new network/VPC.

STEPS TO REPRODUCE
- Deploy a VPC, no need to deploy any tier or VM
- Check VPC has a public IP assigned as source nat
- Disassociate the above IP using disassociateIpAddress API. CloudStack allows the action.
EXPECTED RESULTS
An error should be thrown preventing source nat IP of the VPC from getting disassociated
ACTUAL RESULTS
IP is disassociated while VR of the VPC is still running with the same IP.
(localcloud) 🐱 > list vpcs id=88dc6bed-7d1a-49c4-981b-9493594e57a1 filter=id,name,vpcofferingname,
{
  "count": 1,
  "vpc": [
    {
      "id": "88dc6bed-7d1a-49c4-981b-9493594e57a1",
      "name": "test",
      "vpcofferingname": "Default VPC offering"
    }
  ]
}
(localcloud) 🐱 > list routers vpcid=88dc6bed-7d1a-49c4-981b-9493594e57a1 
{
  "count": 1,
  "router": [
    {
      "account": "admin",
      "created": "2022-08-22T12:11:35+0000",
      "dns1": "10.0.32.1",
      "dns2": "8.8.8.8",
      "domain": "ROOT",
      "domainid": "ecc52a37-1a08-11ed-981f-1e00f100018f",
      "gateway": "10.0.48.1",
      "hasannotations": false,
      "healthchecksfailed": false,
      "hostid": "80492e2e-017c-497e-8291-3f4baaf57501",
      "hostname": "10.0.35.44",
      "hypervisor": "VMware",
      "id": "8077143d-b064-4446-bbae-49623d7b8094",
      "isredundantrouter": false,
      "linklocalip": "10.0.40.178",
      "linklocalmacaddress": "02:00:03:74:00:0d",
      "linklocalnetmask": "255.255.240.0",
      "linklocalnetworkid": "b6709ce9-c3e4-4e3e-81ca-6715b0820af9",
      "name": "r-100009-VM",
      "nic": [
        {
          "gateway": "10.0.32.1",
          "id": "4c2ebf4f-a304-441d-9335-6306ccaf888b",
          "ipaddress": "10.0.40.178",
          "isdefault": false,
          "macaddress": "02:00:03:74:00:0d",
          "netmask": "255.255.240.0",
          "networkid": "b6709ce9-c3e4-4e3e-81ca-6715b0820af9",
          "traffictype": "Control"
        },
        {
          "broadcasturi": "vlan://51",
          "gateway": "10.0.48.1",
          "id": "2bddf1ac-da0f-4888-bd26-0292a2caa6f4",
          "ipaddress": "10.0.56.185",
          "isdefault": true,
          "isolationuri": "vlan://51",
          "macaddress": "1e:00:d5:00:00:05",
          "netmask": "255.255.240.0",
          "networkid": "37b39d3b-56f9-4f6d-a865-ebda814b8207",
          "traffictype": "Public"
        }
      ],
      "podid": "ab424ab8-629b-4a2b-af40-3fce9d80d157",
      "podname": "Pod1",
      "publicip": "10.0.56.185",
      "publicmacaddress": "1e:00:d5:00:00:05",
      "publicnetmask": "255.255.240.0",
      "publicnetworkid": "37b39d3b-56f9-4f6d-a865-ebda814b8207",
      "redundantstate": "UNKNOWN",
      "requiresupgrade": false,
      "role": "VIRTUAL_ROUTER",
      "scriptsversion": "f2e6fd7d3ee688a2a6976b73080a3b67\n",
      "serviceofferingid": "b975321e-8c00-4cf5-a0cb-7ac7b789d79e",
      "serviceofferingname": "ggfd",
      "softwareversion": "4.17.1.0",
      "state": "Running",
      "templateid": "870e415e-6a2c-41ab-86f2-e15a1b4285d8",
      "templatename": "SystemVM Template (vSphere)",
      "version": "4.17.0",
      "vpcid": "88dc6bed-7d1a-49c4-981b-9493594e57a1",
      "vpcname": "test",
      "zoneid": "9a95cda0-12fa-4f98-ab4b-ad386ca4ecb0",
      "zonename": "pr6276-t4676-vmware-67u3"
    }
  ]
}
(localcloud) 🐱 > list publicipaddresses vpcid=88dc6bed-7d1a-49c4-981b-9493594e57a1 
{
  "count": 1,
  "publicipaddress": [
    {
      "account": "admin",
      "allocated": "2022-08-22T12:11:35+0000",
      "domain": "ROOT",
      "domainid": "ecc52a37-1a08-11ed-981f-1e00f100018f",
      "fordisplay": true,
      "forvirtualnetwork": true,
      "hasannotations": false,
      "id": "91316012-5b6d-46ee-b42f-0ee68cb0922e",
      "ipaddress": "10.0.56.185",
      "isportable": false,
      "issourcenat": true,
      "isstaticnat": false,
      "issystem": false,
      "networkid": "37b39d3b-56f9-4f6d-a865-ebda814b8207",
      "physicalnetworkid": "fe9a87c6-a7fb-4718-b2d7-2f1932fe397f",
      "state": "Allocated",
      "tags": [],
      "vlanid": "d9a7c65f-de06-409f-89d0-af1fd993dba5",
      "vlanname": "vlan://51",
      "vpcid": "88dc6bed-7d1a-49c4-981b-9493594e57a1",
      "vpcname": "test",
      "zoneid": "9a95cda0-12fa-4f98-ab4b-ad386ca4ecb0",
      "zonename": "pr6276-t4676-vmware-67u3"
    }
  ]
}
(localcloud) 🐱 > disassociate ipaddress id=91316012-5b6d-46ee-b42f-0ee68cb0922e
{
  "success": true
}
(localcloud) 🐱 > list routers vpcid=88dc6bed-7d1a-49c4-981b-9493594e57a1 
{
  "count": 1,
  "router": [
    {
      "account": "admin",
      "created": "2022-08-22T12:11:35+0000",
      "dns1": "10.0.32.1",
      "dns2": "8.8.8.8",
      "domain": "ROOT",
      "domainid": "ecc52a37-1a08-11ed-981f-1e00f100018f",
      "gateway": "10.0.48.1",
      "hasannotations": false,
      "healthchecksfailed": false,
      "hostid": "80492e2e-017c-497e-8291-3f4baaf57501",
      "hostname": "10.0.35.44",
      "hypervisor": "VMware",
      "id": "8077143d-b064-4446-bbae-49623d7b8094",
      "isredundantrouter": false,
      "linklocalip": "10.0.40.178",
      "linklocalmacaddress": "02:00:03:74:00:0d",
      "linklocalnetmask": "255.255.240.0",
      "linklocalnetworkid": "b6709ce9-c3e4-4e3e-81ca-6715b0820af9",
      "name": "r-100009-VM",
      "nic": [
        {
          "gateway": "10.0.32.1",
          "id": "4c2ebf4f-a304-441d-9335-6306ccaf888b",
          "ipaddress": "10.0.40.178",
          "isdefault": false,
          "macaddress": "02:00:03:74:00:0d",
          "netmask": "255.255.240.0",
          "networkid": "b6709ce9-c3e4-4e3e-81ca-6715b0820af9",
          "traffictype": "Control"
        },
        {
          "broadcasturi": "vlan://51",
          "gateway": "10.0.48.1",
          "id": "2bddf1ac-da0f-4888-bd26-0292a2caa6f4",
          "ipaddress": "10.0.56.185",
          "isdefault": true,
          "isolationuri": "vlan://51",
          "macaddress": "1e:00:d5:00:00:05",
          "netmask": "255.255.240.0",
          "networkid": "37b39d3b-56f9-4f6d-a865-ebda814b8207",
          "traffictype": "Public"
        }
      ],
      "podid": "ab424ab8-629b-4a2b-af40-3fce9d80d157",
      "podname": "Pod1",
      "publicip": "10.0.56.185",
      "publicmacaddress": "1e:00:d5:00:00:05",
      "publicnetmask": "255.255.240.0",
      "publicnetworkid": "37b39d3b-56f9-4f6d-a865-ebda814b8207",
      "redundantstate": "UNKNOWN",
      "requiresupgrade": false,
      "role": "VIRTUAL_ROUTER",
      "scriptsversion": "f2e6fd7d3ee688a2a6976b73080a3b67\n",
      "serviceofferingid": "b975321e-8c00-4cf5-a0cb-7ac7b789d79e",
      "serviceofferingname": "ggfd",
      "softwareversion": "4.17.1.0",
      "state": "Running",
      "templateid": "870e415e-6a2c-41ab-86f2-e15a1b4285d8",
      "templatename": "SystemVM Template (vSphere)",
      "version": "4.17.0",
      "vpcid": "88dc6bed-7d1a-49c4-981b-9493594e57a1",
      "vpcname": "test",
      "zoneid": "9a95cda0-12fa-4f98-ab4b-ad386ca4ecb0",
      "zonename": "pr6276-t4676-vmware-67u3"
    }
  ]
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions