cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajeshbatt...@apache.org
Subject [2/6] git commit: updated refs/heads/master to 866cc41
Date Thu, 30 Apr 2015 09:11:50 GMT
CLOUDSTACK-8418: [Hyper-V] use systemvm.iso from secondary storage and stop copying to local
disk

this closes #198


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

Branch: refs/heads/master
Commit: f86c0a23c14f1a59ee8a4155ca8a2c1f0218f8f8
Parents: c355810
Author: Anshul Gangwar <anshul.gangwar@citrix.com>
Authored: Thu Apr 2 15:36:32 2015 +0530
Committer: Rajesh Battala <rajesh.battala@citrix.com>
Committed: Thu Apr 30 14:42:24 2015 +0530

----------------------------------------------------------------------
 .../ServerResource/AgentShell/AgentService.cs   |  3 +-
 .../HypervResource/HypervResourceController.cs  | 46 +++++++-------------
 2 files changed, 16 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f86c0a23/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.cs
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.cs
index febd10a..94b640e 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.cs
@@ -1,4 +1,4 @@
-// Licensed to the Apache Software Foundation (ASF) under one
+// Licensed to the Apache Software Foundation (ASF) under one
 // or more contributor license agreements.  See the NOTICE file
 // distributed with this work for additional information
 // regarding copyright ownership.  The ASF licenses this file
@@ -76,7 +76,6 @@ namespace CloudStack.Plugin.AgentShell
             rsrcCnf.RootDeviceName = AgentSettings.Default.RootDeviceName;
             rsrcCnf.ParentPartitionMinMemoryMb = AgentSettings.Default.dom0MinMemory;
             rsrcCnf.LocalSecondaryStoragePath = AgentSettings.Default.local_secondary_storage_path;
-            rsrcCnf.systemVmIso = null;
 
             // Side effect:  loads the assembly containing HypervResourceController, which
             // allows HttpSelfHostServer to route requests to the controller.

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f86c0a23/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
index 5af37a9..077d5a3 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
@@ -81,7 +81,6 @@ namespace HypervResource
         public string RootDeviceName;
         public ulong ParentPartitionMinMemoryMb;
         public string LocalSecondaryStoragePath;
-        public string systemVmIso;
 
         private string getPrimaryKey(string id)
         {
@@ -157,7 +156,6 @@ namespace HypervResource
         public static HypervResourceControllerConfig config = new HypervResourceControllerConfig();
 
         private static ILog logger = LogManager.GetLogger(typeof(HypervResourceController));
-        private string systemVmIso  = "";
         Dictionary<String, String> contextMap = new Dictionary<String, String>();
 
         public static void Initialize()
@@ -1160,39 +1158,25 @@ namespace HypervResource
 
                 try
                 {
-                    string systemVmIsoPath = systemVmIso;
-                    lock (systemVmIso)
+                    string systemVmIsoPath = null;
+                    String uriStr = (String)cmd.secondaryStorage;
+                    if (!String.IsNullOrEmpty(uriStr))
                     {
-                        systemVmIsoPath = systemVmIso;
-                        String uriStr = (String)cmd.secondaryStorage;
-                        if (!String.IsNullOrEmpty(uriStr))
+                        NFSTO share = new NFSTO();
+                        share.uri = new Uri(uriStr);
+                        string defaultDataPath = wmiCallsV2.GetDefaultDataRoot();
+                        string secondaryPath = Utils.NormalizePath(Path.Combine(share.UncPath,
"systemvm"));
+                        string[] choices = Directory.GetFiles(secondaryPath, "systemvm*.iso");
+                        if (choices.Length != 1)
                         {
-                            if (String.IsNullOrEmpty(systemVmIsoPath) || !File.Exists(systemVmIsoPath))
-                            {
-                                NFSTO share = new NFSTO();
-                                share.uri = new Uri(uriStr);
-                                string defaultDataPath = wmiCallsV2.GetDefaultDataRoot();
-
-                                string secondaryPath = Utils.NormalizePath(Path.Combine(share.UncPath,
"systemvm"));
-                                string[] choices = Directory.GetFiles(secondaryPath, "systemvm*.iso");
-                                if (choices.Length != 1)
-                                {
-                                    String errMsg = "Couldn't locate the systemvm iso on
" + secondaryPath;
-                                    logger.Debug(errMsg);
-                                }
-                                else
-                                {
-                                    systemVmIsoPath = Utils.NormalizePath(Path.Combine(defaultDataPath,
Path.GetFileName(choices[0])));
-                                    if (!File.Exists(systemVmIsoPath))
-                                    {
-                                        Utils.DownloadCifsFileToLocalFile(choices[0], share,
systemVmIsoPath);
-                                    }
-                                    systemVmIso = systemVmIsoPath;
-                                }
-                            }
+                            String errMsg = "Couldn't locate the systemvm iso on " + secondaryPath;
+                            logger.Error(errMsg);
+                        }
+                        else
+                        {
+                            systemVmIsoPath = choices[0];
                         }
                     }
-
                     wmiCallsV2.DeployVirtualMachine(cmd, systemVmIsoPath);
                     result = true;
                 }


Mime
View raw message