Skip to content

vpc: prevent sourcenat ip disassociation for an active vpc#6664

Merged
shwstppr merged 1 commit intoapache:4.17from
shapeblue:fix-vpc-sourcenat-disasso
Aug 24, 2022
Merged

vpc: prevent sourcenat ip disassociation for an active vpc#6664
shwstppr merged 1 commit intoapache:4.17from
shapeblue:fix-vpc-sourcenat-disasso

Conversation

@shwstppr
Copy link
Copy Markdown
Contributor

@shwstppr shwstppr commented Aug 22, 2022

Description

Fixes #6663

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

(localcloud) 🐱 > list vpcs id=d02c8c5b-6b29-4ea9-a54f-80ede983dc30 filter=id,name,state,
{
  "count": 1,
  "vpc": [
    {
      "id": "d02c8c5b-6b29-4ea9-a54f-80ede983dc30",
      "name": "testvpc",
      "state": "Enabled"
    }
  ]
}
(localcloud) 🐱 > list publicipaddresses vpcid=d02c8c5b-6b29-4ea9-a54f-80ede983dc30
{
  "count": 1,
  "publicipaddress": [
    {
      "account": "admin",
      "allocated": "2022-08-23T12:13:37+0000",
      "domain": "ROOT",
      "domainid": "096a1c2e-123b-11ed-994f-1e002e00010c",
      "fordisplay": true,
      "forvirtualnetwork": true,
      "hasannotations": false,
      "id": "e9f0591d-a089-4ce5-a1c6-89923405eee8",
      "ipaddress": "10.0.57.25",
      "isportable": false,
      "issourcenat": true,
      "isstaticnat": false,
      "issystem": false,
      "networkid": "3a41afc5-e204-4a1e-b679-e730600eca9b",
      "physicalnetworkid": "cbd66832-c67b-4b26-af82-b64d0c6c807d",
      "state": "Allocated",
      "tags": [],
      "vlanid": "7ec9ef91-692f-4e59-9b75-ec6cac3e96f1",
      "vlanname": "vlan://51",
      "vpcid": "d02c8c5b-6b29-4ea9-a54f-80ede983dc30",
      "vpcname": "testvpc",
      "zoneid": "c58c949d-78c3-4f02-babe-66d303ce30f1",
      "zonename": "pr6341-t4596-kvm-centos7"
    }
  ]
}
(localcloud) 🐱 > disassociate ipaddress id=e9f0591d-a089-4ce5-a1c6-89923405eee8
{
  "accountid": "24b1d31a-123b-11ed-994f-1e002e00010c",
  "cmd": "org.apache.cloudstack.api.command.user.address.DisassociateIPAddrCmd",
  "completed": "2022-08-23T12:14:25+0000",
  "created": "2022-08-23T12:14:25+0000",
  "jobid": "d5fd98de-297d-4edd-942b-56d8841758bb",
  "jobinstanceid": "e9f0591d-a089-4ce5-a1c6-89923405eee8",
  "jobinstancetype": "IpAddress",
  "jobprocstatus": 0,
  "jobresult": {
    "errorcode": 530,
    "errortext": "ip address is used for source nat purposes and can not be disassociated."
  },
  "jobresultcode": 530,
  "jobresulttype": "object",
  "jobstatus": 2,
  "userid": "24b32cda-123b-11ed-994f-1e002e00010c"
}
🙈 Error: async API failed for job d5fd98de-297d-4edd-942b-56d8841758bb

Fixes apache#6663

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 22, 2022

Codecov Report

Merging #6664 (301a9c1) into 4.17 (814dbba) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##               4.17    #6664      +/-   ##
============================================
- Coverage      5.86%    5.86%   -0.01%     
+ Complexity     3921     3918       -3     
============================================
  Files          2451     2451              
  Lines        242278   242281       +3     
  Branches      37912    37913       +1     
============================================
- Hits          14213    14207       -6     
- Misses       226494   226504      +10     
+ Partials       1571     1570       -1     
Impacted Files Coverage Δ
...ain/java/com/cloud/network/NetworkServiceImpl.java 0.00% <0.00%> (ø)
...apache/cloudstack/syslog/AlertsSyslogAppender.java 56.49% <0.00%> (-2.26%) ⬇️
...apache/cloudstack/alert/snmp/SnmpTrapAppender.java 58.94% <0.00%> (-2.11%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@shwstppr
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@shwstppr a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 4043

@shwstppr
Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@shwstppr a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-4752)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 43139 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6664-t4752-kvm-centos7.zip
Smoke tests completed. 100 look OK, 1 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_08_upgrade_kubernetes_ha_cluster Failure 575.57 test_kubernetes_clusters.py

Copy link
Copy Markdown
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm

@shwstppr shwstppr marked this pull request as ready for review August 23, 2022 08:34
@yadvr yadvr added this to the 4.17.1.0 milestone Aug 23, 2022
@yadvr
Copy link
Copy Markdown
Member

yadvr commented Aug 23, 2022

@blueorangutan test centos7 vmware-67u3

@blueorangutan
Copy link
Copy Markdown

@rohityadavcloud a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-4755)
Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server 7
Total time taken: 39723 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6664-t4755-vmware-67u3.zip
Smoke tests completed. 101 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

@shwstppr shwstppr merged commit cd37b13 into apache:4.17 Aug 24, 2022
neogismm pushed a commit to neogismm/cloudstack that referenced this pull request Sep 5, 2022
Fixes apache#6663

Source NAT IP should not be disassociated from an active vpc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants