cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajeshbatt...@apache.org
Subject git commit: updated refs/heads/master to f960ada
Date Sun, 23 Feb 2014 03:47:47 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master e42e8762e -> f960ada36


CLOUDSTACK-6159 Fixed creating volumes(Root, DataDisk) with uuid in primary store


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

Branch: refs/heads/master
Commit: f960ada36e4826afd2ee7caaae578b2daed29112
Parents: e42e876
Author: Rajesh Battala <rajesh.battala@citrix.com>
Authored: Fri Feb 21 15:47:26 2014 +0530
Committer: Rajesh Battala <rajesh.battala@citrix.com>
Committed: Sun Feb 23 09:21:30 2014 +0530

----------------------------------------------------------------------
 .../HypervResource/CloudStackTypes.cs               | 16 ++++++++--------
 .../HypervResource/HypervResourceController.cs      | 10 ++++++----
 2 files changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f960ada3/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs
b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs
index 2f5be7f..869f108 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs
@@ -173,11 +173,11 @@ namespace HypervResource
                     PrimaryDataStoreTO store = this.primaryDataStore;
                     if (store.isLocal)
                     {
-                        fileName = Path.Combine(store.Path, this.name);
+                        fileName = Path.Combine(store.Path, this.uuid);
                     }
                     else
                     {
-                        fileName = @"\\" + store.uri.Host + store.uri.LocalPath + @"\" +
this.name;
+                        fileName = @"\\" + store.uri.Host + store.uri.LocalPath + @"\" +
this.uuid;
                         fileName = Utils.NormalizePath(fileName);
                     }
                 }
@@ -198,7 +198,7 @@ namespace HypervResource
                         fileName = Utils.NormalizePath(fileName);
                         if (Directory.Exists(fileName))
                         {
-                            fileName = Utils.NormalizePath(fileName + @"\" + this.name);
+                            fileName = Utils.NormalizePath(fileName + @"\" + this.uuid);
                         }
                     }
                 }
@@ -300,11 +300,11 @@ namespace HypervResource
                 path = Utils.NormalizePath(path);
                 if (Directory.Exists(path))
                 {
-                    string[] choices = choices = Directory.GetFiles(path, volInfo.name +
".vhd*");
+                    string[] choices = choices = Directory.GetFiles(path, volInfo.uuid +
".vhd*");
                     if (choices.Length != 1)
                     {
                         String errMsg = "Tried to guess file extension, but cannot find file
corresponding to " +
-                            Path.Combine(volInfo.primaryDataStore.Path, volInfo.name);
+                            Path.Combine(volInfo.primaryDataStore.Path, volInfo.uuid);
                         logger.Debug(errMsg);
                     }
                     else
@@ -334,18 +334,18 @@ namespace HypervResource
                     PrimaryDataStoreTO store = this.primaryDataStore;
                     if (store.isLocal)
                     {
-                        fileName = Path.Combine(store.Path, this.name);
+                        fileName = Path.Combine(store.Path, this.uuid);
                     }
                     else
                     {
-                        fileName = @"\\" + store.uri.Host + store.uri.LocalPath + @"\" +
this.name;
+                        fileName = @"\\" + store.uri.Host + store.uri.LocalPath + @"\" +
this.uuid;
                     }
                     fileName = fileName + '.' + this.format.ToLowerInvariant();
                 }
                 else if (this.nfsDataStoreTO != null)
                 {
                     NFSTO store = this.nfsDataStoreTO;
-                    fileName = store.UncPath + @"\" + this.path + @"\" + this.name;
+                    fileName = store.UncPath + @"\" + this.path + @"\" + this.uuid;
                     if (!this.format.Equals("RAW"))
                     {
                         fileName = fileName + '.' + this.format.ToLowerInvariant();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f960ada3/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 5ba78fe..e233d03 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
@@ -1168,13 +1168,13 @@ namespace HypervResource
 
                 bool result = false;
                 string details = null;
-
+                object newData = null;
                 try
                 {
                     VolumeObjectTO volume = VolumeObjectTO.ParseJson(cmd.data);
                     PrimaryDataStoreTO primary = volume.primaryDataStore;
                     ulong volumeSize = volume.size;
-                    string volumeName = volume.name + ".vhd";
+                    string volumeName = volume.uuid + ".vhd";
                     string volumePath = null;
 
                     if (primary.isLocal)
@@ -1187,11 +1187,13 @@ namespace HypervResource
                         volumePath = Utils.NormalizePath(volumePath);
                         Utils.ConnectToRemote(primary.UncPath, primary.Domain, primary.User,
primary.Password);
                     }
-
+                    volume.path = volumePath;
                     wmiCallsV2.CreateDynamicVirtualHardDisk(volumeSize, volumePath);
                     if (File.Exists(volumePath))
                     {
                         result = true;
+                        JObject ansObj = Utils.CreateCloudStackObject(CloudStackTypes.VolumeObjectTO,
volume);
+                        newData = ansObj;
                     }
                     else
                     {
@@ -1209,7 +1211,7 @@ namespace HypervResource
                 {
                     result = result,
                     details = details,
-                    data = cmd.data,
+                    data = newData,
                     contextMap = contextMap
                 };
 


Mime
View raw message