cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject [16/50] [abbrv] git commit: updated refs/heads/statscollector-graphite to e06a814
Date Tue, 11 Nov 2014 12:03:55 GMT
CLOUDSTACK-7868: Failed storage.PrimaryStorageDownloadCommand leaves corrupt VDIs in primary
storage.


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

Branch: refs/heads/statscollector-graphite
Commit: 6a6d4d876f876bf37219a381029184ba54024bb3
Parents: a275bd7
Author: Sanjay Tripathi <sanjay.tripathi@citrix.com>
Authored: Sat Nov 8 13:34:31 2014 +0530
Committer: Sanjay Tripathi <sanjay.tripathi@citrix.com>
Committed: Sat Nov 8 13:43:56 2014 +0530

----------------------------------------------------------------------
 .../xenserver/resource/CitrixResourceBase.java          | 10 ++++++++++
 scripts/vm/hypervisor/xenserver/vmopspremium            | 12 +++++++++++-
 2 files changed, 21 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6a6d4d87/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
index 0dde4cc..aa115b1 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
@@ -2744,6 +2744,16 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
                 try {
                     vdi.destroy(conn);
                 } catch (Exception e) {
+                    String msg = "Failed to destroy VDI : " + nameLabel + "due to " + e.toString()
+ "\n Force deleting VDI using system 'rm' command";
+                    s_logger.warn(msg);
+                    try {
+                        String srUUID = vdi.getSR(conn).getUuid(conn);
+                        String vdiUUID = vdi.getUuid(conn);
+                        String vdifile = "/var/run/sr-mount/" + srUUID + "/" + vdiUUID +
".vhd";
+                        String results = callHostPluginAsync(conn, "vmopspremium", "remove_corrupt_vdi",
10, "vdifile", vdifile);
+                    } catch (Exception e2) {
+                        s_logger.warn(e2);
+                    }
                 }
             }
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6a6d4d87/scripts/vm/hypervisor/xenserver/vmopspremium
----------------------------------------------------------------------
diff --git a/scripts/vm/hypervisor/xenserver/vmopspremium b/scripts/vm/hypervisor/xenserver/vmopspremium
index 5b9c34f..3b0b4ac 100755
--- a/scripts/vm/hypervisor/xenserver/vmopspremium
+++ b/scripts/vm/hypervisor/xenserver/vmopspremium
@@ -101,6 +101,16 @@ def copy_vhd_from_secondarystorage(session, args):
     return txt
 
 @echo
+def remove_corrupt_vdi(session, args):
+    vdifile = args['vdifile']
+    try:
+        cmd = ['rm', '-f', vdifile]
+        txt = util.pread2(cmd)
+    except:
+        txt = '10#failed'
+    return txt
+
+@echo
 def setup_heartbeat_sr(session, args):
     host = args['host']
     sr = args['sr']
@@ -146,4 +156,4 @@ def asmonitor(session, args):
         return 'fail'
 
 if __name__ == "__main__":
-    XenAPIPlugin.dispatch({"forceShutdownVM":forceShutdownVM, "upgrade_snapshot":upgrade_snapshot,
"create_privatetemplate_from_snapshot":create_privatetemplate_from_snapshot, "copy_vhd_to_secondarystorage":copy_vhd_to_secondarystorage,
"copy_vhd_from_secondarystorage":copy_vhd_from_secondarystorage, "setup_heartbeat_sr":setup_heartbeat_sr,
"setup_heartbeat_file":setup_heartbeat_file, "heartbeat": heartbeat, "asmonitor": asmonitor})
+    XenAPIPlugin.dispatch({"forceShutdownVM":forceShutdownVM, "upgrade_snapshot":upgrade_snapshot,
"create_privatetemplate_from_snapshot":create_privatetemplate_from_snapshot, "copy_vhd_to_secondarystorage":copy_vhd_to_secondarystorage,
"copy_vhd_from_secondarystorage":copy_vhd_from_secondarystorage, "setup_heartbeat_sr":setup_heartbeat_sr,
"setup_heartbeat_file":setup_heartbeat_file, "heartbeat": heartbeat, "asmonitor": asmonitor,
"remove_corrupt_vdi": remove_corrupt_vdi})


Mime
View raw message