cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sanjaytripa...@apache.org
Subject git commit: updated refs/heads/4.5 to e6907ed
Date Sat, 08 Nov 2014 08:13:37 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.5 3a2f6ffd4 -> e6907ed8d


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/e6907ed8
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e6907ed8
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e6907ed8

Branch: refs/heads/4.5
Commit: e6907ed8df61d2453f65f7cc0299fb550b5c336c
Parents: 3a2f6ff
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:46:45 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/e6907ed8/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 e3c3943..9b282d8 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
@@ -2747,6 +2747,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/e6907ed8/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