Destroyvm also removes volumes#2793
Conversation
|
@blueorangutan package |
|
@borisstoyanov a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2231 |
|
@blueorangutan test |
|
@borisstoyanov a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
|
||
| checkForUnattachedVolumes(vmId, volumes); | ||
| validateVolumes(volumes); | ||
| detachVolumesFromVm(volumes); |
There was a problem hiding this comment.
Shouldn't we detach after the VM has been stopped? As the detach might not work, let's say libvirt (KVM) hangs or something else.
If the VM is stopped the detach is a lot easier and you can remove them then.
There was a problem hiding this comment.
We don't stop the VM for a regular detach cmd? This has been tested on KVM (with a small and large amount of volumes) and it worked fine. I'm happy to make the change if required though
There was a problem hiding this comment.
@houthuis Yes, I know. I was just thinking of it, what implications it might have. The stop of the VM just make sures the detach works even better, it saves additional commands to the Agent to detach the data volumes. This is because the KVM Agent needs to talk to libvirt to detach the disks.
There was a problem hiding this comment.
@wido Can you explain the risk here? It seems no different than a regular detach. Do these fail a lot?
There was a problem hiding this comment.
@DaanHoogland My point is that it's extra calls towards the KVM Agent, it needs to talk to libvirt, etc, etc. Since we are stopping the VM a few seconds later it would be best to do the stop first.
This would make it less calls and thus less error prone.
There was a problem hiding this comment.
@wido this change has been made. please give the PR another review
|
Trillian test result (tid-2914)
|
|
@blueorangutan test |
|
@borisstoyanov a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-2916)
|
|
@houthuis can you please rebase the branch agains master, I've tried but there's some conflicts. Once you do we'll be able to get proper test results |
2d34762 to
6303fbe
Compare
|
@houthuis could you please resolve the conflicts and do a force push to restart Jenkins. |
|
Henko, can you remove extra newlines and check Travis failures? Also see marvin test failures, and regression test on vmware and xenserver hypervisors. |
6303fbe to
906c400
Compare
|
@blueorangutan package |
|
@houthuis a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2257 |
|
@blueorangutan test |
|
@houthuis a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
ui/scripts/instances.js
Outdated
| hiddenTabs.push("securityGroups"); | ||
| } | ||
There was a problem hiding this comment.
yes, will clean after tests. intellij community edition keeps on formatting js
dhlaluku
left a comment
There was a problem hiding this comment.
LGTM, please rebase against the latest master in order to eliminate the failing VM migration integration tests from this PR
|
Trillian test result (tid-2939)
|
|
ping @houthuis , don't forget the empty lines please. |
|
Trillian test result (tid-3109)
|
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✖debian. JID-2380 |
|
@blueorangutan package |
|
@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
@houthuis can you please resolve the conflict and rebase to latest master? Thanks! |
9b3cfaa to
0962e74
Compare
|
@GabrielBrascher I resolved the conflicts and rebased against latest master |
|
@blueorangutan package |
|
@dhlaluku a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2451 |
|
@blueorangutan test matrix |
|
@dhlaluku a Trillian-Jenkins matrix job (centos6 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests |
|
Trillian test result (tid-3201)
|
|
Trillian test result (tid-3200)
|
|
Trillian test result (tid-3202)
|
|
It seems we are ready to get this merged. |
|
LGTM from me! |
|
@rafaelweingartner @DaanHoogland @rhtyd could you please merge this PR? |
rafaelweingartner
left a comment
There was a problem hiding this comment.
I think we can for sure merge it. Can you just check a very minor detail?
| private Volume orchestrateDetachVolumeFromVM(long vmId, long volumeId) { | ||
| @ActionEvent(eventType = EventTypes.EVENT_VOLUME_DETACH, eventDescription = "detaching volume") | ||
| public Volume detachVolumeViaDestroyVM(long vmId, long volumeId) { | ||
| Volume result = orchestrateDetachVolumeFromVM(vmId, volumeId); |
There was a problem hiding this comment.
you can use directly return orchestrateDetachVolumeFromVM(vmId, volumeId);
|
@rafaelweingartner @nvazquez @GabrielBrascher @rhtyd any last thoughts with this PR? |
|
Merging based on reviews and approvals, thanks @dhlaluku |
Description
Currently DestroyVMCmd does not have the option to delete any attached volumes (Data Disks), resulting in unused orphan volumes sitting in CloudStack, unless the user manually deletes them or attach them to a different VM. This FR will introduce functionality to allow users of any type (who are owners of the VM) to delete the attached volumes either via the API or the UI. The UI will have the option to select which volumes should be deleted, or they can select the option to delete none. CloudStack will then detach and delete the selected volumes after destroying the VM.
DestroyVMCmd will be modified to accept a comma separated list of volume UUIDs that will be deleted. CloudStack will then validate this list, making sure that the volumes are indeed attached to the VM. If not, the operation will fail. Checks are also done to make sure the volumes are data disks.
Before destroying the VM, CloudStack will first detach the volumes, and after the VM has been destroyed, delete the volumes.
Types of changes
GitHub Issue/PRs
Screenshots (if appropriate):
How Has This Been Tested?
Checklist:
Testing