Bug fix: De-associate IP address if enabling static nat fails#3836
Conversation
|
@ravening are you prepending an internal ticket id to this PR title? if so please remove and track the pr or github issue out of sight? |
Steps to reproduce the issue (1) create a vpc (vpc-001) and a vpc tier (vpc-001-001) (2) create a vm (vm-001-001) in vpc-001-001 (3) acquire a public ip (ip-1) and enable static nat to vm-001-001, operation succeeds. (4) acquire a public ip (ip-2) and enable static nat to vm-001-001, operation fails but the ip is still assigned to vpc tier vpc-001-001. Note down the ip address and the id of it. (5) create another vpc tier vpc-001-002, and vm (vm-001-002) in the tier (6) enabled ip-2 static nat to vm-001-002, operation should succeed
|
nothing said (maybe amend the commit too?) |
712a2a0 to
4f501de
Compare
sorry. my bad. updated it now |
yadvr
left a comment
There was a problem hiding this comment.
LGTM, but needs both manual and smoke testings.
|
@blueorangutan package |
|
@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✖centos6 ✔centos7 ✔debian. JID-672 |
|
(test run failed at backend) |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-837)
|
|
@rhtyd @DaanHoogland the smoke test cases are failing because pvt gateway connectivity issue. I guess this shouldn't be affected from my change as it involves deassociating ip from vm if the api fails and nothing else. Any opinions? |
|
@weizhouapache can you comment? Thanks. |
@rhtyd Same logic here: |
…#3836) Associating static NAT on IP to VM fails even though the IP is not allocated. When we try enable static NAT on second IP address to the same VM, the operation fails but the IP address is still allocated in the db and it can't be used to enable static NAT on different VM. Steps to reproduce the issue: (1) create a vpc (vpc-001) and a vpc tier (vpc-001-001) (2) create a vm (vm-001-001) in vpc-001-001 (3) acquire a public ip (ip-1) and enable static nat to vm-001-001, operation succeeds. (4) acquire a public ip (ip-2) and enable static nat to vm-001-001, operation fails but the ip is still assigned to vpc tier vpc-001-001. Note down the ip address and the id of it. (5) create another vpc tier vpc-001-002, and vm (vm-001-002) in the tier (6) enabled ip-2 static nat to vm-001-002, operation should succeed
Description
Associating static NAT on IP to VM fails even though the IP is not allocated.
When we try enable static NAT on second IP address to the same VM, the operation fails but the IP address is still allocated in the db and it can't be used to enable static NAT on different VM.
Types of changes
Screenshots (if appropriate):
How Has This Been Tested?
Steps to reproduce the issue
(1) create a vpc (vpc-001) and a vpc tier (vpc-001-001)
(2) create a vm (vm-001-001) in vpc-001-001
(3) acquire a public ip (ip-1) and enable static nat to vm-001-001,
operation succeeds.
(4) acquire a second public ip (ip-2) and enable static nat to the same vm vm-001-001.
The operation fails but the ip is still assigned to vpc tier vpc-001-001.
Note down the ip address and the id of it.
(5) create another vpc vpc-002, vpc tier vpc-001-002, and vm (vm-001-002) in the second tier
(6) enable static NAT on second IP ip-2 to vm-001-002.
Expected Result:
Enabling static NAT on second IP to vm vm-001-002 should be success
Actual result:
Operation fails as the IP is still allocated to first vpc/tier