You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2014/06/13 12:41:43 UTC

[1/4] git commit: updated refs/heads/4.4 to a951b51

Repository: cloudstack
Updated Branches:
  refs/heads/4.4 f26b6d0a7 -> a951b5152


CLOUDSTACK-6897: when we try to attach the uploaded/allocated volume to a VM on zwps, then we were passing the podId of VM instead of storage pool to storage allocator. This resulting in use of Clusterscope storage allocator, allocating a storage pool for VM on zwps beacuse of pod id not null. This was resulting in scope conflict later

(cherry picked from commit 2dc9e2c530b36efc4c4684e13ae0412103925d05)


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

Branch: refs/heads/4.4
Commit: 117c8fe5b0e1b9f1045cbf65e3285fbf205770bf
Parents: f26b6d0
Author: Anshul Gangwar <an...@citrix.com>
Authored: Thu Jun 12 13:54:56 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Fri Jun 13 12:38:14 2014 +0200

----------------------------------------------------------------------
 .../apache/cloudstack/engine/orchestration/VolumeOrchestrator.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/117c8fe5/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
index 064ffca..b6fecfb 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
@@ -724,8 +724,8 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
     public VolumeInfo createVolumeOnPrimaryStorage(VirtualMachine vm, Volume rootVolumeOfVm, VolumeInfo volume, HypervisorType rootDiskHyperType) throws NoTransitionException {
         VirtualMachineTemplate rootDiskTmplt = _entityMgr.findById(VirtualMachineTemplate.class, vm.getTemplateId());
         DataCenter dcVO = _entityMgr.findById(DataCenter.class, vm.getDataCenterId());
-        Pod pod = _entityMgr.findById(Pod.class, vm.getPodIdToDeployIn());
         StoragePoolVO rootDiskPool = _storagePoolDao.findById(rootVolumeOfVm.getPoolId());
+        Pod pod = _entityMgr.findById(Pod.class, rootDiskPool.getPodId());
         ServiceOffering svo = _entityMgr.findById(ServiceOffering.class, vm.getServiceOfferingId());
         DiskOffering diskVO = _entityMgr.findById(DiskOffering.class, volume.getDiskOfferingId());
         Long clusterId = (rootDiskPool == null ? null : rootDiskPool.getClusterId());


[2/4] git commit: updated refs/heads/4.4 to a951b51

Posted by da...@apache.org.
CLOUDSTACK-6872: [hyperv] removed the redundant connectToRemote, DisconnectRemote methods which in turn fixes this bug. connectToRemote was used to connect to share, but once the share is domain joined we don't need this method as we already have required permissions

(cherry picked from commit cef29948a708fbbae1261dbd8b6a13e4da19c703)


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

Branch: refs/heads/4.4
Commit: ef0cec938165fdf3531f92dc8f4c2930ff95fa5e
Parents: 117c8fe
Author: Anshul Gangwar <an...@citrix.com>
Authored: Wed Jun 11 11:04:35 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Fri Jun 13 12:39:27 2014 +0200

----------------------------------------------------------------------
 .../HypervResource/HypervResourceController.cs  | 15 ---------
 .../ServerResource/HypervResource/Utils.cs      | 33 --------------------
 .../ServerResource/HypervResource/WmiCallsV2.cs |  3 +-
 3 files changed, 1 insertion(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ef0cec93/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 b6f9a01..1a46b50 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
@@ -236,7 +236,6 @@ namespace HypervResource
                     {
                         TemplateObjectTO dataStore = disk.templateObjectTO;
                         NFSTO share = dataStore.nfsDataStoreTO;
-                        Utils.ConnectToRemote(share.UncPath, share.Domain, share.User, share.Password);
                         string diskPath = Utils.NormalizePath(Path.Combine(share.UncPath, dataStore.path));
                         wmiCallsV2.AttachIso(vmName, diskPath);
                         result = true;
@@ -244,11 +243,6 @@ namespace HypervResource
                     else if (disk.type.Equals("DATADISK"))
                     {
                         VolumeObjectTO volume = disk.volumeObjectTO;
-                        PrimaryDataStoreTO primary = volume.primaryDataStore;
-                        if (!primary.isLocal)
-                        {
-                            Utils.ConnectToRemote(primary.UncPath, primary.Domain, primary.User, primary.Password);
-                        }
                         string diskPath = Utils.NormalizePath(volume.FullFileName);
                         wmiCallsV2.AttachDisk(vmName, diskPath, disk.diskSequence);
                         result = true;
@@ -991,7 +985,6 @@ namespace HypervResource
                     hostPath = Utils.NormalizePath(share.UncPath);
 
                     // Check access to share.
-                    Utils.ConnectToRemote(share.UncPath, share.Domain, share.User, share.Password);
                     Utils.GetShareDetails(share.UncPath, out capacityBytes, out availableBytes);
                     config.setPrimaryStorage((string)cmd.pool.uuid, hostPath);
                 }
@@ -1283,7 +1276,6 @@ namespace HypervResource
                     {
                         volumePath = @"\\" + primary.uri.Host + primary.uri.LocalPath + @"\" + volumeName;
                         volumePath = Utils.NormalizePath(volumePath);
-                        Utils.ConnectToRemote(primary.UncPath, primary.Domain, primary.User, primary.Password);
                     }
                     volume.path = volume.uuid;
                     wmiCallsV2.CreateDynamicVirtualHardDisk(volumeSize, volumePath);
@@ -1558,17 +1550,10 @@ namespace HypervResource
                         if (destTemplateObjectTO.primaryDataStore != null)
                         {
                             destFile = destTemplateObjectTO.FullFileName;
-                            if (!destTemplateObjectTO.primaryDataStore.isLocal)
-                            {
-                                PrimaryDataStoreTO primary = destTemplateObjectTO.primaryDataStore;
-                                Utils.ConnectToRemote(primary.UncPath, primary.Domain, primary.User, primary.Password);
-                            }
                         }
                         else if (destTemplateObjectTO.nfsDataStoreTO != null)
                         {
                             destFile = destTemplateObjectTO.FullFileName;
-                            NFSTO store = destTemplateObjectTO.nfsDataStoreTO;
-                            Utils.ConnectToRemote(store.UncPath, store.Domain, store.User, store.Password);
                         }
                     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ef0cec93/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Utils.cs
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Utils.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Utils.cs
index d0d3d83..07dd78b 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Utils.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Utils.cs
@@ -128,32 +128,6 @@ namespace HypervResource
             }
         }
 
-        public static void ConnectToRemote(string remoteUNC, string domain, string username, string password)
-        {
-            NETRESOURCE nr = new NETRESOURCE();
-            nr.dwType = RESOURCETYPE_DISK;
-            nr.lpRemoteName = Utils.NormalizePath(remoteUNC);
-            if (domain != null)
-            {
-                username = domain + @"\" + username;
-            }
-
-            int ret = WNetUseConnection(IntPtr.Zero, nr, password, username, 0, null, null, null);
-            if (ret != NO_ERROR)
-            {
-                throw new ArgumentException("net use of share " + remoteUNC + "failed with "+ getErrorForNumber(ret));
-            }
-        }
-
-        public static void DisconnectRemote(string remoteUNC)
-        {
-            int ret = WNetCancelConnection2(remoteUNC, CONNECT_UPDATE_PROFILE, false);
-            if (ret != NO_ERROR)
-            {
-                throw new ArgumentException("net disconnect of share " + remoteUNC + "failed with " + getErrorForNumber(ret));
-            }
-        }
-
         public static void GetShareDetails(string remoteUNC, out long capacity, out long available)
         {
             ulong freeBytesAvailable;
@@ -228,13 +202,6 @@ namespace HypervResource
         [DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
         public extern static bool DuplicateToken(IntPtr existingTokenHandle, int SECURITY_IMPERSONATION_LEVEL, ref IntPtr duplicateTokenHandle);
 
-        [DllImport("Mpr.dll")]
-        private static extern int WNetUseConnection(IntPtr hwndOwner, NETRESOURCE lpNetResource, string lpPassword, string lpUserID, int dwFlags,
-            string lpAccessName, string lpBufferSize, string lpResult);
-
-        [DllImport("Mpr.dll")]
-        private static extern int WNetCancelConnection2(string lpName, int dwFlags, bool fForce);
-
         [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
         private static extern bool GetDiskFreeSpaceEx(string lpDirectoryName,
            out ulong lpFreeBytesAvailable,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ef0cec93/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs
index d8dd3bb..c1f6bcf 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.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
@@ -333,7 +333,6 @@ namespace HypervResource
                 else if (templateInfo != null && templateInfo.nfsDataStoreTO != null)
                 {
                     NFSTO share = templateInfo.nfsDataStoreTO;
-                    Utils.ConnectToRemote(share.UncPath, share.Domain, share.User, share.Password);
                     // The share is mapped, now attach the iso
                     isoPath = Utils.NormalizePath(Path.Combine(share.UncPath, templateInfo.path));
                 }


[4/4] git commit: updated refs/heads/4.4 to a951b51

Posted by da...@apache.org.
CLOUDSTACK-6865 , CLOUDSTACK-6868: [hyperv] while attaching the volume we were changing the volume's Image format to hypervisor's default Image format, hence it was failing to find the volume with vhdx format. Now changed the behavior to set Image Format for volume only when it is not set

(cherry picked from commit ebff469b46551f8613013e80aa0386203a9c7912)


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

Branch: refs/heads/4.4
Commit: a951b51523069e72e5cd1e503df11b9370b6d6d8
Parents: 2c5f352
Author: Anshul Gangwar <an...@citrix.com>
Authored: Tue Jun 10 16:28:32 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Fri Jun 13 12:41:18 2014 +0200

----------------------------------------------------------------------
 .../cloudstack/engine/orchestration/VolumeOrchestrator.java      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a951b515/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
index b6fecfb..358b3bd 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
@@ -746,7 +746,9 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
             throw new CloudRuntimeException("Volume shouldn't be null " + volume.getId());
         }
         VolumeVO volVO = _volsDao.findById(vol.getId());
-        volVO.setFormat(getSupportedImageFormatForCluster(rootDiskHyperType));
+        if (volVO.getFormat() == null) {
+            volVO.setFormat(getSupportedImageFormatForCluster(rootDiskHyperType));
+        }
         _volsDao.update(volVO.getId(), volVO);
         return volFactory.getVolume(volVO.getId());
     }


[3/4] git commit: updated refs/heads/4.4 to a951b51

Posted by da...@apache.org.
CLOUDSTACK-6867: Added option to upload the volume in VHDX format

(cherry picked from commit 2e49ef73bfcb548cf19d1230f00a0510b7d09150)


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

Branch: refs/heads/4.4
Commit: 2c5f352e94e071113ae1bbf74435662568902043
Parents: ef0cec9
Author: Anshul Gangwar <an...@citrix.com>
Authored: Tue Jun 10 16:43:40 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Fri Jun 13 12:40:29 2014 +0200

----------------------------------------------------------------------
 ui/scripts/storage.js | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2c5f352e/ui/scripts/storage.js
----------------------------------------------------------------------
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index 2660aa5..74d0201 100644
--- a/ui/scripts/storage.js
+++ b/ui/scripts/storage.js
@@ -306,6 +306,10 @@
                                                 description: 'VHD'
                                             });
                                             items.push({
+                                                id: 'VHDX',
+                                                description: 'VHDX'
+                                            });
+                                            items.push({
                                                 id: 'OVA',
                                                 description: 'OVA'
                                             });