From 34948abd1d83bb6c0e01f6775eb168a2e1a7b7db Mon Sep 17 00:00:00 2001 From: abhishek Date: Tue, 5 Oct 2010 15:28:07 -0700 Subject: [PATCH 001/101] bug 6368: adding the manageontap.jar entry for the build xml files, for netapp integration --- build/build-cloud.xml | 1 + build/package.xml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/build/build-cloud.xml b/build/build-cloud.xml index 0204e78165a..fae75e09724 100755 --- a/build/build-cloud.xml +++ b/build/build-cloud.xml @@ -261,6 +261,7 @@ + diff --git a/build/package.xml b/build/package.xml index 82781c61a2f..5579a3d148c 100755 --- a/build/package.xml +++ b/build/package.xml @@ -56,6 +56,7 @@ + @@ -154,6 +155,7 @@ + From 83accd786a9525feee1f0efa82943ce75840c50f Mon Sep 17 00:00:00 2001 From: anthony Date: Tue, 5 Oct 2010 15:29:17 -0700 Subject: [PATCH 002/101] bug 6410: there is no vmopsSnapshot plugin status 6410: resolved fixed --- .../com/cloud/hypervisor/xen/resource/CitrixResourceBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java index 325d1b7a2fe..105d75b804f 100644 --- a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java +++ b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java @@ -5094,7 +5094,7 @@ public abstract class CitrixResourceBase implements StoragePoolResource, ServerR protected String getVhdParent(String primaryStorageSRUuid, String snapshotUuid, Boolean isISCSI) { - String parentUuid = callHostPlugin("vmopsSnapshot", "getVhdParent", "primaryStorageSRUuid", primaryStorageSRUuid, + String parentUuid = callHostPlugin("getVhdParent", "primaryStorageSRUuid", primaryStorageSRUuid, "snapshotUuid", snapshotUuid, "isISCSI", isISCSI.toString()); if (parentUuid == null || parentUuid.isEmpty()) { From 4c839ee7de089e7c031dffd93d8f89fececc9c32 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 5 Oct 2010 15:30:19 -0700 Subject: [PATCH 003/101] Create template from volume backend is not working. So, hide the option from UI until backend is fixed. --- ui/scripts/cloud.core.storage.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ui/scripts/cloud.core.storage.js b/ui/scripts/cloud.core.storage.js index d7e4aa888a8..eeb89e23850 100644 --- a/ui/scripts/cloud.core.storage.js +++ b/ui/scripts/cloud.core.storage.js @@ -240,7 +240,7 @@ function showStorageTab(domainId, targetTab) { // FUNCTION: volume JSON to Template function volumeJSONToTemplate(json, template) { if (getHypervisorType() == "kvm") { - template.find("#volume_action_create_template_span").show(); + //template.find("#volume_action_create_template_span").show(); //create template from volume doesn't work. Hide it from UI on 2.1.x } template.attr("id", "volume"+json.id); if (index++ % 2 == 0) { @@ -277,7 +277,7 @@ function showStorageTab(domainId, targetTab) { if(json.type=="ROOT") { if (json.virtualmachineid != undefined && json.vmstate == "Stopped" && getHypervisorType() == "kvm") { - template.find("#volume_action_create_template_span").show(); + //template.find("#volume_action_create_template_span").show(); //create template from volume doesn't work. Hide it from UI on 2.1.x } } else { // DataDisk @@ -286,12 +286,12 @@ function showStorageTab(domainId, targetTab) { template.find("#volume_action_detach_span").show(); } if (json.vmstate == "Stopped" && getHypervisorType() == "kvm") { - template.find("#volume_action_create_template_span").show(); + //template.find("#volume_action_create_template_span").show(); //create template from volume doesn't work. Hide it from UI on 2.1.x } } else { // Disk not attached if (getHypervisorType() == "kvm") { - template.find("#volume_action_create_template_span").show(); + //template.find("#volume_action_create_template_span").show(); //create template from volume doesn't work. Hide it from UI on 2.1.x } if (json.storagetype == "shared") { template.find("#volume_action_attach_span, #volume_action_delete_span").show(); @@ -1042,7 +1042,9 @@ function showStorageTab(domainId, targetTab) { $("body").stopTime(timerKey); if (result.jobstatus == 1) { // Succeeded - template.find("#volume_action_attach_span, #volume_action_delete_span, #volume_action_create_template_span").show(); + //template.find("#volume_action_attach_span, #volume_action_delete_span, #volume_action_create_template_span").show(); //create template from volume doesn't work. Hide it from UI on 2.1.x + template.find("#volume_action_attach_span, #volume_action_delete_span").show(); //delete line after createTemplateFromVolume API is fixed. + template.find("#volume_action_detach_span").hide(); template.find("#volume_vmname").text("detached"); template.data("vmid", null).data("vmname", null); @@ -1119,7 +1121,8 @@ function showStorageTab(domainId, targetTab) { // Succeeded if (result.virtualmachine[0].vmstate == "Stopped") { template.find("#volume_action_attach_span, #volume_action_delete_span").hide(); - template.find("#volume_action_detach_span, #volume_action_create_template_span").show(); + //template.find("#volume_action_detach_span, #volume_action_create_template_span").show(); //create template from volume doesn't work. Hide it from UI on 2.1.x + template.find("#volume_action_detach_span").show(); //delete line after createTemplateFromVolume API is fixed. } else { template.find("#volume_action_attach_span, #volume_action_delete_span, #volume_action_create_template_span").hide(); template.find("#volume_action_detach_span").show(); From 0a2eccce7ac3463523c5d15ef1d0d27d05f482f1 Mon Sep 17 00:00:00 2001 From: anthony Date: Tue, 5 Oct 2010 15:42:23 -0700 Subject: [PATCH 004/101] bug 6403: template id of volume may be NULL, need to handle this status 6403: resolved fixed --- server/src/com/cloud/vm/UserVmManagerImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 5ec095d85cc..b24aa1d4436 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -2213,8 +2213,8 @@ public class UserVmManagerImpl implements UserVmManager { String origTemplateInstallPath = null; - - if (ImageFormat.ISO != _snapshotMgr.getImageFormat(volumeId)) { + ImageFormat format = _snapshotMgr.getImageFormat(volumeId); + if (format != null && format != ImageFormat.ISO) { Long origTemplateId = volume.getTemplateId(); VMTemplateHostVO vmTemplateHostVO = _templateHostDao.findByHostTemplate(secondaryStorageHost.getId(), origTemplateId); origTemplateInstallPath = vmTemplateHostVO.getInstallPath(); From 132c178bc2f595113b18f816108235fa5eaebd46 Mon Sep 17 00:00:00 2001 From: will Date: Tue, 5 Oct 2010 15:46:57 -0700 Subject: [PATCH 005/101] bug 6400: fixed css styling of the dialog that appears after the password has been reported after a successful vm deployment. It will no longer truncate the text. --- ui/css/main.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/css/main.css b/ui/css/main.css index 6cf443c0e31..c263687d747 100644 --- a/ui/css/main.css +++ b/ui/css/main.css @@ -3445,7 +3445,7 @@ a:hover.add_publicipbutton { .loadingmessage_container { width:30%; - height:56px; + height:66px; margin:0 auto; padding:0; z-index:1000; @@ -3461,7 +3461,7 @@ a:hover.add_publicipbutton { .loadingmessage_top { width:99%; - height:29px; + height:45px; float:left; margin:0; padding:2px 5px 0 5px; @@ -3470,7 +3470,7 @@ a:hover.add_publicipbutton { .loadingmessage_top p { width:auto; - height:25px; + height:45px; margin:0; padding:0; color:#333; @@ -3482,7 +3482,7 @@ a:hover.add_publicipbutton { .loadingmessage_bottom { width:100%; - height:20px; + height:25px; float:left; margin:0; padding:0; From 550ef02f9ca00b5e44cc5f9ea472ed1e40025191 Mon Sep 17 00:00:00 2001 From: anthony Date: Tue, 5 Oct 2010 16:44:40 -0700 Subject: [PATCH 006/101] bug 6402: template id of volume could be null status 6402: resolved fixed --- .../com/cloud/storage/StorageManagerImpl.java | 71 +++++++++---------- 1 file changed, 33 insertions(+), 38 deletions(-) diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index 332640ce2de..09d25980e5e 100644 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -531,11 +531,9 @@ public class StorageManagerImpl implements StorageManager { String templatePath = null; VMTemplateVO template = null; if(originalVolume.getVolumeType().equals(Volume.VolumeType.ROOT)){ - if(originalVolume.getTemplateId() == null){ - details = "Null Template Id for Root Volume Id: " + origVolumeId + ". Cannot create volume from snapshot of root disk."; - s_logger.error(details); - } - else { + + ImageFormat format = _snapshotMgr.getImageFormat(origVolumeId); + if (format != null && format != ImageFormat.ISO) { Long templateId = originalVolume.getTemplateId(); template = _templateDao.findById(templateId); if(template == null) { @@ -555,43 +553,40 @@ public class StorageManagerImpl implements StorageManager { (templatePath = templateHostVO.getInstallPath()) == null) { details = "Template id: " + templateId + " is not present on secondaryStorageHost Id: " + secondaryStorageHost.getId() + ". Can't create volume from ROOT DISK"; + s_logger.warn(details); + throw new CloudRuntimeException(details); } } } - } - if (details == null) { - // everything went well till now - DataCenterVO dc = _dcDao.findById(originalVolume.getDataCenterId()); - DiskOfferingVO diskOffering = null; + } + // everything went well till now + DataCenterVO dc = _dcDao.findById(originalVolume.getDataCenterId()); + DiskOfferingVO diskOffering = null; + + if (originalVolume.getVolumeType() == VolumeType.DATADISK + || originalVolume.getVolumeType() == VolumeType.ROOT) { + Long diskOfferingId = originalVolume.getDiskOfferingId(); + if (diskOfferingId != null) { + diskOffering = _diskOfferingDao.findById(diskOfferingId); + } + } else { + // The code never reaches here. + s_logger + .error("Original volume must have been a ROOT DISK or a DATA DISK"); + return null; + } + Pair volumeDetails = createVolumeFromSnapshot(userId, + accountId, volumeName, dc, diskOffering, snapshot, + templatePath, originalVolume.getSize(), template); + createdVolume = volumeDetails.first(); + if (createdVolume != null) { + volumeId = createdVolume.getId(); + } else { + details = "Creating volue failed due to " + volumeDetails.second(); + s_logger.warn(details); + throw new CloudRuntimeException(details); + } - if (originalVolume.getVolumeType() == VolumeType.DATADISK || originalVolume.getVolumeType() == VolumeType.ROOT) { - Long diskOfferingId = originalVolume.getDiskOfferingId(); - if (diskOfferingId != null) { - diskOffering = _diskOfferingDao.findById(diskOfferingId); - } - } -// else if (originalVolume.getVolumeType() == VolumeType.ROOT) { -// // Create a temporary disk offering with the same size as the ROOT DISK -// Long rootDiskSize = originalVolume.getSize(); -// Long rootDiskSizeInMB = rootDiskSize/(1024*1024); -// Long sizeInGB = rootDiskSizeInMB/1024; -// String name = "Root Disk Offering"; -// String displayText = "Temporary Disk Offering for Snapshot from Root Disk: " + originalVolume.getId() + "[" + sizeInGB + "GB Disk]"; -// diskOffering = new DiskOfferingVO(originalVolume.getDomainId(), name, displayText, rootDiskSizeInMB, false, null); -// } - else { - // The code never reaches here. - s_logger.error("Original volume must have been a ROOT DISK or a DATA DISK"); - return null; - } - Pair volumeDetails = createVolumeFromSnapshot(userId, accountId, volumeName, dc, diskOffering, snapshot, templatePath, originalVolume.getSize(), template); - createdVolume = volumeDetails.first(); - if (createdVolume != null) { - volumeId = createdVolume.getId(); - } - details = volumeDetails.second(); - } - Transaction txn = Transaction.currentTxn(); txn.start(); // Create an event From f6f3ab2bc382d3f1d596f79fb7c99a59d9c67b4c Mon Sep 17 00:00:00 2001 From: anthony Date: Tue, 5 Oct 2010 17:20:58 -0700 Subject: [PATCH 007/101] bug 6415: destroy this host in DB, if this host can't be connected status 6415: resolved fixed --- .../cloud/hypervisor/xen/resource/CitrixResourceBase.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java index 105d75b804f..a41f3757f70 100644 --- a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java +++ b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java @@ -6079,7 +6079,11 @@ public abstract class CitrixResourceBase implements StoragePoolResource, ServerR return new Answer(cmd); } Host host = Host.getByUuid(conn, hostuuid); - Pool.eject(conn, host); + try { + Pool.eject(conn, host); + } catch (Exception e) { + host.destroy(conn); + } return new Answer(cmd); } catch (XenAPIException e) { String msg = "Unable to eject host " + _host.uuid + " due to " + e.toString(); From 6a78f8693c2d39321ecbadba978a20ada04c2b0a Mon Sep 17 00:00:00 2001 From: abhishek Date: Tue, 5 Oct 2010 17:24:34 -0700 Subject: [PATCH 008/101] fixing the build --- wscript_build | 1 + 1 file changed, 1 insertion(+) diff --git a/wscript_build b/wscript_build index c0a9fc3b39c..89b6ffbb781 100644 --- a/wscript_build +++ b/wscript_build @@ -277,6 +277,7 @@ thirdparties = " ".join( Utils.to_list( cloudstack-proprietary/thirdparty/xmlrpc-client-3.1.3.jar cloudstack-proprietary/thirdparty/xmlrpc-common-3.1.3.jar cloudstack-proprietary/thirdparty/ws-commons-util-1.0.2.jar + cloudstack-proprietary/thirdparty/manageontap.jar cloudstack-proprietary/thirdparty/log4j-1.2.15.jar cloudstack-proprietary/thirdparty/gson-1.3.jar cloudstack-proprietary/thirdparty/apache-log4j-extras-1.0.jar From 0096bb48411137d8e244da90cc0d55b39e2f76d6 Mon Sep 17 00:00:00 2001 From: anthony Date: Tue, 5 Oct 2010 17:37:10 -0700 Subject: [PATCH 009/101] correct some logs --- .../hypervisor/xen/resource/CitrixResourceBase.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java index a41f3757f70..7d44ed9d365 100644 --- a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java +++ b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java @@ -6081,17 +6081,18 @@ public abstract class CitrixResourceBase implements StoragePoolResource, ServerR Host host = Host.getByUuid(conn, hostuuid); try { Pool.eject(conn, host); - } catch (Exception e) { - host.destroy(conn); + } catch (XenAPIException e) { + String msg = "Unable to eject host " + _host.uuid + " due to " + e.toString(); + s_logger.warn(msg); + host.destroy(conn); } return new Answer(cmd); } catch (XenAPIException e) { - String msg = "Unable to eject host " + _host.uuid + " due to " + e.toString(); + String msg = "XenAPIException Unable to destroy host " + _host.uuid + " in xenserver database due to " + e.toString(); s_logger.warn(msg, e); return new Answer(cmd, false, msg); } catch (Exception e) { - s_logger.warn("Unable to eject host " + _host.uuid, e); - String msg = "Unable to eject host " + _host.uuid + " due to " + e.getMessage(); + String msg = "Exception Unable to destroy host " + _host.uuid + " in xenserver database due to " + e.getMessage(); s_logger.warn(msg, e); return new Answer(cmd, false, msg); } From 112def883a965d4f790d291aeb821fe06904d5e7 Mon Sep 17 00:00:00 2001 From: will Date: Tue, 5 Oct 2010 17:41:22 -0700 Subject: [PATCH 010/101] bug 6392: You will no longer be presented account specific scope if you select a public + untagged vlan. Only zone-wide is applicable for this setup. --- ui/jsp/tab_configuration.jsp | 4 ++-- ui/scripts/cloud.core.configuration.js | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ui/jsp/tab_configuration.jsp b/ui/jsp/tab_configuration.jsp index b178cbf314d..4c6a71e764e 100755 --- a/ui/jsp/tab_configuration.jsp +++ b/ui/jsp/tab_configuration.jsp @@ -434,8 +434,8 @@ long milliseconds = new Date().getTime();