Skip to content

Conversation

@ustcweizhou
Copy link
Contributor

Description

The fixes an issue that fails to create a vm if the name has been used by another vm.

steps to reproduce the issue
(1) create vm-1 on network-1
(2) add vm-1 to network-2
(3) remove vm-1 from network-2
(4) create another vm with same name vm-1 on network-2

expected result: operation succeed
actual result: operation failed.

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

Bug Severity

  • BLOCKER
  • Critical
  • [] Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

…ded and removed on the network

steps to reproduce the issue
(1) create vm-1 on network-1
(2) add vm-1 to network-2
(3) remove vm-1 from network-2
(4) create another vm with same name vm-1 on network-2

expected result: operation succeed
actual result: operation failed.
@DaanHoogland
Copy link
Contributor

nice cleanup, but shouldn't removed in the listDistinctHostNames() still be null? I.E. teh line 282 remain

    DistinctHostNameSearch.and("removed", DistinctHostNameSearch.entity().getRemoved(), SearchCriteria.Op.NULL);

@DaanHoogland DaanHoogland added this to the 4.14.1.0 milestone Jan 21, 2021
@yadvr yadvr requested review from shwstppr and yadvr January 25, 2021 07:51
@yadvr
Copy link
Member

yadvr commented Jan 25, 2021

@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@shwstppr
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✖centos7 ✖centos8 ✔debian. JID-2588

Copy link
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

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

Deployed a VM named nametest in network-1. Added it in network-2. Then removed it from network-2

> list virtualmachines id=de852d26-68ee-4c81-b319-1ea84b2e99ab 
{
  "count": 1,
  "virtualmachine": [
    {
      "account": "admin",
      "affinitygroup": [],
      "bootmode": "legacy",
      "boottype": "Bios",
      "cpunumber": 1,
      "cpuspeed": 500,
      "cpuused": "10%",
      "created": "2021-01-26T11:34:56+0530",
      "details": {},
      "diskioread": 0,
      "diskiowrite": 0,
      "diskkbsread": 0,
      "diskkbswrite": 0,
      "displayname": "nametest",
      "displayvm": true,
      "domain": "ROOT",
      "domainid": "284bc227-5f98-11eb-b2a8-a0afbd4a2d60",
      "guestosid": "283ee5bb-5f98-11eb-b2a8-a0afbd4a2d60",
      "haenable": false,
      "hostid": "4e57d042-1292-4ecc-9c8c-bdcb329895df",
      "hostname": "SimulatedAgent.dca54c86-279c-4ad8-a705-00f2879aaf8a",
      "hypervisor": "Simulator",
      "id": "de852d26-68ee-4c81-b319-1ea84b2e99ab",
      "instancename": "i-2-7-QA",
      "isdynamicallyscalable": false,
      "memory": 512,
      "memoryintfreekbs": 0,
      "memorykbs": 0,
      "memorytargetkbs": 0,
      "name": "nametest",
      "networkkbsread": 65536,
      "networkkbswrite": 32768,
      "nic": [
        {
          "broadcasturi": "vlan://4321",
          "extradhcpoption": [],
          "gateway": "10.9.8.1",
          "id": "88957738-9e60-4795-9a6f-eafcfe40b7f7",
          "ipaddress": "10.9.8.14",
          "isdefault": true,
          "isolationuri": "vlan://4321",
          "macaddress": "1e:00:95:00:01:a6",
          "netmask": "255.255.255.0",
          "networkid": "62694527-4073-4e8e-840f-1688a4652cd0",
          "networkname": "net-b",
          "secondaryip": [],
          "traffictype": "Guest",
          "type": "Shared"
        }
      ],
      "osdisplayname": "CentOS 5.6 (64-bit)",
      "ostypeid": "283ee5bb-5f98-11eb-b2a8-a0afbd4a2d60",
      "passwordenabled": false,
      "rootdeviceid": 0,
      "rootdevicetype": "ROOT",
      "securitygroup": [],
      "serviceofferingid": "a0194498-2a06-4110-9db1-99020ba9a326",
      "serviceofferingname": "Small Instance",
      "state": "Running",
      "tags": [],
      "templatedisplaytext": "CentOS 5.6 (64-bit) no GUI (Simulator)",
      "templateid": "68a1f0ce-5f98-11eb-b2a8-a0afbd4a2d60",
      "templatename": "CentOS 5.6 (64-bit) no GUI (Simulator)",
      "userid": "284f2b10-5f98-11eb-b2a8-a0afbd4a2d60",
      "username": "admin",
      "zoneid": "390f525e-6c46-432d-8552-6519980f34c3",
      "zonename": "Sandbox-simulator"
    }
  ]
}

VMs in network-2 returned empty,

> list virtualmachines networkid=7e686848-e92a-449a-b1e3-cb0e5116ea7f

Before changes deployment with same name in network-2 failed

> deploy virtualmachine zoneid=390f525e-6c46-432d-8552-6519980f34c3 templateid=68a1f0ce-5f98-11eb-b2a8-a0afbd4a2d60 serviceofferingid=a0194498-2a06-4110-9db1-99020ba9a326 networkids=7e686848-e92a-449a-b1e3-cb0e5116ea7f name=nametest
🙈 Error: (HTTP 431, error code 4350) The vm with hostName nametest already exists in the network domain: cs1sandbox.simulator; network=Ntwk[204|Guest|7]

After changes deployment worked,

> deploy virtualmachine zoneid=390f525e-6c46-432d-8552-6519980f34c3 templateid=68a1f0ce-5f98-11eb-b2a8-a0afbd4a2d60 serviceofferingid=a0194498-2a06-4110-9db1-99020ba9a326 networkids=7e686848-e92a-449a-b1e3-cb0e5116ea7f name=nametest
{
  "virtualmachine": {
    "account": "admin",
    "affinitygroup": [],
    "bootmode": "legacy",
    "boottype": "Bios",
    "cpunumber": 1,
    "cpuspeed": 500,
    "created": "2021-01-26T11:44:23+0530",
    "details": {},
    "displayname": "nametest",
    "displayvm": true,
    "domain": "ROOT",
    "domainid": "284bc227-5f98-11eb-b2a8-a0afbd4a2d60",
    "guestosid": "283ee5bb-5f98-11eb-b2a8-a0afbd4a2d60",
    "haenable": false,
    "hostid": "d0d000ac-9338-4e66-9b13-e7f940149572",
    "hostname": "SimulatedAgent.c10739c1-bfb8-4195-bd47-2b8b3157ebee",
    "hypervisor": "Simulator",
    "id": "22de3761-ec52-4e04-b6f0-4396384875a5",
    "instancename": "i-2-9-QA",
    "isdynamicallyscalable": false,
    "jobid": "8e784952-bb14-41d8-8c47-fdeadebae79f",
    "jobstatus": 0,
    "memory": 512,
    "name": "nametest",
    "nic": [
      {
        "broadcasturi": "vlan://1234",
        "extradhcpoption": [],
        "gateway": "10.9.9.1",
        "id": "0845964e-84d5-42ea-8abe-89dcaa2f50ed",
        "ipaddress": "10.9.9.28",
        "isdefault": true,
        "isolationuri": "vlan://1234",
        "macaddress": "1e:00:e4:00:01:a0",
        "netmask": "255.255.255.0",
        "networkid": "7e686848-e92a-449a-b1e3-cb0e5116ea7f",
        "networkname": "net-a",
        "secondaryip": [],
        "traffictype": "Guest",
        "type": "Shared"
      }
    ],
    "osdisplayname": "CentOS 5.6 (64-bit)",
    "ostypeid": "283ee5bb-5f98-11eb-b2a8-a0afbd4a2d60",
    "passwordenabled": false,
    "rootdeviceid": 0,
    "rootdevicetype": "ROOT",
    "securitygroup": [],
    "serviceofferingid": "a0194498-2a06-4110-9db1-99020ba9a326",
    "serviceofferingname": "Small Instance",
    "state": "Running",
    "tags": [],
    "templatedisplaytext": "CentOS 5.6 (64-bit) no GUI (Simulator)",
    "templateid": "68a1f0ce-5f98-11eb-b2a8-a0afbd4a2d60",
    "templatename": "CentOS 5.6 (64-bit) no GUI (Simulator)",
    "userid": "284f2b10-5f98-11eb-b2a8-a0afbd4a2d60",
    "username": "admin",
    "zoneid": "390f525e-6c46-432d-8552-6519980f34c3",
    "zonename": "Sandbox-simulator"
  }
}

@weizhouapache
Copy link
Member

@shwstppr thanks for tesitng.
however, I made a new commit to add back a line of code as per @DaanHoogland 's comment.

@yadvr
Copy link
Member

yadvr commented Jan 26, 2021

@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos7 ✖centos8 ✔debian. JID-2592

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Trillian test result (tid-3417)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 39019 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4600-t3417-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py
Smoke tests completed. 82 look OK, 1 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_07_deploy_kubernetes_ha_cluster Failure 3617.87 test_kubernetes_clusters.py
test_08_deploy_and_upgrade_kubernetes_ha_cluster Failure 0.08 test_kubernetes_clusters.py
test_09_delete_kubernetes_ha_cluster Failure 0.06 test_kubernetes_clusters.py
ContextSuite context=TestKubernetesCluster>:teardown Error 73.91 test_kubernetes_clusters.py

@yadvr yadvr merged commit 182cea7 into apache:4.14 Jan 27, 2021
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.

6 participants