-
Notifications
You must be signed in to change notification settings - Fork 1.3k
expunge vm: Allow expunging a VM in destroyed state #5183
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
|
@blueorangutan package |
|
@Pearl1594 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian. SL-JID 474 |
|
@blueorangutan test |
|
@Pearl1594 a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-1204)
|
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.
LGTM
User (User role) destroys a VM without expunging:
(local) 🦍 > set username user1
(local) 🍁 > list virtualmachines filter=id,name,state listall=true
{
"count": 1,
"virtualmachine": [
{
"id": "f1e5ed65-7d57-4d87-b557-c398f69ef084",
"name": "VM-f1e5ed65-7d57-4d87-b557-c398f69ef084",
"state": "Running"
}
]
}
(local) 🐄 > destroy virtualmachine id=f1e5ed65-7d57-4d87-b557-c398f69ef084 filter=id,name,state,
{}
(local) 🐞 > list virtualmachines filter=id,name,state listall=true
(local) 🦉 > set username admin
(local) 🦋 > list virtualmachines filter=id,name,state listall=true
{
"count": 1,
"virtualmachine": [
{
"id": "f1e5ed65-7d57-4d87-b557-c398f69ef084",
"name": "VM-f1e5ed65-7d57-4d87-b557-c398f69ef084",
"state": "Destroyed"
}
]
}
Admin tries to expunge VM with destroyVirtualMachine API
Without changes - VM remains in Destroyed state
(local) 🐇 > destroy virtualmachine expunge=true id=f1e5ed65-7d57-4d87-b557-c398f69ef084
{
"virtualmachine": {
"account": "user1",
"affinitygroup": [],
"cpunumber": 1,
"cpuspeed": 500,
"created": "2021-07-06T12:50:17+0530",
"details": {
"Message.ReservedCapacityFreed.Flag": "false"
},
"displayname": "VM-f1e5ed65-7d57-4d87-b557-c398f69ef084",
"displayvm": true,
"domain": "ROOT",
"domainid": "8d26be19-de24-11eb-9f57-645d8651f45a",
"guestosid": "8d148fc5-de24-11eb-9f57-645d8651f45a",
"haenable": false,
"hypervisor": "Simulator",
"id": "f1e5ed65-7d57-4d87-b557-c398f69ef084",
"instancename": "i-5-9-VM",
"isdynamicallyscalable": false,
"jobid": "43be3978-1472-4a10-b2c9-5fef38a8e98f",
"jobstatus": 0,
"memory": 512,
"name": "VM-f1e5ed65-7d57-4d87-b557-c398f69ef084",
"nic": [
{
"extradhcpoption": [],
"gateway": "10.1.1.1",
"id": "8e6f3201-9ac3-4ee6-b726-d23206d0bb91",
"ipaddress": "10.1.1.149",
"isdefault": true,
"macaddress": "02:00:62:9c:00:06",
"netmask": "255.255.255.0",
"networkid": "2b56b153-9b56-4cf0-b23a-ef3817f9b806",
"networkname": "nw",
"secondaryip": [],
"traffictype": "Guest",
"type": "Isolated"
}
],
"osdisplayname": "CentOS 5.6 (64-bit)",
"ostypeid": "8d148fc5-de24-11eb-9f57-645d8651f45a",
"passwordenabled": false,
"pooltype": "NetworkFilesystem",
"rootdeviceid": 0,
"rootdevicetype": "ROOT",
"securitygroup": [],
"serviceofferingid": "2da9fd13-5eb3-44a2-8912-656ab3facb9d",
"serviceofferingname": "Small Instance",
"state": "Destroyed",
"tags": [],
"templatedisplaytext": "CentOS 5.6 (64-bit) no GUI (Simulator)",
"templateid": "92b2849b-de25-11eb-9f57-645d8651f45a",
"templatename": "CentOS 5.6 (64-bit) no GUI (Simulator)",
"userid": "373a6269-44f3-4853-8462-1f84cd3261db",
"username": "user1",
"zoneid": "f058985d-64b4-4cb9-8185-12ccb3e36e6b",
"zonename": "Sandbox-simulator"
}
}
(local) 🕷 > list virtualmachines filter=id,name,state listall=true
{
"count": 1,
"virtualmachine": [
{
"id": "f1e5ed65-7d57-4d87-b557-c398f69ef084",
"name": "VM-f1e5ed65-7d57-4d87-b557-c398f69ef084",
"state": "Destroyed"
}
]
}
WIth changes - VM is successfully expunged
(local) 🦇 > destroy virtualmachine expunge=true id=f1e5ed65-7d57-4d87-b557-c398f69ef084
{
"null": {
"affinitygroup": [],
"nic": [],
"securitygroup": [],
"tags": []
}
}
(local) 🐄 > list virtualmachines filter=id,name,state listall=true
vladimirpetrov
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.
Functionality tested, LGTM!
weizhouapache
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.
code lgtm
Description
Fixes: #5180
This PR allows users to expunge a VM in destroyed state (via destroyVM cmd).
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Attempt expunging a VM in destroyed state using the bulk action support in the UI.