-
Notifications
You must be signed in to change notification settings - Fork 1.3k
server: fix cannot create vm if another vm with same name has been added and removed on the network #4600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…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.
|
nice cleanup, but shouldn't |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
@blueorangutan package |
|
@shwstppr a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✖centos7 ✖centos8 ✔debian. JID-2588 |
shwstppr
left a comment
There was a problem hiding this 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"
}
}
|
@shwstppr thanks for tesitng. |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos7 ✖centos8 ✔debian. JID-2592 |
|
@blueorangutan test |
|
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-3417)
|
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
Feature/Enhancement Scale or Bug Severity
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?