From e5461835488aa5356a592c6fdcc1ef29982ea3b7 Mon Sep 17 00:00:00 2001 From: Kelven Yang Date: Fri, 22 Oct 2010 15:03:08 -0700 Subject: [PATCH 01/11] Fix deployVM problem currently in master branch --- server/src/com/cloud/api/commands/DeployVMCmd.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/com/cloud/api/commands/DeployVMCmd.java b/server/src/com/cloud/api/commands/DeployVMCmd.java index 565dfa693b4..818748f0ad2 100644 --- a/server/src/com/cloud/api/commands/DeployVMCmd.java +++ b/server/src/com/cloud/api/commands/DeployVMCmd.java @@ -40,7 +40,7 @@ import com.cloud.user.UserContext; import com.cloud.uservm.UserVm; import com.cloud.vm.InstanceGroupVO; -@Implementation(createMethod="createVirtualMachine", method="startVirtualMachine", manager=Manager.UserVmManager, description="Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.") +@Implementation(method="deployVirtualMachine", description="Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.") public class DeployVMCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeployVMCmd.class.getName()); From ecbb1030163dfc5f2ce16bcb01dc60f1141f6f18 Mon Sep 17 00:00:00 2001 From: Kris McQueen Date: Fri, 22 Oct 2010 14:07:19 -0700 Subject: [PATCH 02/11] bug 6675: return snapshotId as part of the createVolume response if a non-null snapshotId was passed in. This will represent the snapshot from which the volume was created. status 6675: resolved fixed --- .../src/com/cloud/api/commands/CreateVolumeCmd.java | 3 +++ server/src/com/cloud/api/response/VolumeResponse.java | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/server/src/com/cloud/api/commands/CreateVolumeCmd.java b/server/src/com/cloud/api/commands/CreateVolumeCmd.java index 31ec30f5c70..4cfb29a6139 100644 --- a/server/src/com/cloud/api/commands/CreateVolumeCmd.java +++ b/server/src/com/cloud/api/commands/CreateVolumeCmd.java @@ -163,6 +163,9 @@ public class CreateVolumeCmd extends BaseAsyncCreateCmd { if (volume.getPoolId() != null) { response.setStoragePoolName(ApiDBUtils.findStoragePoolById(volume.getPoolId()).getName()); } + + // if the volume was created from a snapshot, snapshotId will be set so we pass it back in the response + response.setSnapshotId(getSnapshotId()); response.setZoneId(volume.getDataCenterId()); response.setZoneName(ApiDBUtils.findZoneById(volume.getDataCenterId()).getName()); diff --git a/server/src/com/cloud/api/response/VolumeResponse.java b/server/src/com/cloud/api/response/VolumeResponse.java index 8a2099d380f..8d5b643da63 100644 --- a/server/src/com/cloud/api/response/VolumeResponse.java +++ b/server/src/com/cloud/api/response/VolumeResponse.java @@ -101,6 +101,9 @@ public class VolumeResponse extends BaseResponse { @SerializedName("storage") @Param(description="name of the primary storage hosting the disk volume") private String storagePoolName; + @SerializedName("snapshotid") @Param(description="ID of the snapshot from which this volume was created") + private Long snapshotId; + public Long getId() { return id; } @@ -308,4 +311,12 @@ public class VolumeResponse extends BaseResponse { public void setStoragePoolName(String storagePoolName) { this.storagePoolName = storagePoolName; } + + public Long getSnapshotId() { + return snapshotId; + } + + public void setSnapshotId(Long snapshotId) { + this.snapshotId = snapshotId; + } } From 109bdb18fe3e77ced4d3f0cbc837c23a6d0baf70 Mon Sep 17 00:00:00 2001 From: Kris McQueen Date: Fri, 22 Oct 2010 16:12:36 -0700 Subject: [PATCH 03/11] bug 6675: some fixes for creating volumes from snapshots - make sure size is set on the volume being created, either from the disk offering if a stand-along volume, or from the original volume size if from a snapshot - in createVolumeFromSnapshot, create a DiskProfile object that will set the size from the volume size rather than using the constructor that takes size from the disk offering - get zone for new volume from either the command properties or from the original vol (snapshot case) status 6675: resolved fixed --- .../com/cloud/storage/StorageManagerImpl.java | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index 8e4b680ab54..842e0330602 100755 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -73,7 +73,6 @@ import com.cloud.api.commands.PreparePrimaryStorageForMaintenanceCmd; import com.cloud.api.commands.UpdateStoragePoolCmd; import com.cloud.async.AsyncInstanceCreateStatus; import com.cloud.async.AsyncJobManager; -import com.cloud.async.executor.VolumeOperationParam.VolumeOp; import com.cloud.capacity.CapacityVO; import com.cloud.capacity.dao.CapacityDao; import com.cloud.configuration.Config; @@ -507,7 +506,7 @@ public class StorageManagerImpl implements StorageManager { @DB protected Pair createVolumeFromSnapshot(VolumeVO volume, SnapshotVO snapshot, VMTemplateVO template, long virtualsize) { VolumeVO createdVolume = null; - Long volumeId = null; + Long volumeId = volume.getId(); String volumeFolder = null; @@ -524,7 +523,7 @@ public class StorageManagerImpl implements StorageManager { DiskOfferingVO diskOffering = _diskOfferingDao.findById(volume.getDiskOfferingId()); DataCenterVO dc = _dcDao.findById(volume.getDataCenterId()); - DiskProfile dskCh = createDiskCharacteristics(volume, template, dc, diskOffering); + DiskProfile dskCh = new DiskProfile(volume, diskOffering, template.getHypervisorType()); int retry = 0; // Determine what pod to store the volume in @@ -624,7 +623,7 @@ public class StorageManagerImpl implements StorageManager { VolumeVO originalVolume = _volsDao.findById(origVolumeId); // NOTE: Original volume could be destroyed and removed. VMTemplateVO template = null; if (originalVolume != null) { - template = _templateDao.findById(originalVolume.getTemplateId()); + template = _templateDao.findById(originalVolume.getTemplateId()); } // everything went well till now @@ -1669,15 +1668,18 @@ public class StorageManagerImpl implements StorageManager { throw rae; } + Long zoneId = null; + Long diskOfferingId = null; + Long size = null; // validate input parameters before creating the volume if (cmd.getSnapshotId() == null) { - Long zoneId = cmd.getZoneId(); + zoneId = cmd.getZoneId(); if ((zoneId == null)) { throw new InvalidParameterValueException("Missing parameter, zoneid must be specified."); } - Long diskOfferingId = cmd.getDiskOfferingId(); - Long size = cmd.getSize(); + diskOfferingId = cmd.getDiskOfferingId(); + size = cmd.getSize(); if ((diskOfferingId == null) && (size == null)) { throw new InvalidParameterValueException("Missing parameter(s),either a positive volume size or a valid disk offering id must be specified."); } else if ((diskOfferingId == null) && (size != null)) { @@ -1696,6 +1698,7 @@ public class StorageManagerImpl implements StorageManager { if ((diskOffering == null) || !DiskOfferingVO.Type.Disk.equals(diskOffering.getType())) { throw new InvalidParameterValueException("Please specify a valid disk offering."); } + size = diskOffering.getDiskSize(); } } else { Long snapshotId = cmd.getSnapshotId(); @@ -1703,7 +1706,12 @@ public class StorageManagerImpl implements StorageManager { if (snapshotCheck == null) { throw new ServerApiException (BaseCmd.SNAPSHOT_INVALID_PARAM_ERROR, "unable to find a snapshot with id " + snapshotId); } - + + VolumeVO vol = _volsDao.findById(snapshotCheck.getVolumeId()); + zoneId = vol.getDataCenterId(); + diskOfferingId = vol.getDiskOfferingId(); + size = vol.getSize(); + if (account != null) { if (isAdmin(account.getType())) { Account snapshotOwner = _accountDao.findById(snapshotCheck.getAccountId()); @@ -1715,13 +1723,6 @@ public class StorageManagerImpl implements StorageManager { } } } - - Long zoneId = cmd.getZoneId(); - // Check that the zone is valid - DataCenterVO zone = _dcDao.findById(zoneId); - if (zone == null) { - throw new InvalidParameterValueException("Please specify a valid zone."); - } // Check that there is a shared primary storage pool in the specified zone List storagePools = _storagePoolDao.listByDataCenterId(zoneId); @@ -1754,7 +1755,8 @@ public class StorageManagerImpl implements StorageManager { volume.setAccountId(targetAccount.getId()); volume.setDomainId(((account == null) ? Domain.ROOT_DOMAIN : account.getDomainId())); volume.setMirrorState(MirrorState.NOT_MIRRORED); - volume.setDiskOfferingId(cmd.getDiskOfferingId()); + volume.setDiskOfferingId(diskOfferingId); + volume.setSize(size); volume.setStorageResourceType(StorageResourceType.STORAGE_POOL); volume.setInstanceId(null); volume.setUpdated(new Date()); From 19102c023dbac6301f579d232656aa2e0d842a2a Mon Sep 17 00:00:00 2001 From: will Date: Fri, 22 Oct 2010 16:24:41 -0700 Subject: [PATCH 04/11] Fixed 2.2 Dashboard - changed "totalCapacity" to "totalcapacity" in listCapacity response - Fixed percentUsed calculation to actually calculate the percentage used of each capacity resource --- .../com/cloud/api/commands/ListCapacityCmd.java | 7 +++++-- .../com/cloud/api/response/CapacityResponse.java | 2 +- ui/new/jsp/dashboard.jsp | 14 +++++++------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/server/src/com/cloud/api/commands/ListCapacityCmd.java b/server/src/com/cloud/api/commands/ListCapacityCmd.java index e2826cbb113..348318ad3ab 100644 --- a/server/src/com/cloud/api/commands/ListCapacityCmd.java +++ b/server/src/com/cloud/api/commands/ListCapacityCmd.java @@ -44,7 +44,7 @@ import com.cloud.storage.StoragePoolVO; public class ListCapacityCmd extends BaseListCmd { public static final Logger s_logger = Logger.getLogger(ListCapacityCmd.class.getName()); - private static final DecimalFormat s_percentFormat = new DecimalFormat("####.##"); + private static final DecimalFormat s_percentFormat = new DecimalFormat("##.##"); private static final String s_name = "listcapacityresponse"; @@ -120,12 +120,15 @@ public class ListCapacityCmd extends BaseListCmd { capacityResponse.setPodId(summedCapacity.getPodId()); if (summedCapacity.getPodId() > 0) { capacityResponse.setPodName(ApiDBUtils.findPodById(summedCapacity.getPodId()).getName()); + } else { + capacityResponse.setPodName("All"); } } capacityResponse.setZoneId(summedCapacity.getDataCenterId()); capacityResponse.setZoneName(ApiDBUtils.findZoneById(summedCapacity.getDataCenterId()).getName()); if (summedCapacity.getTotalCapacity() != 0) { - capacityResponse.setPercentUsed(s_percentFormat.format(summedCapacity.getUsedCapacity() / summedCapacity.getTotalCapacity())); + float computed = ((float)summedCapacity.getUsedCapacity() / (float)summedCapacity.getTotalCapacity() * 100f); + capacityResponse.setPercentUsed(s_percentFormat.format((float)summedCapacity.getUsedCapacity() / (float)summedCapacity.getTotalCapacity() * 100f)); } else { capacityResponse.setPercentUsed(s_percentFormat.format(0L)); } diff --git a/server/src/com/cloud/api/response/CapacityResponse.java b/server/src/com/cloud/api/response/CapacityResponse.java index 560fb88cda1..4cb5ca5f300 100644 --- a/server/src/com/cloud/api/response/CapacityResponse.java +++ b/server/src/com/cloud/api/response/CapacityResponse.java @@ -39,7 +39,7 @@ public class CapacityResponse extends BaseResponse { @SerializedName("capacityused") @Param(description="the capacity currently in use") private Long capacityUsed; - @SerializedName("capacityTotal") @Param(description="the total capacity available") + @SerializedName("capacitytotal") @Param(description="the total capacity available") private Long capacityTotal; @SerializedName("percentused") @Param(description="the percentage of capacity currently in use") diff --git a/ui/new/jsp/dashboard.jsp b/ui/new/jsp/dashboard.jsp index d920723080e..c0269943858 100644 --- a/ui/new/jsp/dashboard.jsp +++ b/ui/new/jsp/dashboard.jsp @@ -47,7 +47,7 @@
-
+
@@ -68,7 +68,7 @@
-
+
@@ -89,7 +89,7 @@
-
+
@@ -110,7 +110,7 @@
-
+
@@ -131,7 +131,7 @@
-
+
@@ -152,7 +152,7 @@
-
+
@@ -173,7 +173,7 @@
-
+
From 57a299fb46a2176657c8344697b0b7ad0c549d0d Mon Sep 17 00:00:00 2001 From: Kris McQueen Date: Fri, 22 Oct 2010 16:24:54 -0700 Subject: [PATCH 05/11] bug 6678: return the VM as part of the rebootVirtualMachine implementation, serialize the VM for the API response. In 2.1.x the VM was serialized, but during refactoring for the 2.2 API framework that was changed to a SuccessResponse, but now backwards compatibility is preserved. status 6678: resolved fixed --- .../com/cloud/api/commands/RebootVMCmd.java | 108 +++++++++++++++++- .../src/com/cloud/vm/UserVmManagerImpl.java | 13 +-- server/src/com/cloud/vm/UserVmService.java | 2 +- 3 files changed, 109 insertions(+), 14 deletions(-) diff --git a/server/src/com/cloud/api/commands/RebootVMCmd.java b/server/src/com/cloud/api/commands/RebootVMCmd.java index 0d6bfc283a2..25f537db263 100644 --- a/server/src/com/cloud/api/commands/RebootVMCmd.java +++ b/server/src/com/cloud/api/commands/RebootVMCmd.java @@ -21,13 +21,19 @@ import org.apache.log4j.Logger; import com.cloud.api.ApiDBUtils; import com.cloud.api.BaseAsyncCmd; +import com.cloud.api.BaseCmd; import com.cloud.api.BaseCmd.Manager; import com.cloud.api.Implementation; import com.cloud.api.Parameter; -import com.cloud.api.response.SuccessResponse; +import com.cloud.api.response.UserVmResponse; import com.cloud.event.EventTypes; +import com.cloud.offering.ServiceOffering; +import com.cloud.storage.StoragePoolVO; +import com.cloud.storage.VMTemplateVO; +import com.cloud.storage.VolumeVO; import com.cloud.user.Account; import com.cloud.uservm.UserVm; +import com.cloud.vm.InstanceGroupVO; @Implementation(method="rebootVirtualMachine", manager=Manager.UserVmManager, description="Reboots a virtual machine.") public class RebootVMCmd extends BaseAsyncCmd { @@ -79,10 +85,102 @@ public class RebootVMCmd extends BaseAsyncCmd { } @Override @SuppressWarnings("unchecked") - public SuccessResponse getResponse() { - Boolean success = (Boolean)getResponseObject(); - SuccessResponse response = new SuccessResponse(); - response.setSuccess(success); + public UserVmResponse getResponse() { + UserVm vm = (UserVm)getResponseObject(); + + UserVmResponse response = new UserVmResponse(); + response.setId(vm.getId()); + response.setName(vm.getName()); + response.setCreated(vm.getCreated()); + response.setZoneId(vm.getDataCenterId()); + response.setZoneName(ApiDBUtils.findZoneById(vm.getDataCenterId()).getName()); + response.setIpAddress(vm.getPrivateIpAddress()); + response.setServiceOfferingId(vm.getServiceOfferingId()); + response.setHaEnable(vm.isHaEnabled()); + if (vm.getDisplayName() == null || vm.getDisplayName().length() == 0) { + response.setDisplayName(vm.getName()); + } else { + response.setDisplayName(vm.getDisplayName()); + } + + InstanceGroupVO group = ApiDBUtils.findInstanceGroupForVM(vm.getId()); + if (group != null) { + response.setGroup(group.getName()); + response.setGroupId(group.getId()); + } + + if (vm.getState() != null) { + response.setState(vm.getState().toString()); + } + + Account acct = ApiDBUtils.findAccountById(vm.getAccountId()); + if (acct != null) { + response.setAccountName(acct.getAccountName()); + response.setDomainId(acct.getDomainId()); + response.setDomainName(ApiDBUtils.findDomainById(acct.getDomainId()).getName()); + } + + if (BaseCmd.isAdmin(acct.getType()) && (vm.getHostId() != null)) { + response.setHostName(ApiDBUtils.findHostById(vm.getHostId()).getName()); + response.setHostId(vm.getHostId()); + } + + String templateName = "ISO Boot"; + boolean templatePasswordEnabled = false; + String templateDisplayText = "ISO Boot"; + + VMTemplateVO template = ApiDBUtils.findTemplateById(vm.getTemplateId()); + if (template != null) { + templateName = template.getName(); + templatePasswordEnabled = template.getEnablePassword(); + templateDisplayText = template.getDisplayText(); + if (templateDisplayText == null) { + templateDisplayText = templateName; + } + } + + response.setTemplateId(vm.getTemplateId()); + response.setTemplateName(templateName); + response.setTemplateDisplayText(templateDisplayText); + response.setPasswordEnabled(templatePasswordEnabled); + if (templatePasswordEnabled) { + response.setPassword(null); // FIXME: Where should password come from? In the old framework, password was always passed + // in to composeResultObject() as null, so that behavior is preserved... + } else { + response.setPassword(""); + } + + String isoName = null; + if (vm.getIsoId() != null) { + VMTemplateVO iso = ApiDBUtils.findTemplateById(vm.getIsoId().longValue()); + if (iso != null) { + isoName = iso.getName(); + } + } + + response.setIsoId(vm.getIsoId()); + response.setIsoName(isoName); + + ServiceOffering offering = ApiDBUtils.findServiceOfferingById(vm.getServiceOfferingId()); + response.setServiceOfferingId(vm.getServiceOfferingId()); + response.setServiceOfferingName(offering.getName()); + + response.setCpuNumber(offering.getCpu()); + response.setCpuSpeed(offering.getSpeed()); + response.setMemory(offering.getRamSize()); + + VolumeVO rootVolume = ApiDBUtils.findRootVolume(vm.getId()); + if (rootVolume != null) { + response.setRootDeviceId(rootVolume.getDeviceId()); + StoragePoolVO storagePool = ApiDBUtils.findStoragePoolById(rootVolume.getPoolId()); + response.setRootDeviceType(storagePool.getPoolType().toString()); + } + + response.setGuestOsId(vm.getGuestOSId()); + + //Network groups + response.setNetworkGroupList(ApiDBUtils.getNetworkGroupsNamesForVm(vm.getId())); + response.setResponseName(getName()); return response; } diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index f8e3ca732e0..d01fba559ce 100644 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -3512,7 +3512,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService { } @Override - public boolean rebootVirtualMachine(RebootVMCmd cmd) { + public UserVm rebootVirtualMachine(RebootVMCmd cmd) { Account account = UserContext.current().getAccount(); Long userId = UserContext.current().getUserId(); Long vmId = cmd.getId(); @@ -3529,15 +3529,12 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService { boolean status = rebootVirtualMachine(userId, vmId); - if(status) - { + if (status) { EventUtils.saveEvent(userId, vmInstance.getAccountId(), EventTypes.EVENT_VM_REBOOT, "Successfully rebooted vm with id:"+vmId); - return status; - } - else - { + return _vmDao.findById(vmId); + } else { EventUtils.saveEvent(userId, vmInstance.getAccountId(), EventTypes.EVENT_VM_REBOOT, "Failed to reboot vm with id:"+vmId); - return status; + throw new CloudRuntimeException("Failed to reboot vm with id: " + vmId); } } diff --git a/server/src/com/cloud/vm/UserVmService.java b/server/src/com/cloud/vm/UserVmService.java index eac0b62a985..a3d9072f597 100644 --- a/server/src/com/cloud/vm/UserVmService.java +++ b/server/src/com/cloud/vm/UserVmService.java @@ -81,7 +81,7 @@ public interface UserVmService extends Manager { UserVmVO startVirtualMachine(StartVMCmd cmd) throws StorageUnavailableException, ExecutionException, ConcurrentOperationException; UserVmVO stopVirtualMachine(StopVMCmd cmd) throws ServerApiException; - boolean rebootVirtualMachine(RebootVMCmd cmd); + UserVm rebootVirtualMachine(RebootVMCmd cmd); @Deprecated OperationResponse executeRebootVM(RebootVMExecutor executor, VMOperationParam param); From eccab6880f0ff593be661ae7b2bb633ef1969e2b Mon Sep 17 00:00:00 2001 From: NIKITA Date: Fri, 22 Oct 2010 16:30:28 -0700 Subject: [PATCH 06/11] Loading added for Dialog boxes --- ui/new/css/main.css | 75 +++++++++++++++++++++++++++++++++ ui/new/images/cross_review.png | Bin 0 -> 1099 bytes ui/new/jsp/resource.jsp | 13 ++++++ 3 files changed, 88 insertions(+) create mode 100644 ui/new/images/cross_review.png diff --git a/ui/new/css/main.css b/ui/new/css/main.css index b1c2a5547f9..e202725cc32 100644 --- a/ui/new/css/main.css +++ b/ui/new/css/main.css @@ -3909,3 +3909,78 @@ a:hover.search_button { .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: -0.2em 1em .5em .4em; } .ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: -0.2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } + + +.ui_dialog_loaderbox{ + width:250px; + height:auto; + float:left; + background:#FFF repeat top left; + border:1px solid #CCC; + margin:10px 0 0 0; + padding:0 10px 5px 0; +} + +.ui_dialog_loader { + width:16px; + height:16px; + float:left; + background:url(../images/mid_default.gif) no-repeat top left; + margin:5px 0 0 7px; + display:inline; + padding:0; +} + +.ui_dialog_loaderbox p{ + width:auto; + height:auto; + float:left; + color:#333; + font-size:12px; + font-weight:normal; + margin:7px 0 0 10px; + padding:0; +} + +.ui_dialog_messagebox{ + width:250px; + height:auto; + float:left; + background:#fff7e3 repeat top left; + border:1px solid #CCC; + margin:10px 0 0 0; + padding:0 10px 5px 0; +} + +.ui_dialog_messagebox.error{ + background:#ffe5e5 repeat top left; +} + +.ui_dialog_msgicon { + width:18px; + height:20px; + float:left; + background:url(../images/tick_review.png) no-repeat top left; + margin:5px 0 0 7px; + display:inline; + padding:0; +} + +.ui_dialog_msgicon.error { + background:url(../images/cross_review.png) no-repeat top left; +} +.ui_dialog_messagebox_text{ + width:auto; + height:auto; + float:left; + color:#333; + font-size:11px; + font-weight:normal; + margin:10px 0 0 10px; + padding:0; +} + +.ui_dialog_messagebox_text.error{ + + color:#ae0000; +} \ No newline at end of file diff --git a/ui/new/images/cross_review.png b/ui/new/images/cross_review.png new file mode 100644 index 0000000000000000000000000000000000000000..ba95024d76a9f4fe1100ec8750a7f2e82533c12e GIT binary patch literal 1099 zcmV-R1ho5!P)Mh#wOQ{=+%n z-*Ym8Xn+7>gehbBGPnI5`;YhhEMHGtJO1_khsOW`1eW@9YRiAd=l2-@ODOzjG52Ex z3x2UN{LdsJ%)oU20RzXyJB$DU#E5Jc*swoW4+$~;`J2x0|KFwm%&aVozqTx3_;>BZ ze`aQ8kOE$ocU$)7^B+CT@aNw@hF>0DYZ#wQ>|kL2{fB`W=&nDPFE9WE5Qd@H01Jrt zwX*yE@85qEIDY+LU=R@4&G7A;>)#LW8JPG57+7L!7{Q9({}oYWzkI%%>EQknMrk2e zMn*=4-;O?KIbJ_7fd|BAXNy%FFJFf;{Q1T3mxYCqk(uQUvC>aGts02v#(I z{(Ndi4L)W&fCkc$pY^I2itX`@`^U z)uuXu#cc?OGtQm-pOuA$>HC-O4F8|LWng;!mVw3E^!Z0MS1Gt6-s5K&IDh_PVAe4x z|7quJ&hqyk11~cR1LL7RTyX22W@hm*Ub&LasifS)`0qc%3vWNi|1Y1M=j7q}2)1e7 zym`VvS_6tjf%r8L-vD7?Xukz10tiq^)q}JZMd9z>`+UBbSAWtUixn!EA|leHY10la zf{0x@b?M};n}UdfMI3^&5hs@lrI4XRsjEXrccDWObSSM7HOb3M-n%!~bB!Vo9O8uo zhs!zNJ?FdMIV~~XGU4XPgI_=_-l6T-0$2J3rQ#+|kAVw%Jl;j0&=1zrI}Y34;M`hQ zm5UutisFMQL@JVd-@c++`ouVcrT|hDAlh=Mo-MIh*GG!lK~Q&?455`I)_Qy-o=%JO zL?HrH|GxDm;Py{_^!u?>uYhwRnE)FKXlMmXa7e~+HD0=*x$7?LN+oB_<)ebr5Bv75 z=fh9hhTcxr{>!i)*pPl`u$svx=ClNzNN&=VYe4Sg=@&CIGpu*`(Af0ex4FP^5-}Cx2=sPsr3+?5;;iZ(6m7myyS~5aq{njQz}2x zqS=6;6iE+xuhJ`z3cG8O)`~AjoZx}GYgc_3LW4|pUR#2(Om?Q-^ZLtE@5h*B6>Z-~ z;JSO~@3P%Gm062aMB{CfZzLKwD!%p|H0e=hlaf`*%4FWPFG-AzdrfyM=MsK(pmPt3 R58eO(002ovPDHLkV1j90Ar$}s literal 0 HcmV?d00001 diff --git a/ui/new/jsp/resource.jsp b/ui/new/jsp/resource.jsp index 12394990de3..3273c39625a 100644 --- a/ui/new/jsp/resource.jsp +++ b/ui/new/jsp/resource.jsp @@ -705,6 +705,7 @@ From a5dd8a5bc7e8c34c2e2e0f490e35698a05ba9349 Mon Sep 17 00:00:00 2001 From: Kris McQueen Date: Fri, 22 Oct 2010 16:53:49 -0700 Subject: [PATCH 07/11] bug 6684: return 'attached' parameter as part of listVolumes response. For the diskOffering information looking like service offering information, this is because the diskOffering on the root volume is set to be the service offering of the VM. If this is a change from 2.1.x please re-open this bug, but for the time being I'm going to assume this is working as expected. status 6684: resolved fixed --- server/src/com/cloud/api/commands/ListVolumesCmd.java | 1 + server/src/com/cloud/api/response/VolumeResponse.java | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/server/src/com/cloud/api/commands/ListVolumesCmd.java b/server/src/com/cloud/api/commands/ListVolumesCmd.java index 12f6bbb2493..44f55c1c21f 100755 --- a/server/src/com/cloud/api/commands/ListVolumesCmd.java +++ b/server/src/com/cloud/api/commands/ListVolumesCmd.java @@ -206,6 +206,7 @@ public class ListVolumesCmd extends BaseListCmd { volResponse.setSourceType(volume.getSourceType().toString()); } volResponse.setHypervisor(ApiDBUtils.getVolumeHyperType(volume.getId()).toString()); + volResponse.setAttached(volume.getAttached()); volResponse.setResponseName("volume"); volResponses.add(volResponse); diff --git a/server/src/com/cloud/api/response/VolumeResponse.java b/server/src/com/cloud/api/response/VolumeResponse.java index 8d5b643da63..36ffd97513a 100644 --- a/server/src/com/cloud/api/response/VolumeResponse.java +++ b/server/src/com/cloud/api/response/VolumeResponse.java @@ -104,6 +104,9 @@ public class VolumeResponse extends BaseResponse { @SerializedName("snapshotid") @Param(description="ID of the snapshot from which this volume was created") private Long snapshotId; + @SerializedName("attached") @Param(description="the date the volume was attached to a VM instance") + private Date attached; + public Long getId() { return id; } @@ -319,4 +322,12 @@ public class VolumeResponse extends BaseResponse { public void setSnapshotId(Long snapshotId) { this.snapshotId = snapshotId; } + + public Date getAttached() { + return attached; + } + + public void setAttached(Date attached) { + this.attached = attached; + } } From c7385bd095a59d0bfed1383bc7d95e48617585c2 Mon Sep 17 00:00:00 2001 From: will Date: Fri, 22 Oct 2010 17:43:21 -0700 Subject: [PATCH 08/11] Fixed up the Help Section in 2.2 UI --- ui/new/css/main.css | 7 +++++-- ui/new/index.jsp | 22 +++++++++++----------- ui/new/scripts/cloud.core2.init.js | 2 ++ ui/new/scripts/cloud.core2.js | 4 ++++ 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/ui/new/css/main.css b/ui/new/css/main.css index b1c2a5547f9..a0acbbddea2 100644 --- a/ui/new/css/main.css +++ b/ui/new/css/main.css @@ -1810,7 +1810,10 @@ a:hover.search_button { .actionpanel_button:hover{ background:url(../images/actionpanel_hover.gif) repeat-x top right; - +} + +.actionpanel_button.selected{ + background:url(../images/actionpanel_hover.gif) repeat-x top right; } .action_ddarrow { @@ -1865,7 +1868,7 @@ a:hover.search_button { position:absolute; background:#FFF repeat top left; border:1px solid #999; - top:20px; + top:65px; right:7px; margin:0; padding:0; diff --git a/ui/new/index.jsp b/ui/new/index.jsp index 9833a974946..db7fc17d54a 100644 --- a/ui/new/index.jsp +++ b/ui/new/index.jsp @@ -259,39 +259,39 @@ long milliseconds = new Date().getTime();
diff --git a/ui/new/scripts/cloud.core2.init.js b/ui/new/scripts/cloud.core2.init.js index 380a2542754..db0d56150f1 100644 --- a/ui/new/scripts/cloud.core2.init.js +++ b/ui/new/scripts/cloud.core2.init.js @@ -169,11 +169,13 @@ $(document).ready(function() { // Initialize help drop down dialog $("#help_link").bind("click", function(event) { $("#help_dropdown_dialog").show(); + $("#help_button").addClass("selected"); return false; }); $("#help_dropdown_close").bind("click", function(event) { $("#help_dropdown_dialog").hide(); + $("#help_button").removeClass("selected"); return false; }); diff --git a/ui/new/scripts/cloud.core2.js b/ui/new/scripts/cloud.core2.js index 9f039f6d1e8..4961c2704a9 100644 --- a/ui/new/scripts/cloud.core2.js +++ b/ui/new/scripts/cloud.core2.js @@ -517,6 +517,10 @@ function selectLeftMenu($menuToSelect, expandable) { $menuToExpand.slideDown(500); } $expandedLeftMenu = $menuToExpand; + + // Close the help link if it's opened + $("#help_dropdown_dialog").hide(); + $("#help_button").removeClass("selected"); } } From 51f2ce0e8645dfc588c6f2e81fa82e17c7158afb Mon Sep 17 00:00:00 2001 From: Kris McQueen Date: Fri, 22 Oct 2010 18:05:53 -0700 Subject: [PATCH 09/11] bug 6690: if the exception is one that we are handling (reporting information about bad API parameters, for example) don't log the exception. If we aren't handling it, *then* we should log the exception. status 6690: resolved fixed --- server/src/com/cloud/api/ApiDispatcher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/com/cloud/api/ApiDispatcher.java b/server/src/com/cloud/api/ApiDispatcher.java index 326191b9b3a..12e45a8df8a 100644 --- a/server/src/com/cloud/api/ApiDispatcher.java +++ b/server/src/com/cloud/api/ApiDispatcher.java @@ -224,12 +224,12 @@ public class ApiDispatcher { if (cause instanceof AsyncCommandQueued) { throw (AsyncCommandQueued)cause; } - s_logger.warn("Exception executing method " + methodName + " for command " + cmd.getClass().getSimpleName(), ite); if (cause instanceof InvalidParameterValueException) { throw new ServerApiException(BaseCmd.PARAM_ERROR, cause.getMessage()); } else if (cause instanceof PermissionDeniedException) { throw new ServerApiException(BaseCmd.ACCOUNT_ERROR, cause.getMessage()); } + s_logger.warn("Exception executing method " + methodName + " for command " + cmd.getClass().getSimpleName(), ite); throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Unable to execute method " + methodName + " for command " + cmd.getClass().getSimpleName() + ", internal error in the implementation."); } catch (IllegalAccessException iae) { s_logger.warn("Exception executing method " + methodName + " for command " + cmd.getClass().getSimpleName(), iae); From 05f1c1b454346bf74a6c3ffa50948cb9d4eb69ca Mon Sep 17 00:00:00 2001 From: will Date: Fri, 22 Oct 2010 19:32:26 -0700 Subject: [PATCH 10/11] Removed version from the cloud.com javascript files --- ui/new/scripts/cloud.core2.account.js | 2 -- ui/new/scripts/cloud.core2.alert.js | 2 -- ui/new/scripts/cloud.core2.callbacks.js | 2 -- ui/new/scripts/cloud.core2.dashboard.js | 2 -- ui/new/scripts/cloud.core2.diskoffering.js | 2 -- ui/new/scripts/cloud.core2.domain.js | 2 -- ui/new/scripts/cloud.core2.event.js | 2 -- ui/new/scripts/cloud.core2.globalsetting.js | 2 -- ui/new/scripts/cloud.core2.instance.js | 2 -- ui/new/scripts/cloud.core2.ipaddress.js | 2 -- ui/new/scripts/cloud.core2.iso.js | 2 -- ui/new/scripts/cloud.core2.resource.js | 2 -- ui/new/scripts/cloud.core2.router.js | 2 -- ui/new/scripts/cloud.core2.serviceoffering.js | 2 -- ui/new/scripts/cloud.core2.snapshot.js | 2 -- ui/new/scripts/cloud.core2.template.js | 2 -- ui/new/scripts/cloud.core2.volume.js | 2 -- 17 files changed, 34 deletions(-) diff --git a/ui/new/scripts/cloud.core2.account.js b/ui/new/scripts/cloud.core2.account.js index 42ba6480fdf..cccb014f3ac 100644 --- a/ui/new/scripts/cloud.core2.account.js +++ b/ui/new/scripts/cloud.core2.account.js @@ -16,8 +16,6 @@ * */ -// Version: @VERSION@ - var systemAccountId = 1; var adminAccountId = 2; diff --git a/ui/new/scripts/cloud.core2.alert.js b/ui/new/scripts/cloud.core2.alert.js index 81b68a9ba08..b133bfc381b 100644 --- a/ui/new/scripts/cloud.core2.alert.js +++ b/ui/new/scripts/cloud.core2.alert.js @@ -16,8 +16,6 @@ * */ -// Version: @VERSION@ - function afterLoadAlertJSP() { } diff --git a/ui/new/scripts/cloud.core2.callbacks.js b/ui/new/scripts/cloud.core2.callbacks.js index a97bf969d48..74b9acecc7e 100644 --- a/ui/new/scripts/cloud.core2.callbacks.js +++ b/ui/new/scripts/cloud.core2.callbacks.js @@ -16,8 +16,6 @@ * */ -// Version: @VERSION@ - /* This file is meant to help with implementing single signon integration. If you are using the cloud.com default UI, there is no need to touch this file. diff --git a/ui/new/scripts/cloud.core2.dashboard.js b/ui/new/scripts/cloud.core2.dashboard.js index 572a0f37882..2f9fb452eb0 100644 --- a/ui/new/scripts/cloud.core2.dashboard.js +++ b/ui/new/scripts/cloud.core2.dashboard.js @@ -16,8 +16,6 @@ * */ -// Version: @VERSION@ - function afterLoadDashboardJSP() { var $alertTemplate = $("#alert_template"); diff --git a/ui/new/scripts/cloud.core2.diskoffering.js b/ui/new/scripts/cloud.core2.diskoffering.js index 9c0c14e8ffd..ef31b61f7a0 100644 --- a/ui/new/scripts/cloud.core2.diskoffering.js +++ b/ui/new/scripts/cloud.core2.diskoffering.js @@ -16,8 +16,6 @@ * */ -// Version: @VERSION@ - function afterLoadDiskOfferingJSP() { var $detailsTab = $("#right_panel_content #tab_content_details"); diff --git a/ui/new/scripts/cloud.core2.domain.js b/ui/new/scripts/cloud.core2.domain.js index d6ac08d9685..f6b4ba726ea 100644 --- a/ui/new/scripts/cloud.core2.domain.js +++ b/ui/new/scripts/cloud.core2.domain.js @@ -16,8 +16,6 @@ * */ -// Version: @VERSION@ - var $selectedDomainTreeNode; var defaultRootLevel = 0; var childParentMap = {}; //map childDomainId to parentDomainId diff --git a/ui/new/scripts/cloud.core2.event.js b/ui/new/scripts/cloud.core2.event.js index dd411731d26..05a69ac0303 100644 --- a/ui/new/scripts/cloud.core2.event.js +++ b/ui/new/scripts/cloud.core2.event.js @@ -16,8 +16,6 @@ * */ -// Version: @VERSION@ - function afterLoadEventJSP() { } diff --git a/ui/new/scripts/cloud.core2.globalsetting.js b/ui/new/scripts/cloud.core2.globalsetting.js index fe001d338bb..731898437fa 100644 --- a/ui/new/scripts/cloud.core2.globalsetting.js +++ b/ui/new/scripts/cloud.core2.globalsetting.js @@ -16,8 +16,6 @@ * */ -// Version: @VERSION@ - function afterLoadGlobalSettingJSP() { var $detailsTab = $("#right_panel_content #tab_content_details"); diff --git a/ui/new/scripts/cloud.core2.instance.js b/ui/new/scripts/cloud.core2.instance.js index f778fe1fa6b..bf53a6f0bbd 100644 --- a/ui/new/scripts/cloud.core2.instance.js +++ b/ui/new/scripts/cloud.core2.instance.js @@ -16,8 +16,6 @@ * */ -// Version: @VERSION@ - function clickInstanceGroupHeader($arrowIcon) { $("#midmenu_add_link").find("#label").text("Add VM"); $("#midmenu_add_link").show(); diff --git a/ui/new/scripts/cloud.core2.ipaddress.js b/ui/new/scripts/cloud.core2.ipaddress.js index 7a89469d3c3..a3c8603a3cb 100644 --- a/ui/new/scripts/cloud.core2.ipaddress.js +++ b/ui/new/scripts/cloud.core2.ipaddress.js @@ -16,8 +16,6 @@ * */ -// Version: @VERSION@ - function afterLoadIpJSP() { //***** switch between different tabs (begin) ******************************************************************** var tabArray = [$("#tab_details"), $("#tab_port_forwarding"), $("#tab_load_balancer")]; diff --git a/ui/new/scripts/cloud.core2.iso.js b/ui/new/scripts/cloud.core2.iso.js index e7ffe19082a..4d63b077570 100644 --- a/ui/new/scripts/cloud.core2.iso.js +++ b/ui/new/scripts/cloud.core2.iso.js @@ -16,8 +16,6 @@ * */ -// Version: @VERSION@ - var g_zoneIds = []; var g_zoneNames = []; diff --git a/ui/new/scripts/cloud.core2.resource.js b/ui/new/scripts/cloud.core2.resource.js index 4896752ba3c..6f221bc1b49 100644 --- a/ui/new/scripts/cloud.core2.resource.js +++ b/ui/new/scripts/cloud.core2.resource.js @@ -16,8 +16,6 @@ * */ -// Version: @VERSION@ - function buildZoneTree() { //***** build zone tree (begin) *********************************************************************************************** var forceLogout = true; // We force a logout only if the user has first added a POD for the very first time diff --git a/ui/new/scripts/cloud.core2.router.js b/ui/new/scripts/cloud.core2.router.js index 5a0f28998c6..7ff9e22aee8 100644 --- a/ui/new/scripts/cloud.core2.router.js +++ b/ui/new/scripts/cloud.core2.router.js @@ -16,8 +16,6 @@ * */ -// Version: @VERSION@ - function afterLoadRouterJSP() { } diff --git a/ui/new/scripts/cloud.core2.serviceoffering.js b/ui/new/scripts/cloud.core2.serviceoffering.js index d3cc70b0506..157cecb3f03 100644 --- a/ui/new/scripts/cloud.core2.serviceoffering.js +++ b/ui/new/scripts/cloud.core2.serviceoffering.js @@ -16,8 +16,6 @@ * */ -// Version: @VERSION@ - function afterLoadServiceOfferingJSP() { var $detailsTab = $("#right_panel_content #tab_content_details"); diff --git a/ui/new/scripts/cloud.core2.snapshot.js b/ui/new/scripts/cloud.core2.snapshot.js index 83e95641888..1cc19884d22 100644 --- a/ui/new/scripts/cloud.core2.snapshot.js +++ b/ui/new/scripts/cloud.core2.snapshot.js @@ -16,8 +16,6 @@ * */ -// Version: @VERSION@ - function afterLoadSnapshotJSP() { //initialize dialog activateDialog($("#dialog_add_volume_from_snapshot").dialog({ diff --git a/ui/new/scripts/cloud.core2.template.js b/ui/new/scripts/cloud.core2.template.js index 60156687361..a2d5795faf3 100644 --- a/ui/new/scripts/cloud.core2.template.js +++ b/ui/new/scripts/cloud.core2.template.js @@ -16,8 +16,6 @@ * */ -// Version: @VERSION@ - var g_zoneIds = []; var g_zoneNames = []; diff --git a/ui/new/scripts/cloud.core2.volume.js b/ui/new/scripts/cloud.core2.volume.js index 17171bd0eaf..d00a2cad61a 100644 --- a/ui/new/scripts/cloud.core2.volume.js +++ b/ui/new/scripts/cloud.core2.volume.js @@ -16,8 +16,6 @@ * */ -// Version: @VERSION@ - function afterLoadVolumeJSP() { activateDialog($("#dialog_create_template").dialog({ width: 400, From fd02b7bd4319662a835435a8ab33d5a7826f9a74 Mon Sep 17 00:00:00 2001 From: will Date: Fri, 22 Oct 2010 19:34:34 -0700 Subject: [PATCH 11/11] Removing legacy login.html. It has already been integrated. --- ui/new/login.html | 63 ----------------------------------------------- 1 file changed, 63 deletions(-) delete mode 100755 ui/new/login.html diff --git a/ui/new/login.html b/ui/new/login.html deleted file mode 100755 index 3592ecc8679..00000000000 --- a/ui/new/login.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - -Untitled Document - - - - -
- -
- -