cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chipchild...@apache.org
Subject [2/3] git commit: refs/heads/4.1 - Summary: KVM - undefine persistent VMs on stop
Date Fri, 15 Mar 2013 14:01:03 GMT
Summary: KVM - undefine persistent VMs on stop

Detail: A previous patch fixed an issue where we are defining VMs to persist
locally on KVM hosts, which can cause issues if the agent isn't running and
libvirt decides to start the VM unbeknownst to cloudstack. The previous patch
stopped defining VMs as persistent. This patch adds compatibility for existing
cloudstack environments, removing the persistent definition on stop if needed.

BUG-ID: CLOUDSTACK-600
Signed-off-by: Marcus Sorensen <marcus@betterservers.com> 1363194656 -0600


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/6df107bc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/6df107bc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/6df107bc

Branch: refs/heads/4.1
Commit: 6df107bcf6439c1de8346bc8b5c6be93694d9ee4
Parents: cefece7
Author: Marcus Sorensen <marcus@betterservers.com>
Authored: Wed Mar 13 11:10:56 2013 -0600
Committer: Chip Childers <chip.childers@gmail.com>
Committed: Fri Mar 15 09:56:04 2013 -0400

----------------------------------------------------------------------
 .../kvm/resource/LibvirtComputingResource.java     |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6df107bc/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index f131ea0..59691d3 100755
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -3929,9 +3929,13 @@ ServerResource {
         try {
             dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName
                     .getBytes()));
+            int persist = dm.isPersistent();
             if (force) {
                 if (dm.getInfo().state != DomainInfo.DomainState.VIR_DOMAIN_SHUTOFF) {
                     dm.destroy();
+                    if (persist == 1) {
+                        dm.undefine();
+                    }
                 }
             } else {
                 if (dm.getInfo().state == DomainInfo.DomainState.VIR_DOMAIN_SHUTOFF) {
@@ -3949,6 +3953,10 @@ ServerResource {
                     s_logger.warn("Timed out waiting for domain " + vmName
                             + " to shutdown gracefully");
                     return Script.ERR_TIMEOUT;
+                } else {
+                    if (persist == 1) {
+                        dm.undefine();
+                    }
                 }
             }
         } catch (LibvirtException e) {


Mime
View raw message