cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [3/4] git commit: updated refs/heads/4.6 to 8c78f89
Date Sat, 12 Dec 2015 13:39:26 GMT
CLOUDSTACK-4787: Allow users to select disk controller for VM/template

- Adds new controller types in the UI, for selecting root disk controller while
  registering templates
- Fixes bug to not override disk controller type if provided in the details (either
  vm details or from template details)

(cherry picked from commit c7d67628b3ff86802a1ac3b58e0bc05d54afd543)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


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

Branch: refs/heads/4.6
Commit: a15187a57a68b3240c5c4a6a6ca9648eb0608206
Parents: 6a9956e
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Fri Nov 27 18:30:00 2015 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Fri Nov 27 18:52:02 2015 +0530

----------------------------------------------------------------------
 .../storage/command/AttachCommand.java          |  1 -
 server/src/com/cloud/configuration/Config.java  |  2 +-
 server/src/com/cloud/vm/UserVmManagerImpl.java  | 15 ++++++++++-----
 ui/scripts/templates.js                         | 20 ++++++++++++++++++++
 4 files changed, 31 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a15187a5/core/src/org/apache/cloudstack/storage/command/AttachCommand.java
----------------------------------------------------------------------
diff --git a/core/src/org/apache/cloudstack/storage/command/AttachCommand.java b/core/src/org/apache/cloudstack/storage/command/AttachCommand.java
index 1f11352..d15a4e4 100644
--- a/core/src/org/apache/cloudstack/storage/command/AttachCommand.java
+++ b/core/src/org/apache/cloudstack/storage/command/AttachCommand.java
@@ -21,7 +21,6 @@ package org.apache.cloudstack.storage.command;
 
 import java.util.Map;
 
-import com.cloud.agent.api.Command;
 import com.cloud.agent.api.to.DiskTO;
 
 public final class AttachCommand extends StorageSubSystemCommand {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a15187a5/server/src/com/cloud/configuration/Config.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java
index 182ec50..0acc5e6 100644
--- a/server/src/com/cloud/configuration/Config.java
+++ b/server/src/com/cloud/configuration/Config.java
@@ -1219,7 +1219,7 @@ public enum Config {
             String.class,
             "vmware.root.disk.controller",
             "ide",
-            "Specify the default disk controller for root volumes, valid values are scsi,
ide",
+            "Specify the default disk controller for root volumes, valid values are scsi,
ide, osdefault. Please check documentation for more details on each of these values.",
             null),
     VmwareSystemVmNicDeviceType(
             "Advanced",

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a15187a5/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index 3f068af..c541ba3 100644
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -3376,11 +3376,16 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
                         s_logger.info("guestOS is OSX : overwrite root disk controller to
scsi, use smc and efi");
                     } else {
                         String controllerSetting = _configDao.getValue("vmware.root.disk.controller");
-                        vm.setDetail(VmDetailConstants.ROOK_DISK_CONTROLLER, controllerSetting);
-                        if (controllerSetting.equalsIgnoreCase("scsi")) {
-                            vm.setDetail(VmDetailConstants.DATA_DISK_CONTROLLER, "scsi");
-                        } else {
-                            vm.setDetail(VmDetailConstants.DATA_DISK_CONTROLLER, "osdefault");
+                        // Don't override if VM already has root/data disk controller detail
+                        if (vm.getDetail(VmDetailConstants.ROOK_DISK_CONTROLLER) == null)
{
+                            vm.setDetail(VmDetailConstants.ROOK_DISK_CONTROLLER, controllerSetting);
+                        }
+                        if (vm.getDetail(VmDetailConstants.DATA_DISK_CONTROLLER) == null)
{
+                            if (controllerSetting.equalsIgnoreCase("scsi")) {
+                                vm.setDetail(VmDetailConstants.DATA_DISK_CONTROLLER, "scsi");
+                            } else {
+                                vm.setDetail(VmDetailConstants.DATA_DISK_CONTROLLER, "osdefault");
+                            }
                         }
                     }
                 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a15187a5/ui/scripts/templates.js
----------------------------------------------------------------------
diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js
index ac739c6..c8c5b89 100644
--- a/ui/scripts/templates.js
+++ b/ui/scripts/templates.js
@@ -281,6 +281,26 @@
                                                 id: "ide",
                                                 description: "ide"
                                             });
+                                            items.push({
+                                                id: "osdefault",
+                                                description: "osdefault"
+                                            });
+                                            items.push({
+                                                id: "pvscsi",
+                                                description: "pvscsi"
+                                            });
+                                            items.push({
+                                                id: "lsilogic",
+                                                description: "lsilogic"
+                                            });
+                                            items.push({
+                                                id: "lsisas1068",
+                                                description: "lsilogicsas"
+                                            });
+                                            items.push({
+                                                id: "buslogic",
+                                                description: "buslogic"
+                                            });
                                             args.response.success({
                                                 data: items
                                             });


Mime
View raw message