From 202930fd554ddc9a8e78cf39ae54a4e3a56d3904 Mon Sep 17 00:00:00 2001 From: Marcus Sorensen Date: Tue, 16 Apr 2013 12:07:15 -0600 Subject: [PATCH 01/31] CLOUDSTACK-2051 Allow KVM HA Monitor to verify that a NfsStoragePool is valid before running the script that mounts it and touches the HA files. Signed-off-by: Marcus Sorensen 1366135635 -0600 --- .../hypervisor/kvm/resource/KVMHAMonitor.java | 51 ++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/KVMHAMonitor.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/KVMHAMonitor.java index c4e121b8ae8..d1470d62519 100644 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/KVMHAMonitor.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/KVMHAMonitor.java @@ -23,6 +23,15 @@ import java.util.concurrent.ConcurrentHashMap; import org.apache.log4j.Logger; import com.cloud.utils.script.Script; +import org.libvirt.Connect; +import org.libvirt.LibvirtException; +import org.libvirt.Secret; +import org.libvirt.StoragePool; +import org.libvirt.StoragePoolInfo; +import org.libvirt.StoragePoolInfo.StoragePoolState; + +import com.cloud.hypervisor.kvm.resource.LibvirtConnection; + public class KVMHAMonitor extends KVMHABase implements Runnable { private static final Logger s_logger = Logger.getLogger(KVMHAMonitor.class); private Map _storagePool = new ConcurrentHashMap(); @@ -45,6 +54,9 @@ public class KVMHAMonitor extends KVMHABase implements Runnable { public void removeStoragePool(String uuid) { synchronized (_storagePool) { + NfsStoragePool pool = this._storagePool.get(uuid); + Script.runSimpleBashScript("umount " + pool._mountDestPath); + s_logger.debug("attempted to umount '" + pool._mountDestPath + "'"); this._storagePool.remove(uuid); } } @@ -60,7 +72,44 @@ public class KVMHAMonitor extends KVMHABase implements Runnable { @Override public void run() { synchronized (_storagePool) { - for (NfsStoragePool primaryStoragePool : _storagePool.values()) { + for (String uuid : _storagePool.keySet()) { + NfsStoragePool primaryStoragePool = _storagePool.get(uuid); + + // check for any that have been deregistered with libvirt and + // skip,remove them + + StoragePool storage = null; + try { + Connect conn = LibvirtConnection.getConnection(); + storage = conn.storagePoolLookupByUUIDString(uuid); + if (storage == null) { + s_logger.debug("Libvirt storage pool " + uuid + +" not found, removing from HA list"); + removeStoragePool(uuid); + continue; + + } else if (storage.getInfo().state != StoragePoolState.VIR_STORAGE_POOL_RUNNING) { + s_logger.debug("Libvirt storage pool " + uuid + +" found, but not running, removing from HA list"); + + removeStoragePool(uuid); + continue; + } + s_logger.debug("Found NFS storage pool " + uuid + " in libvirt, continuing"); + + } catch (LibvirtException e) { + s_logger.debug("Failed to lookup libvirt storage pool " + uuid + + " due to: " + e ); + + // we only want to remove pool if it's not found, not if libvirt + // connection fails + if (e.toString().contains("pool not found")) { + s_logger.debug("removing pool from HA monitor since it was deleted"); + removeStoragePool(uuid); + continue; + } + } + String result = null; for (int i = 0; i < 5; i++) { Script cmd = new Script(_heartBeatPath, From 8bef069f01aaf1550b9cacb0363f04e5a01541ee Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 16 Apr 2013 12:38:00 -0700 Subject: [PATCH 02/31] CLOUDSTACK-1910: cloudstack UI - Regions menu - GSLB - (1) add detailView (2) implement Delete GSLB action. --- ui/scripts/regions.js | 139 +++++++++++++++++++++++++++++++----------- 1 file changed, 102 insertions(+), 37 deletions(-) diff --git a/ui/scripts/regions.js b/ui/scripts/regions.js index ec5e21b7d4c..2cfb0fee172 100644 --- a/ui/scripts/regions.js +++ b/ui/scripts/regions.js @@ -246,8 +246,30 @@ }, description: { label: 'label.description' - }, - /* + }, + gslbdomainname: { + label: 'GSLB Domain Name', + validation: { required: true } + }, + gslblbmethod: { + label: 'Algorithm', + select: function(args) { + var array1 = [{id: 'roundrobin', description: 'roundrobin'}, {id: 'leastconn', description: 'leastconn'}, {id: 'proximity', description: 'proximity'}]; + args.response.success({ + data: array1 + }); + } + }, + gslbservicetype: { + label: 'Service Type', + select: function(args) { + var array1 = [{id: 'tcp', description: 'tcp'}, {id: 'udp', description: 'udp'}]; + args.response.success({ + data: array1 + }); + }, + validation: { required: true } + }, domainid: { label: 'Domain', select: function(args) { @@ -293,31 +315,7 @@ else return true; } - }, - */ - gslblbmethod: { - label: 'Algorithm', - select: function(args) { - var array1 = [{id: 'roundrobin', description: 'roundrobin'}, {id: 'leastconn', description: 'leastconn'}, {id: 'proximity', description: 'proximity'}]; - args.response.success({ - data: array1 - }); - } - }, - gslbdomainname: { - label: 'GSLB Domain Name', - validation: { required: true } - }, - gslbservicetype: { - label: 'Service Type', - select: function(args) { - var array1 = [{id: 'tcp', description: 'tcp'}, {id: 'udp', description: 'udp'}]; - args.response.success({ - data: array1 - }); - }, - validation: { required: true } - } + } } }, action: function(args) { @@ -330,23 +328,22 @@ gslbservicetype: args.data.gslbservicetype }; if(args.data.description != null && args.data.description.length > 0) - $.extend(data, { description: args.data.description }); - /* + $.extend(data, { description: args.data.description }); if(args.data.domainid != null && args.data.domainid.length > 0) $.extend(data, { domainid: args.data.domainid }); if(args.data.account != null && args.data.account.length > 0) $.extend(data, { account: args.data.account }); - */ + $.ajax({ url: createURL('createGlobalLoadBalancerRule'), data: data, success: function(json) { - var jid = json.creategloballoadbalancerruleresponse.jobid; + var jid = json.creategloballoadbalancerruleresponse.jobid; args.response.success( {_custom: {jobId: jid, - getUpdatedItem: function(json) { - return json.queryasyncjobresultresponse.jobresult.globalloadbalancerrule; + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.globalloadbalancer; } } } @@ -355,9 +352,7 @@ }); }, notification: { - poll: function(args) { - poll: pollAsyncJobResult - } + poll: pollAsyncJobResult } } }, @@ -383,7 +378,77 @@ data: null }); } - } + }, + + detailView: { + name: 'GSLB details', + //viewAll: { path: 'storage.snapshots', label: 'label.snapshots' }, + actions: { + remove: { + label: 'delete GSLB', + messages: { + confirm: function(args) { + return 'Please confirm you want to delete this GSLB'; + }, + notification: function(args) { + return 'delete GSLB'; + } + }, + action: function(args) { + var data = { + id: args.context.GSLB[0].id + }; + $.ajax({ + url: createURL("deleteGlobalLoadBalancerRule"), + data: data, + success: function(json) { + var jid = json.deletegloballoadbalancerruleresponse.jobid; + args.response.success({ + _custom: { + jobId: jid + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + }, + tabs: { + details: { + title: 'label.details', + fields: [ + { + name: { label: 'label.name' } + }, + { + description: { label: 'label.description' }, + gslbdomainname: { label: 'GSLB Domain Name' }, + gslblbmethod: { label: 'Algorithm' }, + gslbservicetype: { label: 'Service Type' }, + id: { label: 'ID' } + } + ], + dataProvider: function(args) { + var data = { + id: args.context.GSLB[0].id + }; + $.ajax({ + url: createURL('listGlobalLoadBalancerRules'), + data: data, + success: function(json) { + var item = json.listgloballoadbalancerrulesresponse.globalloadbalancerrule[0]; + args.response.success({ + data: item + }); + } + }); + } + } + } + } } } } From 111a99f16e3628a86139ad833d4ec2cb964e7e81 Mon Sep 17 00:00:00 2001 From: Joe Brockmeier Date: Tue, 16 Apr 2013 15:11:52 -0500 Subject: [PATCH 03/31] Fixing incubating references in Dev Guide --- docs/en-US/source-build.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en-US/source-build.xml b/docs/en-US/source-build.xml index 33218962174..8504385ee29 100644 --- a/docs/en-US/source-build.xml +++ b/docs/en-US/source-build.xml @@ -25,11 +25,11 @@
Building &PRODUCT; from Source - Prior to the 4.0.0 incubating release, Ant was used to build &PRODUCT;. Starting with 4.0.0 a migration to Maven is underway. + Prior to the 4.0.0 incubating release, Ant was used to build &PRODUCT;. A migration to Maven started in the 4.0.0 cycle, and has completed in 4.1.0. The website and the wiki contain up to date information on the build procedure at: https://cwiki.apache.org/CLOUDSTACK/building-with-maven.html - http://incubator.apache.org/cloudstack/develop/environment.html + https://cwiki.apache.org/CLOUDSTACK/setting-up-cloudstack-development-environment.html The overarching steps to build &PRODUCT; are:. From 8b8a2f218c39935633ca58e75bef0e9181a56dcb Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 16 Apr 2013 13:14:58 -0700 Subject: [PATCH 04/31] CLOUDSTACK-1910: cloudstack UI - make Regions menu visible to regular-user/domain-admin. --- ui/scripts/cloudStack.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js index a8bca91769c..35969a27251 100644 --- a/ui/scripts/cloudStack.js +++ b/ui/scripts/cloudStack.js @@ -25,13 +25,13 @@ sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "system", "global-settings", "configuration", "projects", "regions"]; } else if(isDomainAdmin()) { - sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "projects"]; + sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "projects", "regions"]; } else if (g_userProjectsEnabled) { - sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "events", "projects"]; + sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "events", "projects", "regions"]; } else { //normal user - sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "events"]; + sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "events", "regions"]; } if (cloudStack.plugins.length) { From 9ad50272c1fa2d1bb53ebce0d57b97e91d36246d Mon Sep 17 00:00:00 2001 From: Likitha Shetty Date: Wed, 17 Apr 2013 02:13:58 +0530 Subject: [PATCH 05/31] Create Public IP address - If system account is specified do nothing Dedicate Public IP address - If system account is specified fail the request --- .../cloud/configuration/ConfigurationManagerImpl.java | 11 ++++++++--- .../cloud/configuration/ConfigurationManagerTest.java | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index c9ae854ee81..cb780eab6c8 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -2154,6 +2154,9 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati vlanOwner = _accountDao.findActiveAccount(accountName, domainId); if (vlanOwner == null) { throw new InvalidParameterValueException("Please specify a valid account."); + } else if (vlanOwner.getId() == Account.ACCOUNT_ID_SYSTEM) { + // by default vlan is dedicated to system account + vlanOwner = null; } } @@ -2705,14 +2708,16 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati if ((accountName != null) && (domainId != null)) { vlanOwner = _accountDao.findActiveAccount(accountName, domainId); if (vlanOwner == null) { - throw new InvalidParameterValueException("Please specify a valid account"); + throw new InvalidParameterValueException("Unable to find account by name " + accountName); + } else if (vlanOwner.getId() == Account.ACCOUNT_ID_SYSTEM) { + throw new InvalidParameterValueException("Please specify a valid account. Cannot dedicate IP range to system account"); } } // Check if range is valid VlanVO vlan = _vlanDao.findById(vlanDbId); if (vlan == null) { - throw new InvalidParameterValueException("Please specify a valid Public IP range id"); + throw new InvalidParameterValueException("Unable to find vlan by id " + vlanDbId); } // Check if range has already been dedicated @@ -2742,7 +2747,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati if (allocatedToAccountId != null) { Account accountAllocatedTo = _accountMgr.getActiveAccountById(allocatedToAccountId); if (!accountAllocatedTo.getAccountName().equalsIgnoreCase(accountName)) - throw new InvalidParameterValueException("Public IP address in range is already allocated to another account"); + throw new InvalidParameterValueException(ip.getAddress() + " Public IP address in range is allocated to another account "); } } diff --git a/server/test/com/cloud/configuration/ConfigurationManagerTest.java b/server/test/com/cloud/configuration/ConfigurationManagerTest.java index ee98d53c922..5c1cabfe774 100755 --- a/server/test/com/cloud/configuration/ConfigurationManagerTest.java +++ b/server/test/com/cloud/configuration/ConfigurationManagerTest.java @@ -224,7 +224,7 @@ public class ConfigurationManagerTest { try { configurationMgr.dedicatePublicIpRange(dedicatePublicIpRangesCmd); } catch (Exception e) { - Assert.assertTrue(e.getMessage().contains("Please specify a valid Public IP range id")); + Assert.assertTrue(e.getMessage().contains("Unable to find vlan by id")); } finally { txn.close("runDedicatePublicIpRangeInvalidRange"); } @@ -306,7 +306,7 @@ public class ConfigurationManagerTest { try { configurationMgr.dedicatePublicIpRange(dedicatePublicIpRangesCmd); } catch (Exception e) { - Assert.assertTrue(e.getMessage().contains("Public IP address in range is already allocated to another account")); + Assert.assertTrue(e.getMessage().contains("Public IP address in range is allocated to another account")); } finally { txn.close("runDedicatePublicIpRangeIPAdressAllocated"); } From a4d8c4857e5ccceb73dfb1569bd5b8e0bcfc8b21 Mon Sep 17 00:00:00 2001 From: Joe Brockmeier Date: Tue, 16 Apr 2013 16:58:54 -0500 Subject: [PATCH 06/31] Fixing typos in carrying over fixed issues to Release Notes. --- docs/en-US/Release_Notes.xml | 334 +++++++++++++++++------------------ 1 file changed, 165 insertions(+), 169 deletions(-) diff --git a/docs/en-US/Release_Notes.xml b/docs/en-US/Release_Notes.xml index f449518401b..97531afe5cd 100644 --- a/docs/en-US/Release_Notes.xml +++ b/docs/en-US/Release_Notes.xml @@ -243,7 +243,7 @@ under the License. CLOUDSTACK-97 - Vmware network labels are ignored when creating a Zone using basic networkin + Vmware network labels are ignored when creating a Zone using basic networking @@ -259,7 +259,7 @@ under the License. CLOUDSTACK-118 - "Status of host resorce stuck in ""ErrorInMaintenance"" + Status of host resorce stuck in "ErrorInMaintenance" @@ -267,7 +267,7 @@ under the License. CLOUDSTACK-119 - Move Agent-Simulator in to the hypervisor plugin mode + Move Agent-Simulator in to the hypervisor plugin model @@ -275,7 +275,7 @@ under the License. CLOUDSTACK-130 - Clarify docs on tags parameter in API referenc + Clarify docs on tags parameter in API reference @@ -291,7 +291,7 @@ under the License. CLOUDSTACK-178 - Expose name parameter of VM in list Vm view + Expose name parameter of VM in list Vm view. @@ -299,7 +299,7 @@ under the License. CLOUDSTACK-198 - vpn:failto add VPN Users deletes all the existing Vpn use + vpn:failto add VPN Users deletes all the existing Vpn user @@ -307,7 +307,7 @@ under the License. CLOUDSTACK-222 - Admin UI prompts to restart Management server with cancel edit operatio + Admin UI prompts to restart Management server with cancel edit operation @@ -323,7 +323,7 @@ under the License. CLOUDSTACK-226 - UpdatePhysicalNetworkcommand failed due to java.sql.BatchUpdateException ; Tried to extend the existing Guest VLAN Range of one physical network into the Guest VLAN range of the other physical networ + UpdatePhysicalNetworkcommand failed due to java.sql.BatchUpdateException ; Tried to extend the existing Guest VLAN Range of one physical network into the Guest VLAN range of the other physical network @@ -331,7 +331,7 @@ under the License. CLOUDSTACK-227 - ReconnectHostCmd: NullPointerException: Unable to get host Information for XenServer 6.0.2 host - on intentionally changing the traffic labels on the physical networ + ReconnectHostCmd: NullPointerException: Unable to get host Information for XenServer 6.0.2 host - on intentionally changing the traffic labels on the physical network @@ -339,7 +339,7 @@ under the License. CLOUDSTACK-228 - UI provides an option to reconnect a disconnected host - ServerApiException is thrown on an attemp + UI provides an option to reconnect a disconnected host - ServerApiException is thrown on an attempt @@ -347,7 +347,7 @@ under the License. CLOUDSTACK-232 - Zone infrastructure chart -- disable resource total displa + Zone infrastructure chart -- disable resource total display @@ -363,7 +363,7 @@ under the License. CLOUDSTACK-249 - Add host id to failed VM deploy alert + Add host id to failed VM deploy alerts @@ -371,7 +371,7 @@ under the License. CLOUDSTACK-250 - Incorrect description of maintenance mode in admin guid + Incorrect description of maintenance mode in admin guide @@ -387,7 +387,7 @@ under the License. CLOUDSTACK-271 - updatePhysicalNetwork dies with an NPE when the vlan range is empt + updatePhysicalNetwork dies with an NPE when the vlan range is empty @@ -395,7 +395,7 @@ under the License. CLOUDSTACK-274 - Two error codes mapped to same value in AP + Two error codes mapped to same value in API @@ -403,7 +403,7 @@ under the License. CLOUDSTACK-275 - hostid not always a UUI + hostid not always a UUID @@ -411,7 +411,7 @@ under the License. CLOUDSTACK-277 - Message during CloudStack management server Installation: cannot access /usr/share/cloud/bridge/lib: No such file or director + Message during CloudStack management server Installation: cannot access /usr/share/cloud/bridge/lib: No such file or directory @@ -419,7 +419,7 @@ under the License. CLOUDSTACK-279 - deleteProject fails when executed by the regular user (works fine for root/domain admin + deleteProject fails when executed by the regular user (works fine for root/domain admin) @@ -427,7 +427,7 @@ under the License. CLOUDSTACK-284 - listVirtualMachines does not return deleted machines when zone is specifie + listVirtualMachines does not return deleted machines when zone is specified @@ -435,7 +435,7 @@ under the License. CLOUDSTACK-290 - 3.0.0 template also needed for 2.2.14 to 3.0.5 direct upgrade + 3.0.0 template also needed for 2.2.14 to 3.0.5 direct upgrade. @@ -443,7 +443,7 @@ under the License. CLOUDSTACK-293 - "We do awful, hacky things in our spec file for client + "We do awful, hacky things in our spec file for client" @@ -451,7 +451,7 @@ under the License. CLOUDSTACK-304 - Add synchronization for createSnapshot command per host basi + Add synchronization for createSnapshot command per host basis @@ -459,7 +459,7 @@ under the License. CLOUDSTACK-309 - iptables rules being deleted from wrong VM after a migratio + iptables rules being deleted from wrong VM after a migration @@ -467,7 +467,7 @@ under the License. CLOUDSTACK-318 - Adding XenServer Host Fails - 6.0.2 fails with 4.0. + Adding XenServer Host Fails - 6.0.2 fails with 4.0.0 @@ -475,7 +475,7 @@ under the License. CLOUDSTACK-320 - "sessionKey query parameter should be case-insensitive, now only sessionkey is accepted + "sessionKey query parameter should be case-insensitive, now only sessionkey is accepted" @@ -491,7 +491,7 @@ under the License. CLOUDSTACK-332 - """count"" property in list* API response should be equal to how many entries in database, not how many objects in API response + "count" property in list* API response should be equal to how many entries in database, not how many objects in API response @@ -499,7 +499,7 @@ under the License. CLOUDSTACK-333 - When Datacenter name in VCenter has spaces Primary Storage (VMFS) discovery will fai + When Datacenter name in VCenter has spaces Primary Storage (VMFS) discovery will fail @@ -507,7 +507,7 @@ under the License. CLOUDSTACK-335 - KVM VPC load balancer not workin + KVM VPC load balancer not working @@ -515,7 +515,7 @@ under the License. CLOUDSTACK-336 - listZones doesn't honour pagin + listZones doesn't honour paging @@ -531,7 +531,7 @@ under the License. CLOUDSTACK-346 - Cannot add Vmware cluster with class loader conflict exceptio + Cannot add Vmware cluster with class loader conflict exception @@ -539,7 +539,7 @@ under the License. CLOUDSTACK-347 - listNetworks API: return vlan information only when the caller is ROOT admi + listNetworks API: return vlan information only when the caller is ROOT admin @@ -547,7 +547,7 @@ under the License. CLOUDSTACK-348 - deleteNetwork does not clean up network resource count correctl + deleteNetwork does not clean up network resource count correctly @@ -579,7 +579,7 @@ under the License. CLOUDSTACK-359 - PropagateResourceEventCommand failes in cluster configuratio + PropagateResourceEventCommand failes in cluster configuration @@ -587,7 +587,7 @@ under the License. CLOUDSTACK-361 - Wrong creation of guest networks on a KVM host in Multiple Physical Networks with guest traffi + Wrong creation of guest networks on a KVM host in Multiple Physical Networks with guest traffic @@ -595,7 +595,7 @@ under the License. CLOUDSTACK-364 - Docs point to download.cloud.com for AWS API scrip + Docs point to download.cloud.com for AWS API script @@ -603,7 +603,7 @@ under the License. CLOUDSTACK-368 - OVM - cannot create guest V + OVM - cannot create guest VM @@ -611,7 +611,7 @@ under the License. CLOUDSTACK-369 - ASF 4.0 - unable to support XenServer 6.1 hos + ASF 4.0 - unable to support XenServer 6.1 host @@ -627,7 +627,7 @@ under the License. CLOUDSTACK-377 - provide deployment config access to marvin's testcas + provide deployment config access to marvin's testcase @@ -635,7 +635,7 @@ under the License. CLOUDSTACK-378 - mavenize marvin on maste + mavenize marvin on master @@ -643,7 +643,7 @@ under the License. CLOUDSTACK-390 - Install Guide: Section 4.5.7 (Prepare the System VM Template): Links go to cloud.co + Install Guide: Section 4.5.7 (Prepare the System VM Template): Links go to cloud.com @@ -651,7 +651,7 @@ under the License. CLOUDSTACK-397 - Install Guide: Section 11.1 (Guest Traffic): Diagram is the wrong diagra + Install Guide: Section 11.1 (Guest Traffic): Diagram is the wrong diagram @@ -691,7 +691,7 @@ under the License. CLOUDSTACK-416 - XCP 1.6beta2 (61002c) - can't add a hos + XCP 1.6beta2 (61002c) - can't add a host @@ -699,7 +699,7 @@ under the License. CLOUDSTACK-417 - Handle password server securely to run on port 8080 on V + Handle password server securely to run on port 8080 on VR @@ -723,7 +723,7 @@ under the License. CLOUDSTACK-428 - Storage capacity shown in UI is incorrec + Storage capacity shown in UI is incorrect @@ -731,7 +731,7 @@ under the License. CLOUDSTACK-435 - Vmware network labels are ignored when creating a Zone using basic networkin + Vmware network labels are ignored when creating a Zone using basic networking @@ -739,7 +739,7 @@ under the License. CLOUDSTACK-441 - Running mgmt server using jetty fails to start api serve + Running mgmt server using jetty fails to start api server @@ -755,7 +755,7 @@ under the License. CLOUDSTACK-448 - SSVM bootstrap failure on XenServer hosts with E3 CP + SSVM bootstrap failure on XenServer hosts with E3 CPU @@ -763,7 +763,7 @@ under the License. CLOUDSTACK-456 - License tag in SPEC isn't what RPM is expectin + License tag in SPEC isn't what RPM is expecting @@ -771,7 +771,7 @@ under the License. CLOUDSTACK-459 - [Optional Public IP assignment for EIP with Basic Zone] Associate IP Checkbox in Create Network Offering Dialog is Displayed When Elastic LB is Selecte + [Optional Public IP assignment for EIP with Basic Zone] Associate IP Checkbox in Create Network Offering Dialog is Displayed When Elastic LB is Selected @@ -779,7 +779,7 @@ under the License. CLOUDSTACK-462 - A few corrections to make to the 4.0.0 installation guid + A few corrections to make to the 4.0.0 installation guide @@ -803,7 +803,7 @@ under the License. CLOUDSTACK-467 - Developer's Guide points to cloud.com for API referenc + Developer's Guide points to cloud.com for API reference @@ -811,7 +811,7 @@ under the License. CLOUDSTACK-479 - UpdateVirtualMachine api fails to propagate userdata to dom + UpdateVirtualMachine api fails to propagate userdata to domr @@ -819,7 +819,7 @@ under the License. CLOUDSTACK-481 - Installation Guide Doc Erro + Installation Guide Doc Error @@ -907,7 +907,7 @@ under the License. CLOUDSTACK-520 - Dependency jar names mismatch with install-non-oss.s + Dependency jar names mismatch with install-non-oss.sh @@ -915,7 +915,7 @@ under the License. CLOUDSTACK-521 - Build will hung up when doing test for TestAgentShel + Build will hung up when doing test for TestAgentShell @@ -931,7 +931,7 @@ under the License. CLOUDSTACK-527 - List API performance optimization by using DB views and removing UUID conversion + List API performance optimization by using DB views and removing UUID conversion. @@ -939,7 +939,7 @@ under the License. CLOUDSTACK-534 - Failed to add hos + Failed to add host @@ -1091,7 +1091,7 @@ under the License. CLOUDSTACK-606 - Starting VM fails with 'ConcurrentOperationException' in a clustered MS scenari + Starting VM fails with 'ConcurrentOperationException' in a clustered MS scenario @@ -1107,7 +1107,7 @@ under the License. CLOUDSTACK-617 - Unable to edit a Sub domai + Unable to edit a Sub domain @@ -1115,7 +1115,7 @@ under the License. CLOUDSTACK-639 - API Refactoring: Adapters for AC + API Refactoring: Adapters for ACL @@ -1147,7 +1147,7 @@ under the License. CLOUDSTACK-689 - RVR: Stop pending flag is not cleared when user start the disconnected router from another hos + RVR: Stop pending flag is not cleared when user start the disconnected router from another host @@ -1283,7 +1283,7 @@ under the License. CLOUDSTACK-928 - [Simulator] Latency for Agent Commands - change unit of wait from seconds to millisecond + [Simulator] Latency for Agent Commands - change unit of wait from seconds to milliseconds @@ -1307,7 +1307,7 @@ under the License. CLOUDSTACK-968 - marvin: vlan should be an attribute of the physical_network and not the zon + marvin: vlan should be an attribute of the physical_network and not the zone @@ -1331,7 +1331,7 @@ under the License. CLOUDSTACK-985 - Different MAC address for RvR caused issue in short term network outrag + Different MAC address for RvR caused issue in short term network outage @@ -1339,7 +1339,7 @@ under the License. CLOUDSTACK-987 - Sections missing in Working With Snapshot + Sections missing in Working With Snapshots @@ -1475,7 +1475,7 @@ under the License. CLOUDSTACK-1051 - API dispatcher unable to find objectVO corresponding to DeleteTemplatecm + API dispatcher unable to find objectVO corresponding to DeleteTemplatecmd @@ -1491,7 +1491,7 @@ under the License. CLOUDSTACK-1056 - S3 secondary storage fails to upload systemvm template due to KVMHA director + S3 secondary storage fails to upload systemvm template due to KVMHA directory @@ -1507,7 +1507,7 @@ under the License. CLOUDSTACK-1063 - "SG Enabled Advanced Zone - "Add Guest Networks" - When user tries to add a guest Network with scope as "Account" he should NOT be presented with ""Offering for shared security group enabled"" + "SG Enabled Advanced Zone - "Add Guest Networks" - When user tries to add a guest Network with scope as "Account" he should NOT be presented with "Offering for shared security group enabled" @@ -1523,7 +1523,7 @@ under the License. CLOUDSTACK-1068 - Names in VR list is useles + Names in VR list is useless @@ -1531,7 +1531,7 @@ under the License. CLOUDSTACK-1070 - javelin: NPE on executing registerIso AP + javelin: NPE on executing registerIso API @@ -1547,7 +1547,7 @@ under the License. CLOUDSTACK-1078 - Not able to start System Vms on Rhel 6.3 KVM hos + Not able to start System Vms on Rhel 6.3 KVM host @@ -1571,7 +1571,7 @@ under the License. CLOUDSTACK-1083 - listUsageRecords api: removed project results in NP + listUsageRecords api: removed project results in NPE @@ -1579,7 +1579,7 @@ under the License. CLOUDSTACK-1087 - Update the Developer Guide for ASFCS 4.1 Releas + Update the Developer Guide for ASFCS 4.1 Release @@ -1587,7 +1587,7 @@ under the License. CLOUDSTACK-1088 - EnableStaticNat error will clear the data in databas + EnableStaticNat error will clear the data in database @@ -1611,7 +1611,7 @@ under the License. CLOUDSTACK-1100 - Expunge thread is not kicked off based on global configuration if the global setting is less than 60 second + Expunge thread is not kicked off based on global configuration if the global setting is less than 60 seconds @@ -1659,7 +1659,7 @@ under the License. CLOUDSTACK-1109 - "Ipv6 - Unable to expunge User Vms that are ""Destroyed"". + "Ipv6 - Unable to expunge User Vms that are "Destroyed". @@ -1667,7 +1667,7 @@ under the License. CLOUDSTACK-1111 - Ipv6 - listRouters() does not return guestipaddress + Ipv6 - listRouters() does not return guestipaddress/ @@ -1675,7 +1675,7 @@ under the License. CLOUDSTACK-1112 - "Errors in ""Prepare the System VM Template"" + "Errors in "Prepare the System VM Template" @@ -1683,7 +1683,7 @@ under the License. CLOUDSTACK-1113 - "Ipv6 - Not able to deploy a new VM in this network because of ""Unable to allocate Unique Ipv6 address"" + "Ipv6 - Not able to deploy a new VM in this network because of "Unable to allocate Unique Ipv6 address" @@ -1691,7 +1691,7 @@ under the License. CLOUDSTACK-1114 - unable to execute listegressfirewallrules API due invalid value i + unable to execute listegressfirewallrules API due invalid value id @@ -1699,7 +1699,7 @@ under the License. CLOUDSTACK-1115 - In multiple shared network unable to login with default nic - KV + In multiple shared network unable to login with default nic - KVM @@ -1707,7 +1707,7 @@ under the License. CLOUDSTACK-1123 - ListStoragePools API broken by refacto + ListStoragePools API broken by refactor @@ -1739,7 +1739,7 @@ under the License. CLOUDSTACK-1152 - Missing tag in host-add.xm + Missing tag in host-add.xml @@ -1819,7 +1819,7 @@ under the License. CLOUDSTACK-1176 - Issue with snapshots(create/list + Issue with snapshots(create/list) @@ -1827,7 +1827,7 @@ under the License. CLOUDSTACK-1181 - mvn deploy db failing with NP + mvn deploy db failing with NPE @@ -2027,7 +2027,7 @@ under the License. CLOUDSTACK-1239 - Unable to registerISO :unhandled exception executing api command: registerIs + Unable to registerISO :unhandled exception executing api command: registerIso @@ -2051,7 +2051,7 @@ under the License. CLOUDSTACK-1242 - [F5-SRX-InlineMode] Failed to create LB rule with F5-SRX inlinemode deployemen + [F5-SRX-InlineMode] Failed to create LB rule with F5-SRX inlinemode deployment @@ -2179,7 +2179,7 @@ under the License. CLOUDSTACK-1278 - Improper permissions on injectkeys.s + Improper permissions on injectkeys.sh @@ -2195,7 +2195,7 @@ under the License. CLOUDSTACK-1289 - [F5-SRX-InlineMode] Usage stats are not generated for Juniper SRX Firewall in inlinemod + [F5-SRX-InlineMode] Usage stats are not generated for Juniper SRX Firewall in inlinemode @@ -2259,7 +2259,7 @@ under the License. CLOUDSTACK-1310 - ASF-build-master-nonoss-rhel63 - create advance zone FAIL - CreatePhysicalNetworkCmd FAIL - MySQLIntegrityConstraintViolationException: Duplicate entry '200-Public' for key 'physical_network_id + ASF-build-master-nonoss-rhel63 - create advance zone FAIL - CreatePhysicalNetworkCmd FAIL - MySQLIntegrityConstraintViolationException: Duplicate entry '200-Public' for key 'physical_network_id' @@ -2283,7 +2283,7 @@ under the License. CLOUDSTACK-1315 - [F5-SRX-InlineMode] Network implement failed with Run time Exception during network upgrade from VR to SRX-F + [F5-SRX-InlineMode] Network implement failed with Run time Exception during network upgrade from VR to SRX-F5 @@ -2443,7 +2443,7 @@ under the License. CLOUDSTACK-1347 - "Not able to delete network. Error - ""Unable to insert queue item into database, DB is full?"" + "Not able to delete network. Error - "Unable to insert queue item into database, DB is full?" @@ -2475,7 +2475,7 @@ under the License. CLOUDSTACK-1353 - KVM 6.3 snapshot Scheduling snapshot failed due to java.lang.NullPointerExceptio + KVM 6.3 snapshot Scheduling snapshot failed due to java.lang.NullPointerException @@ -2563,7 +2563,7 @@ under the License. CLOUDSTACK-1383 - Deploying basic zone on 4.1 fails in NP + Deploying basic zone on 4.1 fails in NPE @@ -2595,7 +2595,7 @@ under the License. CLOUDSTACK-1394 - [F5-SRX-InlineMode] Failure in static nat configuration on SRX does not result in LB configuration error in CS during LB rule configuratio + [F5-SRX-InlineMode] Failure in static nat configuration on SRX does not result in LB configuration error in CS during LB rule configuration @@ -2603,7 +2603,7 @@ under the License. CLOUDSTACK-1397 - Static Nat configuration is failing with NP + Static Nat configuration is failing with NPE @@ -2619,7 +2619,7 @@ under the License. CLOUDSTACK-1402 - listRouters API response doesn't return linklocal IP and public IP detail + listRouters API response doesn't return linklocal IP and public IP details @@ -2739,7 +2739,7 @@ under the License. CLOUDSTACK-1446 - [UI]VPC Router type should be of type vpc and not syste + [UI]VPC Router type should be of type vpc and not system @@ -2755,7 +2755,7 @@ under the License. CLOUDSTACK-1449 - listAccounts and listProjectAccounts API lists all the users not account-specific users for each account returne + listAccounts and listProjectAccounts API lists all the users not account-specific users for each account returned @@ -2763,7 +2763,7 @@ under the License. CLOUDSTACK-1451 - Getting EntityExistsException while creating more than one project in CS 4. + Getting EntityExistsException while creating more than one project in CS 4.1 @@ -2787,7 +2787,7 @@ under the License. CLOUDSTACK-1463 - IPV6 - Ubuntu 12.10 - Multiple Nic - IPV6 address is assigned automatically for 1 nic only. Need to do a manual dhclient request to get the ipv6 for other nic + IPV6 - Ubuntu 12.10 - Multiple Nic - IPV6 address is assigned automatically for 1 nic only. Need to do a manual dhclient request to get the ipv6 for other nic. @@ -2803,7 +2803,7 @@ under the License. CLOUDSTACK-1465 - List Zones returns null under create instance when logged is as use + List Zones returns null under create instance when logged is as user @@ -2811,7 +2811,7 @@ under the License. CLOUDSTACK-1467 - Failed to create Volume for the System Vm's + Failed to create Volume for the System VMs @@ -2819,7 +2819,7 @@ under the License. CLOUDSTACK-1469 - kvm agent: agent service fails to start u + kvm agent: agent service fails to start up @@ -2827,7 +2827,7 @@ under the License. CLOUDSTACK-1470 - unhandled exception executing api command: deployVirtualMachin + unhandled exception executing api command: deployVirtualMachine @@ -2835,7 +2835,7 @@ under the License. CLOUDSTACK-1472 - AssignVirtualMachine API with wrong Virtual Instance ID failed with NP + AssignVirtualMachine API with wrong Virtual Instance ID failed with NPE @@ -2843,7 +2843,7 @@ under the License. CLOUDSTACK-1473 - deleteDomain is failing with NP + deleteDomain is failing with NPE @@ -2867,7 +2867,7 @@ under the License. CLOUDSTACK-1484 - "API Throttling : api.throttling.enabled, Global setting missing + API Throttling : api.throttling.enabled, Global setting missing @@ -2875,7 +2875,7 @@ under the License. CLOUDSTACK-1485 - Add Baremetal Provider back to 4.1 branc + Add Baremetal Provider back to 4.1 branch @@ -2883,7 +2883,7 @@ under the License. CLOUDSTACK-1487 - cloudstack-setup-agent fails to set private.network.device on KVM host ad + cloudstack-setup-agent fails to set private.network.device on KVM host add @@ -2907,7 +2907,7 @@ under the License. CLOUDSTACK-1496 - List API Performance: listAccounts failing with OOME for high values of pagesize (>1000 + List API Performance: listAccounts failing with OOME for high values of pagesize (>1000) @@ -2915,7 +2915,7 @@ under the License. CLOUDSTACK-1499 - ListAPI Performance for few APIs not as good as it was before API optimizatio + ListAPI Performance for few APIs not as good as it was before API optimization @@ -2923,7 +2923,7 @@ under the License. CLOUDSTACK-1503 - listHypervisor API not getting fired when logged in as Use + listHypervisor API not getting fired when logged in as User @@ -2931,7 +2931,7 @@ under the License. CLOUDSTACK-1505 - Unknown column 'domain.region_id' in 'field list + Unknown column 'domain.region_id' in 'field list' @@ -2947,7 +2947,7 @@ under the License. CLOUDSTACK-1511 - [UI] Instances NIC details does not have Network Nam + [UI] Instances NIC details does not have Network Name @@ -2955,7 +2955,7 @@ under the License. CLOUDSTACK-1512 - [UI] Wrong message[message.configure.all.traffic.types] when trying to create zone with mulitple physical networks without providing the traffic labe + [UI] Wrong message[message.configure.all.traffic.types] when trying to create zone with mulitple physical networks without providing the traffic label @@ -2963,7 +2963,7 @@ under the License. CLOUDSTACK-1515 - None of the cloudstack packges are marked for upgrade when tried to upgrade from.4.0/4.0.1 to 4. + None of the cloudstack packges are marked for upgrade when tried to upgrade from.4.0/4.0.1 to 4.1 @@ -2971,7 +2971,7 @@ under the License. CLOUDSTACK-1516 - Create documentation in languages that have translations availabl + Create documentation in languages that have translations available @@ -2979,7 +2979,7 @@ under the License. CLOUDSTACK-1517 - Check UI in languages availabl + Check UI in languages available @@ -2987,7 +2987,7 @@ under the License. CLOUDSTACK-1521 - Redundant router: Services are not stopped when switch to BACKUP stat + Redundant router: Services are not stopped when switch to BACKUP state @@ -3003,7 +3003,7 @@ under the License. CLOUDSTACK-1531 - vmware create volume from snapshot will missing dat + vmware create volume from snapshot will missing date @@ -3011,7 +3011,7 @@ under the License. CLOUDSTACK-1537 - Restart network with clean up set to true causes Autoscaled LB rule to get mangled and unusabl + Restart network with clean up set to true causes Autoscaled LB rule to get mangled and unusable @@ -3019,7 +3019,7 @@ under the License. CLOUDSTACK-1541 - NPE while deleting snapshot :Unexpected exception while executing org.apache.cloudstack.api.command.user.snapshot.DeleteSnapshotCm + NPE while deleting snapshot :Unexpected exception while executing org.apache.cloudstack.api.command.user.snapshot.DeleteSnapshotCmd @@ -3027,7 +3027,7 @@ under the License. CLOUDSTACK-1542 - unhandled exception while creating projec + unhandled exception while creating project @@ -3035,7 +3035,7 @@ under the License. CLOUDSTACK-1544 - The description and the response format for the deleteUser command are incorrec + The description and the response format for the deleteUser command are incorrect @@ -3067,7 +3067,7 @@ under the License. CLOUDSTACK-1557 - EC2 REST API : cloudbridge database is missing on the CloudStack Installatio + EC2 REST API : cloudbridge database is missing on the CloudStack Installation @@ -3075,7 +3075,7 @@ under the License. CLOUDSTACK-1562 - Replace the short-cut solution of supportting @DB with the formal on + Replace the short-cut solution of supportting @DB with the formal one @@ -3091,7 +3091,7 @@ under the License. CLOUDSTACK-1566 - Baremetal API addBaremetalPxePingServer fail to add PXE PING server to deployment causing create instance with PING style image to fai + Baremetal API addBaremetalPxePingServer fail to add PXE PING server to deployment causing create instance with PING style image to fail @@ -3115,7 +3115,7 @@ under the License. CLOUDSTACK-1574 - updateResourceCount API is failed saying to specify valida resource type even after parsing the valid resource typ + updateResourceCount API is failed saying to specify valida resource type even after parsing the valid resource type @@ -3131,7 +3131,7 @@ under the License. CLOUDSTACK-1587 - "Basic zone - CPVM fail to go to running state, Exception while trying to start secondary storage vm + Basic zone - CPVM fail to go to running state, Exception while trying to start secondary storage vm @@ -3139,7 +3139,7 @@ under the License. CLOUDSTACK-1588 - "AWS Regions - When registerUserKeys() is called for a user from a region that is not the owner, it is handled by this region. + AWS Regions - When registerUserKeys() is called for a user from a region that is not the owner, it is handled by this region. @@ -3147,7 +3147,7 @@ under the License. CLOUDSTACK-1600 - Typo in dpkg-buildpackage comman + Typo in dpkg-buildpackage command @@ -3155,7 +3155,7 @@ under the License. CLOUDSTACK-1604 - "deploy VM failed when global setting ""vm.allocation.algorithm"" is set to ""userdispersing"" + deploy VM failed when global setting "vm.allocation.algorithm" is set to "userdispersing @@ -3171,7 +3171,7 @@ under the License. CLOUDSTACK-1620 - Cannot provision CentOS 6 VMs on XenServer 6. + Cannot provision CentOS 6 VMs on XenServer 6.1 @@ -3187,7 +3187,7 @@ under the License. CLOUDSTACK-1624 - API is not returning response in details:UI is also not returning any outpu + API is not returning response in details:UI is also not returning any output @@ -3195,7 +3195,7 @@ under the License. CLOUDSTACK-1625 - NPE with updateResourceCount when && is passed thru AP + NPE with updateResourceCount when && is passed thru API @@ -3211,7 +3211,7 @@ under the License. CLOUDSTACK-1631 - 4.1 RPM packaging broke + 4.1 RPM packaging broken @@ -3227,7 +3227,7 @@ under the License. CLOUDSTACK-1642 - Add support CentOS 6. + Add support CentOS 6.4 @@ -3235,7 +3235,7 @@ under the License. CLOUDSTACK-1648 - Unable to add KVM hos + Unable to add KVM host. @@ -3243,7 +3243,7 @@ under the License. CLOUDSTACK-1649 - vmware vm os type erro + vmware vm os type error @@ -3259,7 +3259,7 @@ under the License. CLOUDSTACK-1656 - NicResponses in a UserVmResponse are not preseving the natural order + NicResponses in a UserVmResponse are not preserving the natural order @@ -3291,7 +3291,7 @@ under the License. CLOUDSTACK-1666 - KVM VPC NetworkUsage doesnot wor + KVM VPC NetworkUsage does not work @@ -3299,7 +3299,7 @@ under the License. CLOUDSTACK-1668 - IP conflict in VPC tie + IP conflict in VPC tier @@ -3347,7 +3347,7 @@ under the License. CLOUDSTACK-1690 - NPE from API server when starting mgmt serve + NPE from API server when starting mgmt server @@ -3355,7 +3355,7 @@ under the License. CLOUDSTACK-1694 - Issues to start/access Management Server after upgrade from 4.0 to 4. + Issues to start/access Management Server after upgrade from 4.0 to 4.1 @@ -3363,7 +3363,7 @@ under the License. CLOUDSTACK-1697 - Six DB tables are not available with upgraded setup(4.0 to 4.1) when compare to 4.1 newly installatio + Six DB tables are not available with upgraded setup(4.0 to 4.1) when compare to 4.1 newly installation @@ -3371,7 +3371,7 @@ under the License. CLOUDSTACK-1706 - "Failed to deploy VM with error ""cannot find DeployPlannerSelector"" + Failed to deploy VM with error "cannot find DeployPlannerSelector" @@ -3379,7 +3379,7 @@ under the License. CLOUDSTACK-1709 - "AWS Regions - As part of adding a new region, project related entries should not be synced from accounts table. + AWS Regions - As part of adding a new region, project related entries should not be synced from accounts table. @@ -3387,7 +3387,7 @@ under the License. CLOUDSTACK-1710 - "AWS Regions - As part of adding a new region,default_zone_id column for the account entries should not be synced. + AWS Regions - As part of adding a new region,default_zone_id column for the account entries should not be synced. @@ -3443,7 +3443,7 @@ under the License. CLOUDSTACK-1719 - EC2 REST API: AWS APIs are not getting translated on the CloudStack Management Serve + EC2 REST API: AWS APIs are not getting translated on the CloudStack Management Server @@ -3451,7 +3451,7 @@ under the License. CLOUDSTACK-1720 - Have an upgrade path from 4.0.x to 4.1 and 4.0.x to 4.2. + Have an upgrade path from 4.0.x to 4.1 and 4.0.x to 4.2.0 @@ -3459,7 +3459,7 @@ under the License. CLOUDSTACK-1729 - Ensure adapter execution order in runtim + Ensure adapter execution order in runtime @@ -3475,7 +3475,7 @@ under the License. CLOUDSTACK-1736 - Ubuntu 12.04 cloud-setup-management Failed to configure CloudStack Management Serve + Ubuntu 12.04 cloud-setup-management Failed to configure CloudStack Management Server @@ -3483,7 +3483,7 @@ under the License. CLOUDSTACK-1738 - StatsCollector is not runnin + StatsCollector is not running @@ -3491,7 +3491,7 @@ under the License. CLOUDSTACK-1740 - Failed to view consol + Failed to view console @@ -3499,7 +3499,7 @@ under the License. CLOUDSTACK-1746 - Cloudstack Usage Server won't star + Cloudstack Usage Server won't start @@ -3659,7 +3659,7 @@ under the License. CLOUDSTACK-1812 - create physical network fails while creating basic zon + create physical network fails while creating basic zone @@ -3667,7 +3667,7 @@ under the License. CLOUDSTACK-1825 - EC2 REST API: AWS APIs fail to execute due to BeanCreationException: Error creating bean with name 'SAclDaoImpl + EC2 REST API: AWS APIs fail to execute due to BeanCreationException: Error creating bean with name 'SAclDaoImpl' @@ -3739,7 +3739,7 @@ under the License. CLOUDSTACK-1845 - KVM - storage migration often fail. + KVM - storage migration often fails @@ -3763,7 +3763,7 @@ under the License. CLOUDSTACK-1856 - Upgrade 4.0 -> 4.1 - Fresh install of 4.1 has 3 parameters missing in db.properties compared to an upgraded 4.0 set up + Upgrade 4.0 -> 4.1 - Fresh install of 4.1 has 3 parameters missing in db.properties compared to an upgraded 4.0 setup @@ -3811,7 +3811,7 @@ under the License. CLOUDSTACK-1890 - listProjects is not listing state in the respons + listProjects is not listing state in the response @@ -3827,7 +3827,7 @@ under the License. CLOUDSTACK-1929 - ASF 4.1 cloudstack agent fail to install in KVM host CENTOS 6.3 OS: qemu-kvm-0.12.1.2-3.295.el6.10.x86_64 requires libusbredirparser.so. + ASF 4.1 cloudstack agent fail to install in KVM host CENTOS 6.3 OS: qemu-kvm-0.12.1.2-3.295.el6.10.x86_64 requires libusbredirparser.so.0 @@ -3835,7 +3835,7 @@ under the License. CLOUDSTACK-1934 - NPE with listSupportedNetworkServices after upgrade from 4.0 to 4.1 (Ubuntu MS + NPE with listSupportedNetworkServices after upgrade from 4.0 to 4.1 (Ubuntu MS) @@ -3843,7 +3843,7 @@ under the License. CLOUDSTACK-1935 - Cloud utilities are not renamed to Cloudstack after upgrade from 4.0 to 4.1 [Ubutnu MS + Cloud utilities are not renamed to Cloudstack after upgrade from 4.0 to 4.1 [Ubutnu MS] @@ -3907,7 +3907,7 @@ under the License. CLOUDSTACK-1988 - AWS API using SOAP client - User Registeration fails + AWS API using SOAP client - User Registration fails @@ -3934,10 +3934,6 @@ under the License. Release Notes failing to build on jenkins.cs. - - CS-16135 - Creating volumes after upgrading from snapshot taken in 2.2.14 no longer deletes the snapshot physically from the secondary storage. - From 77ccc2272380567fff50ab831f3bd02428d5d8f4 Mon Sep 17 00:00:00 2001 From: Prachi Damle Date: Tue, 16 Apr 2013 14:28:55 -0700 Subject: [PATCH 07/31] Pulling back the changes to ServiceOffering to add a planner - these changes will be part of a separate feature branch --- .../com/cloud/server/ManagementService.java | 2 - .../apache/cloudstack/api/ApiConstants.java | 1 - .../config/ListDeploymentPlannersCmd.java | 71 ------------------- .../offering/CreateServiceOfferingCmd.java | 6 -- .../configuration/ConfigurationManager.java | 3 +- .../ConfigurationManagerImpl.java | 6 +- .../cloud/server/ManagementServerImpl.java | 19 ----- .../com/cloud/service/ServiceOfferingVO.java | 23 ------ .../vpc/MockConfigurationManagerImpl.java | 2 +- setup/db/db/schema-410to420.sql | 1 - 10 files changed, 5 insertions(+), 129 deletions(-) delete mode 100644 api/src/org/apache/cloudstack/api/command/admin/config/ListDeploymentPlannersCmd.java diff --git a/api/src/com/cloud/server/ManagementService.java b/api/src/com/cloud/server/ManagementService.java index 6e6dbc36f0c..460357b3c97 100755 --- a/api/src/com/cloud/server/ManagementService.java +++ b/api/src/com/cloud/server/ManagementService.java @@ -407,6 +407,4 @@ public interface ManagementService { */ List listTopConsumedResources(ListCapacityCmd cmd); - List listDeploymentPlanners(); - } diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java index 37cb59f3758..cb4d43e6e46 100755 --- a/api/src/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/org/apache/cloudstack/api/ApiConstants.java @@ -475,7 +475,6 @@ public class ApiConstants { public static final String HEALTHCHECK_PINGPATH = "pingpath"; public static final String AFFINITY_GROUP_IDS = "affinitygroupids"; public static final String AFFINITY_GROUP_NAMES = "affinitygroupnames"; - public static final String DEPLOYMENT_PLANNER = "deploymentplanner"; public static final String ASA_INSIDE_PORT_PROFILE = "insideportprofile"; public enum HostDetails { diff --git a/api/src/org/apache/cloudstack/api/command/admin/config/ListDeploymentPlannersCmd.java b/api/src/org/apache/cloudstack/api/command/admin/config/ListDeploymentPlannersCmd.java deleted file mode 100644 index 69004de2a6b..00000000000 --- a/api/src/org/apache/cloudstack/api/command/admin/config/ListDeploymentPlannersCmd.java +++ /dev/null @@ -1,71 +0,0 @@ -// 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 -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package org.apache.cloudstack.api.command.admin.config; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.cloudstack.api.APICommand; -import org.apache.cloudstack.api.BaseListCmd; -import org.apache.cloudstack.api.response.DeploymentPlannersResponse; -import org.apache.cloudstack.api.response.ListResponse; -import org.apache.log4j.Logger; - -@APICommand(name = "listDeploymentPlanners", description = "Lists all DeploymentPlanners available.", responseObject = DeploymentPlannersResponse.class) -public class ListDeploymentPlannersCmd extends BaseListCmd { - public static final Logger s_logger = Logger.getLogger(ListDeploymentPlannersCmd.class.getName()); - - private static final String s_name = "listdeploymentplannersresponse"; - - ///////////////////////////////////////////////////// - //////////////// API parameters ///////////////////// - ///////////////////////////////////////////////////// - - - ///////////////////////////////////////////////////// - /////////////////// Accessors /////////////////////// - ///////////////////////////////////////////////////// - - - ///////////////////////////////////////////////////// - /////////////// API Implementation/////////////////// - ///////////////////////////////////////////////////// - - @Override - public String getCommandName() { - return s_name; - } - - @Override - public void execute(){ - List planners = _mgr.listDeploymentPlanners(); - ListResponse response = new ListResponse(); - List plannerResponses = new ArrayList(); - - for (String planner : planners) { - DeploymentPlannersResponse plannerResponse = new DeploymentPlannersResponse(); - plannerResponse.setName(planner); - plannerResponse.setObjectName("deploymentPlanner"); - plannerResponses.add(plannerResponse); - } - - response.setResponses(plannerResponses); - response.setResponseName(getCommandName()); - this.setResponseObject(response); - - } -} diff --git a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java index 74392cd4299..0e35276d914 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java @@ -84,9 +84,6 @@ public class CreateServiceOfferingCmd extends BaseCmd { @Parameter(name=ApiConstants.NETWORKRATE, type=CommandType.INTEGER, description="data transfer rate in megabits per second allowed. Supported only for non-System offering and system offerings having \"domainrouter\" systemvmtype") private Integer networkRate; - @Parameter(name = ApiConstants.DEPLOYMENT_PLANNER, type = CommandType.STRING, description = "The deployment planner heuristics used to deploy a VM of this offering, default \"FirstFitPlanner\".") - private String deploymentPlanner; - ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// @@ -151,9 +148,6 @@ public class CreateServiceOfferingCmd extends BaseCmd { return networkRate; } - public String getDeploymentPlanner() { - return deploymentPlanner; - } ///////////////////////////////////////////////////// /////////////// API Implementation/////////////////// diff --git a/server/src/com/cloud/configuration/ConfigurationManager.java b/server/src/com/cloud/configuration/ConfigurationManager.java index d7faf19fd28..afaf0d6a2e5 100755 --- a/server/src/com/cloud/configuration/ConfigurationManager.java +++ b/server/src/com/cloud/configuration/ConfigurationManager.java @@ -79,11 +79,10 @@ public interface ConfigurationManager extends ConfigurationService, Manager { * TODO * @param id * @param useVirtualNetwork - * @param deploymentPlanner * @return ID */ ServiceOfferingVO createServiceOffering(long userId, boolean isSystem, VirtualMachine.Type vm_typeType, String name, int cpu, int ramSize, int speed, String displayText, boolean localStorageRequired, - boolean offerHA, boolean limitResourceUse, boolean volatileVm, String tags, Long domainId, String hostTag, Integer networkRate, String deploymentPlanner); + boolean offerHA, boolean limitResourceUse, boolean volatileVm, String tags, Long domainId, String hostTag, Integer networkRate); /** * Creates a new disk offering diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index cb780eab6c8..3551295c2d7 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -1823,16 +1823,16 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati } return createServiceOffering(userId, cmd.getIsSystem(), vmType, cmd.getServiceOfferingName(), cpuNumber.intValue(), memory.intValue(), cpuSpeed.intValue(), cmd.getDisplayText(), - localStorageRequired, offerHA, limitCpuUse, volatileVm, cmd.getTags(), cmd.getDomainId(), cmd.getHostTag(), cmd.getNetworkRate(), cmd.getDeploymentPlanner()); + localStorageRequired, offerHA, limitCpuUse, volatileVm, cmd.getTags(), cmd.getDomainId(), cmd.getHostTag(), cmd.getNetworkRate()); } @Override @ActionEvent(eventType = EventTypes.EVENT_SERVICE_OFFERING_CREATE, eventDescription = "creating service offering") public ServiceOfferingVO createServiceOffering(long userId, boolean isSystem, VirtualMachine.Type vm_type, String name, int cpu, int ramSize, int speed, String displayText, - boolean localStorageRequired, boolean offerHA, boolean limitResourceUse, boolean volatileVm, String tags, Long domainId, String hostTag, Integer networkRate, String deploymentPlanner) { + boolean localStorageRequired, boolean offerHA, boolean limitResourceUse, boolean volatileVm, String tags, Long domainId, String hostTag, Integer networkRate) { tags = cleanupTags(tags); ServiceOfferingVO offering = new ServiceOfferingVO(name, cpu, ramSize, speed, networkRate, null, offerHA, limitResourceUse, volatileVm, displayText, localStorageRequired, false, tags, isSystem, vm_type, - domainId, hostTag, deploymentPlanner); + domainId, hostTag); if ((offering = _serviceOfferingDao.persist(offering)) != null) { UserContext.current().setEventDetails("Service offering id=" + offering.getId()); diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index 5ed0c923cc0..98f789a720a 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -392,14 +392,6 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe private List _userAuthenticators; private List _userPasswordEncoders; - protected List _planners; - public List getPlanners() { - return _planners; - } - public void setPlanners(List _planners) { - this._planners = _planners; - } - @Inject ClusterManager _clusterMgr; private String _hashKey = null; private String _encryptionKey = null; @@ -3386,15 +3378,4 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe } } - - @Override - public List listDeploymentPlanners() { - List plannersAvailable = new ArrayList(); - for (DeploymentPlanner planner : _planners) { - plannersAvailable.add(planner.getName()); - } - - return plannersAvailable; - } - } diff --git a/server/src/com/cloud/service/ServiceOfferingVO.java b/server/src/com/cloud/service/ServiceOfferingVO.java index a3da904688c..94a73515e6a 100755 --- a/server/src/com/cloud/service/ServiceOfferingVO.java +++ b/server/src/com/cloud/service/ServiceOfferingVO.java @@ -68,9 +68,6 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering @Column(name="sort_key") int sortKey; - @Column(name = "deployment_planner") - private String deploymentPlanner = "FirstFitPlanner"; - protected ServiceOfferingVO() { super(); } @@ -87,7 +84,6 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering this.volatileVm = false; this.default_use = defaultUse; this.vm_type = vm_type == null ? null : vm_type.toString().toLowerCase(); - this.deploymentPlanner = "FirstFitPlanner"; } public ServiceOfferingVO(String name, int cpu, int ramSize, int speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, boolean limitCpuUse, boolean volatileVm, String displayText, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vm_type, Long domainId) { @@ -101,26 +97,11 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering this.limitCpuUse = limitCpuUse; this.volatileVm = volatileVm; this.vm_type = vm_type == null ? null : vm_type.toString().toLowerCase(); - this.deploymentPlanner = "FirstFitPlanner"; } public ServiceOfferingVO(String name, int cpu, int ramSize, int speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, boolean limitResourceUse, boolean volatileVm, String displayText, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vm_type, Long domainId, String hostTag) { this(name, cpu, ramSize, speed, rateMbps, multicastRateMbps, offerHA, limitResourceUse, volatileVm, displayText, useLocalStorage, recreatable, tags, systemUse, vm_type, domainId); this.hostTag = hostTag; - this.deploymentPlanner = "FirstFitPlanner"; - } - - public ServiceOfferingVO(String name, int cpu, int ramSize, int speed, Integer rateMbps, Integer multicastRateMbps, - boolean offerHA, boolean limitResourceUse, boolean volatileVm, String displayText, boolean useLocalStorage, - boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vm_type, Long domainId, - String hostTag, String deploymentPlanner) { - this(name, cpu, ramSize, speed, rateMbps, multicastRateMbps, offerHA, limitResourceUse, volatileVm, - displayText, useLocalStorage, recreatable, tags, systemUse, vm_type, domainId, hostTag); - if (deploymentPlanner != null) { - this.deploymentPlanner = deploymentPlanner; - } else { - this.deploymentPlanner = "FirstFitPlanner"; - } } @Override @@ -227,8 +208,4 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering return volatileVm; } - public String getDeploymentPlanner() { - return deploymentPlanner; - } - } diff --git a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java index a03e361d8c1..9443815dc87 100755 --- a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java +++ b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java @@ -435,7 +435,7 @@ public class MockConfigurationManagerImpl extends ManagerBase implements Configu */ @Override public ServiceOfferingVO createServiceOffering(long userId, boolean isSystem, Type vm_typeType, String name, int cpu, int ramSize, int speed, String displayText, boolean localStorageRequired, boolean offerHA, - boolean limitResourceUse, boolean volatileVm, String tags, Long domainId, String hostTag, Integer networkRate, String deploymentPlanner) { + boolean limitResourceUse, boolean volatileVm, String tags, Long domainId, String hostTag, Integer networkRate) { // TODO Auto-generated method stub return null; } diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql index 79a2279eac1..6a7a72c5d2d 100644 --- a/setup/db/db/schema-410to420.sql +++ b/setup/db/db/schema-410to420.sql @@ -167,7 +167,6 @@ CREATE TABLE `cloud`.`affinity_group_vm_map` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -ALTER TABLE `cloud`.`service_offering` ADD COLUMN `deployment_planner` varchar(255) NOT NULL DEFAULT 'FirstFitPlanner' COMMENT 'Planner heuristics used to deploy a VM of this offering'; CREATE TABLE nic_secondary_ips ( `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT, From b910c2b245b62017ef296fcaab0f64147e4d9f9d Mon Sep 17 00:00:00 2001 From: Prachi Damle Date: Tue, 16 Apr 2013 15:15:53 -0700 Subject: [PATCH 08/31] Removing unused bean property --- client/tomcatconf/applicationContext.xml.in | 1 - 1 file changed, 1 deletion(-) diff --git a/client/tomcatconf/applicationContext.xml.in b/client/tomcatconf/applicationContext.xml.in index 866e3ed3291..7487a5ebbfc 100644 --- a/client/tomcatconf/applicationContext.xml.in +++ b/client/tomcatconf/applicationContext.xml.in @@ -609,7 +609,6 @@ - From 32ccb8a5c9a4ca8495d27776ec234c46cc1e5e73 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 16 Apr 2013 15:37:47 -0700 Subject: [PATCH 09/31] CLOUDSTACK-1910: cloudstack UI - Regions menu - GSLB - add "load balancer rules assigned to this GSLB" section. --- ui/scripts/regions.js | 109 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 107 insertions(+), 2 deletions(-) diff --git a/ui/scripts/regions.js b/ui/scripts/regions.js index 2cfb0fee172..d8e0db02a82 100644 --- a/ui/scripts/regions.js +++ b/ui/scripts/regions.js @@ -382,7 +382,7 @@ detailView: { name: 'GSLB details', - //viewAll: { path: 'storage.snapshots', label: 'label.snapshots' }, + viewAll: { path: 'regions.lbUnderGSLB', label: 'load balancer rules' }, actions: { remove: { label: 'delete GSLB', @@ -450,7 +450,112 @@ } } } - } + }, + + //??? + lbUnderGSLB: { + id: 'lbUnderGSLB', + type: 'select', + title: 'load balancer rules assigned to this GSLB', + listView: { + section: 'lbUnderGSLB', + id: 'lbUnderGSLB', + label: 'load balancer rules assigned to this GSLB', + fields: { + name: { label: 'label.name' }, + publicport: { label: 'label.public.port' }, + privateport: { label: 'label.private.port' }, + algorithm: { label: 'label.algorithm' } + }, + dataProvider: function(args) { + var data = { + globalloadbalancerruleid: args.context.GSLB[0].id, + listAll: true + }; + $.ajax({ + url: createURL('listLoadBalancerRules'), + data: data, + success: function(json) { + var items = json.listloadbalancerrulesresponse.loadbalancerrule; + args.response.success({ + data: items + }); + } + }); + }, + detailView: { + name: 'load balancer rule details', + actions: { + remove: { + label: 'remove load balancer rule from this GSLB', + messages: { + notification: function() { + return 'remove load balancer rule from GSLB'; + }, + confirm: function() { + return 'Please confirm you want to remove load balancer rule from GSLB'; + } + }, + action: function(args) { + $.ajax({ + url: createURL('removeFromGlobalLoadBalancerRule'), + data: { + id: args.context.lbUnderGSLB[0].id + }, + success: function(json) { + var jid = json.removefromloadbalancerruleresponse.jobid; + args.response.success({ + _custom: { + jobId: jid + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + }, + tabs: { + details: { + title: 'label.details', + fields: [ + { + name: { label: 'label.name' } + }, + { + publicport: { label: 'label.public.port' }, + privateport: { label: 'label.private.port' }, + algorithm: { label: 'label.algorithm' }, + publicip: { label: 'label.public.ip' }, + id: { label: 'label.id' }, + cidrlist: { label: 'label.cidr' }, + domain: { label: 'label.domain' }, + account: { label: 'label.account' }, + state: { label: 'label.state' } + } + ], + dataProvider: function(args) { + $.ajax({ + url: createURL('listLoadBalancerRules'), + data: { + id: args.context.lbUnderGSLB[0].id + }, + success: function(json) { + var item = json.listloadbalancerrulesresponse.loadbalancerrule[0]; + args.response.success({ + data: item + }); + } + }); + } + } + } + } + } + } + //??? } }; From 4b636a10aaa49d3f1908b524ec98ff25e51c80b3 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 16 Apr 2013 16:26:20 -0700 Subject: [PATCH 10/31] CLOUDSTACK-1910: cloudstack UI - Regions menu - GSLB - load balancer rules - implement "Assign load balancer rule to GSLB" action. --- ui/scripts/regions.js | 82 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 72 insertions(+), 10 deletions(-) diff --git a/ui/scripts/regions.js b/ui/scripts/regions.js index d8e0db02a82..ef6f976b014 100644 --- a/ui/scripts/regions.js +++ b/ui/scripts/regions.js @@ -451,16 +451,15 @@ } } }, - - //??? + lbUnderGSLB: { id: 'lbUnderGSLB', type: 'select', - title: 'load balancer rules assigned to this GSLB', + title: 'assigned load balancer rules', listView: { section: 'lbUnderGSLB', id: 'lbUnderGSLB', - label: 'load balancer rules assigned to this GSLB', + label: 'assigned load balancer rules', fields: { name: { label: 'label.name' }, publicport: { label: 'label.public.port' }, @@ -482,7 +481,71 @@ }); } }); - }, + }, + actions: { + add: { + label: 'assign load balancer rule to GSLB', + messages: { + confirm: function(args) { + return 'Please confirm you want to assign load balancer rule to GSLB'; + }, + notification: function(args) { + return 'assign load balancer rule to GSLB'; + } + }, + createForm: { + title: 'assign load balancer rule to GSLB', + fields: { + loadbalancerrule: { + label: 'load balancer rule', + select: function(args) { + var data = { + globalloadbalancerruleid: args.context.GSLB[0].id, + listAll: true + }; + $.ajax({ + url: createURL('listLoadBalancerRules'), + data: data, + success: function(json) { + var items = json.listloadbalancerrulesresponse.loadbalancerrule; + args.response.success({ + data: items, + descriptionField: 'name' + }); + } + }); + } + } + } + }, + action: function(args) { + var data = { + id: args.context.GSLB[0].id, + loadbalancerrulelist: args.data.loadbalancerrule + }; + $.ajax({ + url: createURL('assignToGlobalLoadBalancerRule'), + data: data, + success: function(json) { + var jid = json.assigntogloballoadbalancerruleresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.loadbalancerrule; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + }, + detailView: { name: 'load balancer rule details', actions: { @@ -528,12 +591,12 @@ publicport: { label: 'label.public.port' }, privateport: { label: 'label.private.port' }, algorithm: { label: 'label.algorithm' }, - publicip: { label: 'label.public.ip' }, + publicip: { label: 'label.public.ip' }, + state: { label: 'label.state' }, id: { label: 'label.id' }, cidrlist: { label: 'label.cidr' }, domain: { label: 'label.domain' }, - account: { label: 'label.account' }, - state: { label: 'label.state' } + account: { label: 'label.account' } } ], dataProvider: function(args) { @@ -554,8 +617,7 @@ } } } - } - //??? + } } }; From d5776d91eae698c995121e990729a79998f70dde Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 16 Apr 2013 17:40:21 -0700 Subject: [PATCH 11/31] CLOUDSTACK-1910: cloudstack UI - zone wizard - add Netscaler device step - add 3 new fields: "GSLB service", "GSLB service Public IP", "GSLB service Private IP". --- ui/scripts/zoneWizard.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js index 8add9bb085e..08cadd0913e 100755 --- a/ui/scripts/zoneWizard.js +++ b/ui/scripts/zoneWizard.js @@ -653,7 +653,18 @@ }, privateinterface: { label: 'label.private.interface' + }, + gslbprovider: { + label: 'GSLB service', + isBoolean: true, + isChecked: true }, + gslbproviderpublicip: { + label: 'GSLB service Public IP' + }, + gslbproviderprivateip: { + label: 'GSLB service Private IP' + }, numretries: { label: 'label.numretries', defaultValue: '2' @@ -2593,7 +2604,10 @@ array1.push("&physicalnetworkid=" + args.data.returnedBasicPhysicalNetwork.id); array1.push("&username=" + todb(args.data.basicPhysicalNetwork.username)); array1.push("&password=" + todb(args.data.basicPhysicalNetwork.password)); - array1.push("&networkdevicetype=" + todb(args.data.basicPhysicalNetwork.networkdevicetype)); + array1.push("&networkdevicetype=" + todb(args.data.basicPhysicalNetwork.networkdevicetype)); + array1.push("&gslbprovider=" + (args.data.basicPhysicalNetwork.gslbprovider == "on")); + array1.push("&gslbproviderpublicip=" + todb(args.data.basicPhysicalNetwork.gslbproviderpublicip)); + array1.push("&gslbproviderprivateip=" + todb(args.data.basicPhysicalNetwork.gslbproviderprivateip)); //construct URL starts here var url = []; From f0d6776225530232b91ed03f33f60886cebdd84c Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 16 Apr 2013 18:17:58 -0700 Subject: [PATCH 12/31] CLOUDSTACK-1910: cloudstack UI - zone detail - physical network - network service providers - NetScaler - add Netscaler device dialog - add 3 new fields: "GSLB service", "GSLB service Public IP", "GSLB service Private IP". --- ui/scripts/system.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index a9054125774..dbe177a9e23 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -3264,6 +3264,19 @@ label: 'label.private.interface', docID: 'helpNetScalerPrivateInterface' }, + + gslbprovider: { + label: 'GSLB service', + isBoolean: true, + isChecked: true + }, + gslbproviderpublicip: { + label: 'GSLB service Public IP' + }, + gslbproviderprivateip: { + label: 'GSLB service Private IP' + }, + numretries: { label: 'label.numretries', defaultValue: '2', @@ -6644,6 +6657,19 @@ privateinterface: { label: 'label.private.interface' }, + + gslbprovider: { + label: 'GSLB service', + isBoolean: true, + isChecked: true + }, + gslbproviderpublicip: { + label: 'GSLB service Public IP' + }, + gslbproviderprivateip: { + label: 'GSLB service Private IP' + }, + numretries: { label: 'label.numretries', defaultValue: '2' @@ -10708,6 +10734,12 @@ array1.push("&username=" + todb(args.data.username)); array1.push("&password=" + todb(args.data.password)); array1.push("&networkdevicetype=" + todb(args.data.networkdevicetype)); + + if(apiCmd == "addNetscalerLoadBalancer") { + array1.push("&gslbprovider=" + (args.data.gslbprovider == "on")); + array1.push("&gslbproviderpublicip=" + todb(args.data.gslbproviderpublicip)); + array1.push("&gslbproviderprivateip=" + todb(args.data.gslbproviderprivateip)); + } //construct URL starts here var url = []; From 2057221f4f1fd5afde422b367fc416d4e44275cb Mon Sep 17 00:00:00 2001 From: Marcus Sorensen Date: Tue, 16 Apr 2013 22:18:38 -0600 Subject: [PATCH 13/31] CLOUDSTACK-2051 - The previous patch ensures that holes in deleting storage pools the proper way won't cause problems for KVM HA Monitor, this patch closes holes. Call the KVMStoragePool deleteStoragePool that properly removes it from the KVMHA hashmap, instead of the pools direct delete() call. Signed-off-by: Marcus Sorensen 1366172318 -0600 --- .../resource/LibvirtComputingResource.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java index 362e0a53e53..3de7a485fa5 100755 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -1270,7 +1270,7 @@ ServerResource { secondaryStoragePool = _storagePoolMgr.getStoragePoolByURI( secondaryStorageUrl); secondaryStoragePool.createFolder(volumeDestPath); - secondaryStoragePool.delete(); + _storagePoolMgr.deleteStoragePool(secondaryStoragePool.getType(),secondaryStoragePool.getUuid()); secondaryStoragePool = _storagePoolMgr.getStoragePoolByURI( secondaryStorageUrl + volumeDestPath); @@ -1292,7 +1292,7 @@ ServerResource { return new CopyVolumeAnswer(cmd, false, e.toString(), null, null); } finally { if (secondaryStoragePool != null) { - secondaryStoragePool.delete(); + _storagePoolMgr.deleteStoragePool(secondaryStoragePool.getType(),secondaryStoragePool.getUuid()); } } } @@ -1415,7 +1415,7 @@ ServerResource { return null; } finally { if (secondaryPool != null) { - secondaryPool.delete(); + _storagePoolMgr.deleteStoragePool(secondaryPool.getType(),secondaryPool.getUuid()); } } } @@ -2008,7 +2008,7 @@ ServerResource { true); } finally { if (secondaryStoragePool != null) { - secondaryStoragePool.delete(); + _storagePoolMgr.deleteStoragePool(secondaryStoragePool.getType(),secondaryStoragePool.getUuid()); } } return new BackupSnapshotAnswer(cmd, true, null, snapshotRelPath @@ -2040,7 +2040,7 @@ ServerResource { return new DeleteSnapshotBackupAnswer(cmd, false, e.toString()); } finally { if (secondaryStoragePool != null) { - secondaryStoragePool.delete(); + _storagePoolMgr.deleteStoragePool(secondaryStoragePool.getType(),secondaryStoragePool.getUuid()); } } return new DeleteSnapshotBackupAnswer(cmd, true, null); @@ -2069,7 +2069,7 @@ ServerResource { return new Answer(cmd, false, e.toString()); } finally { if (secondaryStoragePool != null) { - secondaryStoragePool.delete(); + _storagePoolMgr.deleteStoragePool(secondaryStoragePool.getType(),secondaryStoragePool.getUuid()); } } @@ -2167,10 +2167,10 @@ ServerResource { return new CreatePrivateTemplateAnswer(cmd, false, e.getMessage()); } finally { if (secondaryPool != null) { - secondaryPool.delete(); + _storagePoolMgr.deleteStoragePool(secondaryPool.getType(), secondaryPool.getUuid()); } if (snapshotPool != null) { - snapshotPool.delete(); + _storagePoolMgr.deleteStoragePool(snapshotPool.getType(), snapshotPool.getUuid()); } } } @@ -2304,7 +2304,7 @@ ServerResource { return new CreatePrivateTemplateAnswer(cmd, false, e.toString()); } finally { if (secondaryStorage != null) { - secondaryStorage.delete(); + _storagePoolMgr.deleteStoragePool(secondaryStorage.getType(), secondaryStorage.getUuid()); } } } @@ -2362,7 +2362,7 @@ ServerResource { return new PrimaryStorageDownloadAnswer(e.toString()); } finally { if (secondaryPool != null) { - secondaryPool.delete(); + _storagePoolMgr.deleteStoragePool(secondaryPool.getType(),secondaryPool.getUuid()); } } } @@ -3454,7 +3454,7 @@ ServerResource { KVMStoragePool pool = _storagePoolMgr.getStoragePool( StoragePoolType.Filesystem, poolUuid); if (pool != null) { - pool.delete(); + _storagePoolMgr.deleteStoragePool(pool.getType(),pool.getUuid()); } return true; } catch (CloudRuntimeException e) { From 8b40e393b845c4c3d7ca23c8e297dc43288f6863 Mon Sep 17 00:00:00 2001 From: Bharat Kumar Date: Tue, 16 Apr 2013 20:04:46 +0530 Subject: [PATCH 14/31] Cloudstack-701 Support for non contiguous vlan ranges. Signed-off-by: Abhinandan Prateek --- api/src/com/cloud/network/NetworkService.java | 2 +- .../com/cloud/network/PhysicalNetwork.java | 5 +- .../apache/cloudstack/api/ApiConstants.java | 1 + .../network/UpdatePhysicalNetworkCmd.java | 8 +- .../src/com/cloud/api/ApiResponseHelper.java | 2 +- .../ConfigurationManagerImpl.java | 2 +- .../com/cloud/dc/dao/DataCenterVnetDao.java | 6 + .../cloud/dc/dao/DataCenterVnetDaoImpl.java | 50 ++- .../ExternalFirewallDeviceManagerImpl.java | 14 +- .../com/cloud/network/NetworkServiceImpl.java | 297 +++++++++++++----- .../cloud/network/dao/PhysicalNetworkVO.java | 20 +- .../cloud/network/guru/GuestNetworkGuru.java | 14 +- .../cloud/network/MockNetworkManagerImpl.java | 2 +- .../network/UpdatePhysicalNetworkTest.java | 68 ++++ .../com/cloud/vpc/MockNetworkManagerImpl.java | 2 +- .../smoke/test_non_contigiousvlan.py | 125 ++++++++ 16 files changed, 516 insertions(+), 102 deletions(-) create mode 100644 server/test/com/cloud/network/UpdatePhysicalNetworkTest.java create mode 100644 test/integration/smoke/test_non_contigiousvlan.py diff --git a/api/src/com/cloud/network/NetworkService.java b/api/src/com/cloud/network/NetworkService.java index 066009b8b75..5a6054da23b 100755 --- a/api/src/com/cloud/network/NetworkService.java +++ b/api/src/com/cloud/network/NetworkService.java @@ -79,7 +79,7 @@ public interface NetworkService { Long startIndex, Long pageSize, String name); PhysicalNetwork updatePhysicalNetwork(Long id, String networkSpeed, List tags, - String newVnetRangeString, String state); + String newVnetRangeString, String state, String removeVlan); boolean deletePhysicalNetwork(Long id); diff --git a/api/src/com/cloud/network/PhysicalNetwork.java b/api/src/com/cloud/network/PhysicalNetwork.java index a2044a61047..c521dc4f888 100644 --- a/api/src/com/cloud/network/PhysicalNetwork.java +++ b/api/src/com/cloud/network/PhysicalNetwork.java @@ -18,6 +18,7 @@ package com.cloud.network; import java.util.List; +import com.cloud.utils.Pair; import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.InternalIdentity; @@ -59,7 +60,9 @@ public interface PhysicalNetwork extends Identity, InternalIdentity { Long getDomainId(); - String getVnet(); + List> getVnet(); + + String getVnetString(); String getSpeed(); diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java index cb4d43e6e46..8c32bb383cd 100755 --- a/api/src/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/org/apache/cloudstack/api/ApiConstants.java @@ -221,6 +221,7 @@ public class ApiConstants { public static final String VIRTUAL_MACHINE_ID = "virtualmachineid"; public static final String VIRTUAL_MACHINE_IDS = "virtualmachineids"; public static final String VLAN = "vlan"; + public static final String REMOVE_VLAN="removevlan"; public static final String VLAN_ID = "vlanid"; public static final String VM_AVAILABLE = "vmavailable"; public static final String VM_LIMIT = "vmlimit"; diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/UpdatePhysicalNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/UpdatePhysicalNetworkCmd.java index 06cf38dba3f..6d37dd8a49b 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/network/UpdatePhysicalNetworkCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/network/UpdatePhysicalNetworkCmd.java @@ -54,6 +54,8 @@ public class UpdatePhysicalNetworkCmd extends BaseAsyncCmd { @Parameter(name=ApiConstants.VLAN, type=CommandType.STRING, description="the VLAN for the physical network") private String vlan; + @Parameter(name=ApiConstants.REMOVE_VLAN, type = CommandType.STRING, description ="The vlan range we want to remove") + private String removevlan; ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// @@ -79,6 +81,10 @@ public class UpdatePhysicalNetworkCmd extends BaseAsyncCmd { return vlan; } + public String getRemoveVlan(){ + return removevlan; + } + ///////////////////////////////////////////////////// /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// @@ -95,7 +101,7 @@ public class UpdatePhysicalNetworkCmd extends BaseAsyncCmd { @Override public void execute(){ - PhysicalNetwork result = _networkService.updatePhysicalNetwork(getId(),getNetworkSpeed(), getTags(), getVlan(), getState()); + PhysicalNetwork result = _networkService.updatePhysicalNetwork(getId(),getNetworkSpeed(), getTags(), getVlan(), getState(), getRemoveVlan()); PhysicalNetworkResponse response = _responseGenerator.createPhysicalNetworkResponse(result); response.setResponseName(getCommandName()); this.setResponseObject(response); diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index cfe0e00d8ba..b899fa192f0 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -2667,7 +2667,7 @@ public class ApiResponseHelper implements ResponseGenerator { response.setZoneId(zone.getUuid()); } response.setNetworkSpeed(result.getSpeed()); - response.setVlan(result.getVnet()); + response.setVlan(result.getVnetString()); if (result.getDomainId() != null) { Domain domain = ApiDBUtils.findDomainById(result.getDomainId()); if (domain != null) { diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index 3551295c2d7..4fc2db7fc2a 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -2633,7 +2633,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati if (vlan == null) { throw new CloudRuntimeException("Unable to acquire vlan configuration: " + vlanDbId); } - + if (s_logger.isDebugEnabled()) { s_logger.debug("lock vlan " + vlanDbId + " is acquired"); } diff --git a/server/src/com/cloud/dc/dao/DataCenterVnetDao.java b/server/src/com/cloud/dc/dao/DataCenterVnetDao.java index 79e91c4bca8..7fb68dcd7ac 100644 --- a/server/src/com/cloud/dc/dao/DataCenterVnetDao.java +++ b/server/src/com/cloud/dc/dao/DataCenterVnetDao.java @@ -20,9 +20,11 @@ import java.util.List; import com.cloud.dc.DataCenterVnetVO; import com.cloud.utils.db.GenericDao; +import com.cloud.utils.db.Transaction; public interface DataCenterVnetDao extends GenericDao { public List listAllocatedVnets(long physicalNetworkId); + public List listAllocatedVnetsInRange(long dcId, long physicalNetworkId, Integer start, Integer end); public List findVnet(long dcId, String vnet); public int countZoneVlans(long dcId, boolean onlyCountAllocated); public List findVnet(long dcId, long physicalNetworkId, String vnet); @@ -31,6 +33,10 @@ public interface DataCenterVnetDao extends GenericDao { public void delete(long physicalNetworkId); + public void deleteRange(Transaction txn, long dcId, long physicalNetworkId, int start, int end); + + public void lockRange(long dcId, long physicalNetworkId, Integer start, Integer end); + public DataCenterVnetVO take(long physicalNetworkId, long accountId, String reservationId); public void release(String vnet, long physicalNetworkId, long accountId, String reservationId); diff --git a/server/src/com/cloud/dc/dao/DataCenterVnetDaoImpl.java b/server/src/com/cloud/dc/dao/DataCenterVnetDaoImpl.java index 5ded0f4ecf5..2e044394ddc 100755 --- a/server/src/com/cloud/dc/dao/DataCenterVnetDaoImpl.java +++ b/server/src/com/cloud/dc/dao/DataCenterVnetDaoImpl.java @@ -21,6 +21,7 @@ import java.sql.SQLException; import java.util.Date; import java.util.List; +import com.cloud.exception.InvalidParameterValueException; import org.springframework.stereotype.Component; import com.cloud.dc.DataCenterVnetVO; @@ -46,8 +47,10 @@ public class DataCenterVnetDaoImpl extends GenericDaoBase VnetDcSearch; private final SearchBuilder VnetDcSearchAllocated; private final SearchBuilder DcSearchAllocated; + private final SearchBuilder DcSearchAllocatedInRange; private final GenericSearchBuilder countZoneVlans; private final GenericSearchBuilder countAllocatedZoneVlans; + private final SearchBuilder SearchRange; public List listAllocatedVnets(long physicalNetworkId) { SearchCriteria sc = DcSearchAllocated.create(); @@ -55,6 +58,22 @@ public class DataCenterVnetDaoImpl extends GenericDaoBase listAllocatedVnetsInRange(long dcId, long physicalNetworkId, Integer start, Integer end) { + SearchCriteria sc = DcSearchAllocatedInRange.create(); + sc.setParameters("dc",dcId); + sc.setParameters("physicalNetworkId", physicalNetworkId); + sc.setParameters("vnetRange", start.toString(), end.toString()); + return listBy(sc); + } + + public void lockRange(long dcId, long physicalNetworkId, Integer start, Integer end) { + SearchCriteria sc = SearchRange.create(); + sc.setParameters("dc",dcId); + sc.setParameters("physicalNetworkId", physicalNetworkId); + sc.setParameters("vnetRange", start.toString(), end.toString()); + lockRows(sc,null,true); + } + public List findVnet(long dcId, String vnet) { SearchCriteria sc = VnetDcSearch.create();; sc.setParameters("dc", dcId); @@ -93,11 +112,28 @@ public class DataCenterVnetDaoImpl extends GenericDaoBase sc = VnetDcSearch.create(); sc.setParameters("physicalNetworkId", physicalNetworkId); @@ -149,6 +185,18 @@ public class DataCenterVnetDaoImpl extends GenericDaoBase> vnetList = pNetwork.getVnet(); + //finding the vlanrange in which the vlanTag lies. + for (Pair vnet : vnetList){ + if (vlanTag >= vnet.first() && vlanTag <= vnet.second()){ + lowestVlanTag = vnet.first(); + } + } + if (lowestVlanTag == null) { + throw new InvalidParameterValueException ("The vlan tag dose not belong to any of the existing vlan ranges"); + } return vlanTag - lowestVlanTag; } diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java index 70d1d0d432c..12c6068925f 100755 --- a/server/src/com/cloud/network/NetworkServiceImpl.java +++ b/server/src/com/cloud/network/NetworkServiceImpl.java @@ -19,16 +19,10 @@ package com.cloud.network; import com.cloud.configuration.Config; import com.cloud.configuration.ConfigurationManager; import com.cloud.configuration.dao.ConfigurationDao; -import com.cloud.dc.DataCenter; +import com.cloud.dc.*; import com.cloud.dc.DataCenter.NetworkType; -import com.cloud.dc.DataCenterVO; -import com.cloud.dc.Pod; import com.cloud.dc.Vlan.VlanType; -import com.cloud.dc.VlanVO; -import com.cloud.dc.dao.AccountVlanMapDao; -import com.cloud.dc.dao.DataCenterDao; -import com.cloud.dc.dao.HostPodDao; -import com.cloud.dc.dao.VlanDao; +import com.cloud.dc.dao.*; import com.cloud.deploy.DeployDestination; import com.cloud.domain.Domain; import com.cloud.domain.DomainVO; @@ -89,6 +83,7 @@ import com.cloud.utils.net.NetUtils; import com.cloud.vm.*; import com.cloud.vm.dao.*; import org.apache.cloudstack.acl.ControlledEntity.ACLType; +import org.apache.cloudstack.acl.SecurityChecker; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.command.admin.usage.ListTrafficTypeImplementorsCmd; import org.apache.cloudstack.api.command.user.network.CreateNetworkCmd; @@ -206,6 +201,8 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { HostDao _hostDao; @Inject HostPodDao _hostPodDao; + @Inject + DataCenterVnetDao _datacneter_vnet; int _cidrLimit; boolean _allowSubdomainNetworkAccess; @@ -538,7 +535,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { } else if (dc.getNetworkType() == NetworkType.Basic || ntwkOff.getGuestType() == Network.GuestType.Shared) { Account caller = UserContext.current().getCaller(); long callerUserId = UserContext.current().getCallerUserId(); - _accountMgr.checkAccess(caller, AccessType.UseNetwork, false, network); + _accountMgr.checkAccess(caller, SecurityChecker.AccessType.UseNetwork, false, network); //handle the basic networks here VirtualMachine vm = _userVmDao.findById(nicVO.getInstanceId()); if (vm == null) { @@ -758,18 +755,20 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { // in the zone when using external networking PhysicalNetworkVO pNetwork = _physicalNetworkDao.findById(physicalNetworkId); if (pNetwork.getVnet() != null) { - String vlanRange[] = pNetwork.getVnet().split("-"); - int lowestVlanTag = Integer.valueOf(vlanRange[0]); - int highestVlanTag = Integer.valueOf(vlanRange[1]); - for (int vlan=lowestVlanTag; vlan <= highestVlanTag; ++vlan) { - int offset = vlan - lowestVlanTag; - String globalVlanBits = _configDao.getValue(Config.GuestVlanBits.key()); - int cidrSize = 8 + Integer.parseInt(globalVlanBits); - String guestNetworkCidr = zone.getGuestNetworkCidr(); - String[] cidrTuple = guestNetworkCidr.split("\\/"); - long newCidrAddress = (NetUtils.ip2Long(cidrTuple[0]) & 0xff000000) | (offset << (32 - cidrSize)); - if (NetUtils.isNetworksOverlap(NetUtils.long2Ip(newCidrAddress), cidr)) { - throw new InvalidParameterValueException("Specified CIDR for shared network conflict with CIDR that is reserved for zone vlan " + vlan); + List > vlanList = pNetwork.getVnet(); + for (Pair vlanRange : vlanList){ + Integer lowestVlanTag = vlanRange.first(); + Integer highestVlanTag = vlanRange.second(); + for (int vlan=lowestVlanTag; vlan <= highestVlanTag; ++vlan) { + int offset = vlan - lowestVlanTag; + String globalVlanBits = _configDao.getValue(Config.GuestVlanBits.key()); + int cidrSize = 8 + Integer.parseInt(globalVlanBits); + String guestNetworkCidr = zone.getGuestNetworkCidr(); + String[] cidrTuple = guestNetworkCidr.split("\\/"); + long newCidrAddress = (NetUtils.ip2Long(cidrTuple[0]) & 0xff000000) | (offset << (32 - cidrSize)); + if (NetUtils.isNetworksOverlap(NetUtils.long2Ip(newCidrAddress), cidr)) { + throw new InvalidParameterValueException("Specified CIDR for shared network conflict with CIDR that is reserved for zone vlan " + vlan); + } } } } @@ -2198,7 +2197,6 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { } catch (NumberFormatException e) { throw new InvalidParameterValueException("Please specify valid integers for the vlan range."); } - if ((vnetStart > vnetEnd) || (vnetStart < 0) || (vnetEnd > 4096)) { s_logger.warn("Invalid vnet range: start range:" + vnetStart + " end range:" + vnetEnd); throw new InvalidParameterValueException("Vnet range should be between 0-4096 and start range should be lesser than or equal to end range"); @@ -2289,7 +2287,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { @Override @DB @ActionEvent(eventType = EventTypes.EVENT_PHYSICAL_NETWORK_UPDATE, eventDescription = "updating physical network", async = true) - public PhysicalNetwork updatePhysicalNetwork(Long id, String networkSpeed, List tags, String newVnetRangeString, String state) { + public PhysicalNetwork updatePhysicalNetwork(Long id, String networkSpeed, List tags, String newVnetRangeString, String state, String removeVlan) { // verify input parameters PhysicalNetworkVO network = _physicalNetworkDao.findById(id); @@ -2314,6 +2312,12 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { } } + if (removeVlan != null){ + List tokens = processVlanRange(network,removeVlan); + boolean result = removeVlanRange(network, tokens.get(0), tokens.get(1)); + + } + if (tags != null && tags.size() > 1) { throw new InvalidParameterException("Unable to support more than one tag on network yet"); } @@ -2340,90 +2344,211 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { } // Vnet range can be extended only - boolean replaceVnet = false; - ArrayList> vnetsToAdd = new ArrayList>(2); + boolean AddVnet = true; + List> vnetsToAdd = new ArrayList>(); if (newVnetRangeString != null) { Integer newStartVnet = 0; Integer newEndVnet = 0; - String[] newVnetRange = newVnetRangeString.split("-"); - int maxVnet = 4096; - // for GRE phynets allow up to 32bits - // TODO: Not happy about this test. - // What about guru-like objects for physical networs? - s_logger.debug("ISOLATION METHODS:" + network.getIsolationMethods()); - // Java does not have unsigned types... - if (network.getIsolationMethods().contains("GRE")) { - maxVnet = (int)(Math.pow(2, 32)-1); - } - String rangeMessage = " between 0 and " + maxVnet; - if (newVnetRange.length < 2) { - throw new InvalidParameterValueException("Please provide valid vnet range" + rangeMessage); - } + List tokens = processVlanRange(network, newVnetRangeString); + newStartVnet = tokens.get(0); + newEndVnet = tokens.get(1); + Integer j=0; + List > existingRanges = network.getVnet(); + if (!existingRanges.isEmpty()) { + for (; j < existingRanges.size(); j++){ + int existingStartVnet = existingRanges.get(j).first(); + int existingEndVnet = existingRanges.get(j).second(); - if (newVnetRange[0] == null || newVnetRange[1] == null) { - throw new InvalidParameterValueException("Please provide valid vnet range" + rangeMessage); - } + // check if vnet is being extended + if (newStartVnet.intValue() >= existingStartVnet & newEndVnet.intValue() <= existingEndVnet) { + throw new InvalidParameterValueException("The vlan range you trying to add already exists."); + } - try { - newStartVnet = Integer.parseInt(newVnetRange[0]); - newEndVnet = Integer.parseInt(newVnetRange[1]); - } catch (NumberFormatException e) { - s_logger.warn("Unable to parse vnet range:", e); - throw new InvalidParameterValueException("Please provide valid vnet range" + rangeMessage); - } - if (newStartVnet < 0 || newEndVnet > maxVnet) { - throw new InvalidParameterValueException("Vnet range has to be" + rangeMessage); - } + if (newStartVnet < existingStartVnet & newEndVnet+1 >= existingStartVnet & newEndVnet <= existingEndVnet) { + vnetsToAdd.add(new Pair(newStartVnet, existingStartVnet - 1)); + existingRanges.get(j).first(newStartVnet); + AddVnet = false; + break; + } - if (newStartVnet > newEndVnet) { - throw new InvalidParameterValueException("Vnet range has to be" + rangeMessage + " and start range should be lesser than or equal to stop range"); - } - - if (physicalNetworkHasAllocatedVnets(network.getDataCenterId(), network.getId())) { - String[] existingRange = network.getVnet().split("-"); - int existingStartVnet = Integer.parseInt(existingRange[0]); - int existingEndVnet = Integer.parseInt(existingRange[1]); + else if (newStartVnet > existingStartVnet & newStartVnet-1 <= existingEndVnet & newEndVnet >= existingEndVnet) { + vnetsToAdd.add(new Pair(existingEndVnet + 1, newEndVnet)); + existingRanges.get(j).second(newEndVnet); + AddVnet = false; + break; + } - // check if vnet is being extended - if (newStartVnet.intValue() > existingStartVnet || newEndVnet.intValue() < existingEndVnet) { - throw new InvalidParameterValueException("Can't shrink existing vnet range as it the range has vnets allocated. Only extending existing vnet is supported"); + else if (newStartVnet< existingStartVnet & newEndVnet > existingEndVnet){ + vnetsToAdd.add(new Pair(newStartVnet,existingStartVnet-1)); + vnetsToAdd.add(new Pair(existingEndVnet+1,newEndVnet)); + existingRanges.get(j).first(newStartVnet); + existingRanges.get(j).second(newEndVnet); + break; + } } - if (newStartVnet < existingStartVnet) { - vnetsToAdd.add(new Pair(newStartVnet, existingStartVnet - 1)); - } - - if (newEndVnet > existingEndVnet) { - vnetsToAdd.add(new Pair(existingEndVnet + 1, newEndVnet)); - } - - } else { - vnetsToAdd.add(new Pair(newStartVnet, newEndVnet)); - replaceVnet = true; } - } + if (AddVnet){ + vnetsToAdd.add(new Pair(newStartVnet, newEndVnet)); + existingRanges.add(new Pair(newStartVnet,newEndVnet)); + } - if (newVnetRangeString != null) { - network.setVnet(newVnetRangeString); - } + Map vnetMap = new HashMap(existingRanges.size()); + Map IndexMap = new HashMap(existingRanges.size()); + for (int i=0; i< existingRanges.size(); i++){ + vnetMap.put(existingRanges.get(i).first(),existingRanges.get(i).second()); + IndexMap.put(existingRanges.get(i).first(),i); + } - _physicalNetworkDao.update(id, network); + Integer value; + Integer index; + String vnetString = ""; + for (int i=0; i < existingRanges.size(); i++){ + value = vnetMap.get((existingRanges.get(i).second()+1)); + if (value != null) { + vnetMap.remove((existingRanges.get(i).second()+1)); + vnetMap.remove(existingRanges.get(i).first()); + vnetMap.put(existingRanges.get(i).first(),value); + existingRanges.add(new Pair(existingRanges.get(i).first(),value)); + index = IndexMap.get(existingRanges.get(i).second()+1); + existingRanges.get(index).first(-1); + existingRanges.get(index).second(-1); + existingRanges.get(i).first(-1); + existingRanges.get(i).second(-1); + } + value = vnetMap.get((existingRanges.get(i).second())); + if (value != null) { + vnetMap.remove((existingRanges.get(i).second())); + vnetMap.remove(existingRanges.get(i).first()); + vnetMap.put(existingRanges.get(i).first(),value); + existingRanges.add(new Pair(existingRanges.get(i).first(),value)); + index = IndexMap.get(existingRanges.get(i).second()); + existingRanges.get(index).first(-1); + existingRanges.get(index).second(-1); + existingRanges.get(i).first(-1); + existingRanges.get(i).second(-1); + } + } - if (replaceVnet) { - s_logger.debug("Deleting existing vnet range for the physicalNetwork id= " + id + " and zone id=" + network.getDataCenterId() + " as a part of updatePhysicalNetwork call"); - _dcDao.deleteVnet(network.getId()); - } - for (Pair vnetToAdd : vnetsToAdd) { - s_logger.debug("Adding vnet range " + vnetToAdd.first() + "-" + vnetToAdd.second() + " for the physicalNetwork id= " + id + " and zone id=" + network.getDataCenterId() + + if (newVnetRangeString != null) { + for (Pair vnetRange : existingRanges ){ + value=vnetMap.get(vnetRange.first()); + if (value != null){ + vnetString = vnetString+vnetRange.first().toString()+"-"+value.toString()+";"; + } + } + vnetString = vnetString+"*"; + vnetString = vnetString.replace(";*",""); + network.setVnet(vnetString); + } + + + + _physicalNetworkDao.update(id, network); + + for (Pair vnetToAdd : vnetsToAdd) { + s_logger.debug("Adding vnet range " + vnetToAdd.first() + "-" + vnetToAdd.second() + " for the physicalNetwork id= " + id + " and zone id=" + network.getDataCenterId() + " as a part of updatePhysicalNetwork call"); - _dcDao.addVnet(network.getDataCenterId(), network.getId(), vnetToAdd.first(), vnetToAdd.second()); + _dcDao.addVnet(network.getDataCenterId(), network.getId(), vnetToAdd.first(), vnetToAdd.second()); + } } return network; } + private List processVlanRange(PhysicalNetworkVO network, String removeVlan) { + Integer StartVnet; + Integer EndVnet; + String[] VnetRange = removeVlan.split("-"); + int maxVnet = 4096; + // for GRE phynets allow up to 32bits + // TODO: Not happy about this test. + // What about guru-like objects for physical networs? + s_logger.debug("ISOLATION METHODS:" + network.getIsolationMethods()); + // Java does not have unsigned types... + if (network.getIsolationMethods().contains("GRE")) { + maxVnet = (int)(Math.pow(2, 32)-1); + } + String rangeMessage = " between 0 and " + maxVnet; + if (VnetRange.length < 2) { + throw new InvalidParameterValueException("Please provide valid vnet range" + rangeMessage); + } + + if (VnetRange[0] == null || VnetRange[1] == null) { + throw new InvalidParameterValueException("Please provide valid vnet range" + rangeMessage); + } + + try { + StartVnet = Integer.parseInt(VnetRange[0]); + EndVnet = Integer.parseInt(VnetRange[1]); + } catch (NumberFormatException e) { + s_logger.warn("Unable to parse vnet range:", e); + throw new InvalidParameterValueException("Please provide valid vnet range" + rangeMessage); + } + if (StartVnet < 0 || EndVnet > maxVnet) { + throw new InvalidParameterValueException("Vnet range has to be" + rangeMessage); + } + + if (StartVnet > EndVnet) { + throw new InvalidParameterValueException("Vnet range has to be" + rangeMessage + " and start range should be lesser than or equal to stop range"); + } + List tokens = new ArrayList(); + tokens.add(StartVnet); + tokens.add(EndVnet); + return tokens; + + } + + + private boolean removeVlanRange( PhysicalNetworkVO network, Integer start, Integer end) { + Integer temp=0; + int i; + List > existingRanges = network.getVnet(); + Transaction txn = Transaction.currentTxn(); + txn.start(); + _physicalNetworkDao.acquireInLockTable(network.getId(),10); + _datacneter_vnet.lockRange(network.getDataCenterId(), network.getId(), start, end); + List result = _datacneter_vnet.listAllocatedVnetsInRange(network.getDataCenterId(), network.getId(), start, end); + if (!result.isEmpty()){ + txn.close(); + throw new InvalidParameterValueException("Some of the vnets from this range are allocated, can only remove a range which has no allocated vnets"); + } + for (i=0; i= end){ + temp = existingRanges.get(i).second(); + existingRanges.get(i).second(start - 1); + existingRanges.add(new Pair((end+1),temp)); + break; + } + } + + if (temp == 0){ + throw new InvalidParameterValueException("The vlan range you are trying to delete dose not exist."); + } + if(existingRanges.get(i).first() > existingRanges.get(i).second()){ + existingRanges.remove(i); + } + if(existingRanges.get(existingRanges.size()-1).first() > existingRanges.get(existingRanges.size()-1).second()){ + existingRanges.remove(existingRanges.size()-1); + } + _datacneter_vnet.deleteRange(txn, network.getDataCenterId(), network.getId(), start, end); + + String vnetString=""; + for (Pair vnetRange : existingRanges ){ + vnetString=vnetString+vnetRange.first().toString()+"-"+vnetRange.second().toString()+";"; + } + vnetString = vnetString+"*"; + vnetString = vnetString.replace(";*",""); + network.setVnet(vnetString); + _physicalNetworkDao.update(network.getId(), network); + txn.commit(); + _physicalNetworkDao.releaseFromLockTable(network.getId()); + return true; + } + private boolean physicalNetworkHasAllocatedVnets(long zoneId, long physicalNetworkId) { return !_dcDao.listAllocatedVnets(physicalNetworkId).isEmpty(); } diff --git a/server/src/com/cloud/network/dao/PhysicalNetworkVO.java b/server/src/com/cloud/network/dao/PhysicalNetworkVO.java index e5ffcfb7c0d..f68eee1de5c 100644 --- a/server/src/com/cloud/network/dao/PhysicalNetworkVO.java +++ b/server/src/com/cloud/network/dao/PhysicalNetworkVO.java @@ -34,11 +34,9 @@ import javax.persistence.Table; import javax.persistence.TableGenerator; import com.cloud.network.PhysicalNetwork; -import com.cloud.network.PhysicalNetwork.BroadcastDomainRange; -import com.cloud.network.PhysicalNetwork.State; import com.cloud.utils.NumbersUtil; +import com.cloud.utils.Pair; import com.cloud.utils.db.GenericDao; -import org.apache.cloudstack.api.InternalIdentity; /** * NetworkConfigurationVO contains information about a specific physical network. @@ -205,7 +203,21 @@ public class PhysicalNetworkVO implements PhysicalNetwork { } @Override - public String getVnet() { + public List> getVnet() { + List > vnetList = new ArrayList>(); + if (vnet != null) { + String [] Temp = vnet.split(";"); + String [] vnetSplit = null; + for (String vnetRange : Temp){ + vnetSplit = vnetRange.split("-"); + vnetList.add(new Pair(Integer.parseInt(vnetSplit[0]),Integer.parseInt(vnetSplit[1]))); + } + } + return vnetList; + } + + @Override + public String getVnetString() { return vnet; } diff --git a/server/src/com/cloud/network/guru/GuestNetworkGuru.java b/server/src/com/cloud/network/guru/GuestNetworkGuru.java index 9c0205a89b2..92607e2fcd0 100755 --- a/server/src/com/cloud/network/guru/GuestNetworkGuru.java +++ b/server/src/com/cloud/network/guru/GuestNetworkGuru.java @@ -26,6 +26,7 @@ import javax.ejb.Local; import javax.inject.Inject; import com.cloud.event.ActionEventUtils; +import com.cloud.utils.Pair; import org.apache.log4j.Logger; import com.cloud.configuration.Config; @@ -274,8 +275,17 @@ public abstract class GuestNetworkGuru extends AdapterBase implements NetworkGur if (pNetwork.getVnet() == null) { throw new CloudRuntimeException("Could not find vlan range for physical Network " + physicalNetworkId + "."); } - String vlanRange[] = pNetwork.getVnet().split("-"); - int lowestVlanTag = Integer.valueOf(vlanRange[0]); + Integer lowestVlanTag = null; + List> vnetList = pNetwork.getVnet(); + //finding the vlanrange in which the vlanTag lies. + for (Pair vnet : vnetList){ + if (vlanTag >= vnet.first() && vlanTag <= vnet.second()){ + lowestVlanTag = vnet.first(); + } + } + if (lowestVlanTag == null) { + throw new InvalidParameterValueException ("The vlan tag dose not belong to any of the existing vlan ranges"); + } return vlanTag - lowestVlanTag; } diff --git a/server/test/com/cloud/network/MockNetworkManagerImpl.java b/server/test/com/cloud/network/MockNetworkManagerImpl.java index 9042f03d4a7..6a0263ee334 100755 --- a/server/test/com/cloud/network/MockNetworkManagerImpl.java +++ b/server/test/com/cloud/network/MockNetworkManagerImpl.java @@ -322,7 +322,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage } @Override - public PhysicalNetwork updatePhysicalNetwork(Long id, String networkSpeed, List tags, String newVnetRangeString, String state) { + public PhysicalNetwork updatePhysicalNetwork(Long id, String networkSpeed, List tags, String newVnetRangeString, String state, String removeVlan) { // TODO Auto-generated method stub return null; } diff --git a/server/test/com/cloud/network/UpdatePhysicalNetworkTest.java b/server/test/com/cloud/network/UpdatePhysicalNetworkTest.java new file mode 100644 index 00000000000..ca9d149214f --- /dev/null +++ b/server/test/com/cloud/network/UpdatePhysicalNetworkTest.java @@ -0,0 +1,68 @@ +// 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 +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.network; +import com.cloud.capacity.CapacityManagerImpl; +import com.cloud.dc.DataCenterVO; +import com.cloud.dc.dao.DataCenterDao; +import com.cloud.network.NetworkServiceImpl; +import com.cloud.network.dao.PhysicalNetworkDao; +import com.cloud.network.dao.PhysicalNetworkVO; +import com.cloud.utils.Pair; +import org.junit.Test; +import org.junit.*; +import org.mockito.ArgumentCaptor; +import org.mockito.MockitoAnnotations.*; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.*; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + + +public class UpdatePhysicalNetworkTest { + private PhysicalNetworkDao _physicalNetworkDao = mock(PhysicalNetworkDao.class); + private DataCenterDao _datacenterDao = mock(DataCenterDao.class); + private DataCenterVO datacentervo = mock(DataCenterVO.class); + private PhysicalNetworkVO physicalNetworkVO = mock(PhysicalNetworkVO.class); + List> existingRange = new ArrayList>(); + ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(String.class); + + public NetworkServiceImpl setUp() { + NetworkServiceImpl networkService = new NetworkServiceImpl(); + ((NetworkServiceImpl)networkService)._dcDao= _datacenterDao; + networkService._physicalNetworkDao = _physicalNetworkDao; + return networkService; + } + + @Test + public void updatePhysicalNetworkTest(){ + NetworkServiceImpl networkService = setUp(); + existingRange.add(new Pair(520, 524)); + when(_physicalNetworkDao.findById(anyLong())).thenReturn(physicalNetworkVO); + when(_datacenterDao.findById(anyLong())).thenReturn(datacentervo); + when(_physicalNetworkDao.update(anyLong(), any(physicalNetworkVO.getClass()))).thenReturn(true); + when(physicalNetworkVO.getVnet()).thenReturn(existingRange); + networkService.updatePhysicalNetwork(1l, null, null, "525-530", null, null); + verify(physicalNetworkVO).setVnet(argumentCaptor.capture()); + assertEquals("520-530", argumentCaptor.getValue()); + } + +} diff --git a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java index 3a585ce708a..bfcccf54bf0 100644 --- a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java +++ b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java @@ -328,7 +328,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage */ @Override public PhysicalNetwork updatePhysicalNetwork(Long id, String networkSpeed, List tags, - String newVnetRangeString, String state) { + String newVnetRangeString, String state, String removeVlan) { // TODO Auto-generated method stub return null; } diff --git a/test/integration/smoke/test_non_contigiousvlan.py b/test/integration/smoke/test_non_contigiousvlan.py new file mode 100644 index 00000000000..fe70f874f75 --- /dev/null +++ b/test/integration/smoke/test_non_contigiousvlan.py @@ -0,0 +1,125 @@ +# 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 +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +""" BVT tests for Primary Storage +""" +import marvin +from marvin import cloudstackTestCase +from marvin.cloudstackTestCase import * + +import unittest +import hashlib +import random + + +class TestUpdatePhysicalNetwork(cloudstackTestCase): + """ + This test updates the existing physicalnetwork with a new vlan range. + """ + def setUp(self): + """ + CloudStack internally saves its passwords in md5 form and that is how we + specify it in the API. Python's hashlib library helps us to quickly hash + strings as follows + """ + mdf = hashlib.md5() + mdf.update('password') + mdf_pass = mdf.hexdigest() + + self.apiClient = self.testClient.getApiClient() #Get ourselves an API client + + self.acct = createAccount.createAccountCmd() #The createAccount command + self.acct.accounttype = 0 #We need a regular user. admins have accounttype=1 + self.acct.firstname = 'bharat' + self.acct.lastname = 'kumar' #What's up doc? + self.acct.password = mdf_pass #The md5 hashed password string + self.acct.username = 'bharat' + self.acct.email = 'bharat@kumar.com' + self.acct.account = 'bharat' + self.acct.domainid = 1 #The default ROOT domain + self.acctResponse = self.apiClient.createAccount(self.acct) + # using the default debug logger of the test framework + self.debug("successfully created account: %s, user: %s, id: \ + %s"%(self.acctResponse.account.account, \ + self.acctResponse.account.username, \ + self.acctResponse.account.id)) + + def test_UpdatePhysicalNetwork(self): + """ + Let's start by defining the attributes of our VM that we will be + deploying on CloudStack. We will be assuming a single zone is available + and is configured and all templates are Ready + + The hardcoded values are used only for brevity. + """ + listPhysicalNetworksCmd = listPhysicalNetworks.listPhysicalNetworksCmd() + listPhysicalNetworksResponse = self.apiClient.listPhysicalNetworks(listPhysicalNetworksCmd) + + self.assertNotEqual(len(listPhysicalNetworksResponse), 0, "Check if the list API \ + returns a non-empty response") + + networkid = listPhysicalNetworksResponse[0].id + updatePhysicalNetworkCmd = updatePhysicalNetwork.updatePhysicalNetworkCmd() + updatePhysicalNetworkCmd.id = networkid + updatePhysicalNetworkCmd.vlan = "4090-4091" + updatePhysicalNetworkResponse = self.apiClient.updatePhysicalNetwork(updatePhysicalNetworkCmd) + self.assertNotEqual((updatePhysicalNetworkResponse.len), 0, "Check if the list API \ + returns a non-empty response") + + updatePhysicalNetworkCmd = updatePhysicalNetwork.updatePhysicalNetworkCmd() + updatePhysicalNetworkCmd.id = networkid + updatePhysicalNetworkCmd.vlan = "4092-4096" + updatePhysicalNetworkResponse = self.apiClient.updatePhysicalNetwork(updatePhysicalNetworkCmd) + self.assertNotEqual((updatePhysicalNetworkResponse.len), 0, "Check if the list API \ + returns a non-empty response") + + vlanranges= updatePhysicalNetworkResponse.vlan + range = "" + vlanranges = vlanranges.split(";") + for vlan in vlanranges: + if (vlan == "4090-4096"): + range = vlan + + self.assertEqual(range, "4090-4096", "check if adding the range is successful") + + updatePhysicalNetworkCmd = updatePhysicalNetwork.updatePhysicalNetworkCmd() + updatePhysicalNetworkCmd.id = networkid + updatePhysicalNetworkCmd.removevlan = "4090-4096" + updatePhysicalNetworkResponse = self.apiClient.updatePhysicalNetwork(updatePhysicalNetworkCmd) + self.assertNotEqual((updatePhysicalNetworkResponse.len), 0, "Check if the list API \ + returns a non-empty response") + + vlanranges= updatePhysicalNetworkResponse.vlan + range = "" + vlanranges = vlanranges.split(";") + + for vlan in vlanranges: + if (vlan == "4090-4096"): + range = vlan + + + self.assertEqual(range, "", "check if removing the range is successful") + + + def tearDown(self): # Teardown will delete the Account as well as the VM once the VM reaches "Running" state + """ + And finally let us cleanup the resources we created by deleting the + account. All good unittests are atomic and rerunnable this way + """ + deleteAcct = deleteAccount.deleteAccountCmd() + deleteAcct.id = self.acctResponse.account.id + self.apiClient.deleteAccount(deleteAcct) + From fad55c5bea6aa0973b8168a821af5d0bbf86699a Mon Sep 17 00:00:00 2001 From: Prasanna Santhanam Date: Wed, 17 Apr 2013 11:06:35 +0530 Subject: [PATCH 15/31] Fix the apidocs for cisco ASA device Signed-off-by: Prasanna Santhanam --- tools/apidoc/gen_toc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/apidoc/gen_toc.py b/tools/apidoc/gen_toc.py index 5403adb99df..f8bdae281b2 100644 --- a/tools/apidoc/gen_toc.py +++ b/tools/apidoc/gen_toc.py @@ -56,6 +56,7 @@ dirname_to_dirname = { known_categories = { + 'Cisco' : 'External Device', 'SystemVm': 'System VM', 'VirtualMachine': 'Virtual Machine', 'VM': 'Virtual Machine', From 0ddeb65fdf155b55f53ece7ff92f4a26e3f086b5 Mon Sep 17 00:00:00 2001 From: Sanjay Tripathi Date: Tue, 16 Apr 2013 16:57:28 +0530 Subject: [PATCH 16/31] CLOUDSTACK-1966: Primary Storage Limits are not validated while deploying the VM Signed-off-by: Abhinandan Prateek --- server/src/com/cloud/vm/UserVmManagerImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 53a57c8e9cb..3ecdf426721 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -2264,9 +2264,14 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use // check if account/domain is with in resource limits to create a new vm boolean isIso = Storage.ImageFormat.ISO == template.getFormat(); + long size = _templateHostDao.findByTemplateId(template.getId()).getSize(); + if (diskOfferingId != null) { + size += _diskOfferingDao.findById(diskOfferingId).getDiskSize(); + } resourceLimitCheck(owner, new Long(offering.getCpu()), new Long(offering.getRamSize())); _resourceLimitMgr.checkResourceLimit(owner, ResourceType.volume, (isIso || diskOfferingId == null ? 1 : 2)); + _resourceLimitMgr.checkResourceLimit(owner, ResourceType.primary_storage, new Long (size)); // verify security group ids if (securityGroupIdList != null) { From d0a7eae5d97da777ad468b1b25fb9e3bb8b013a8 Mon Sep 17 00:00:00 2001 From: Phong Nguyen Date: Mon, 15 Apr 2013 13:31:43 -0400 Subject: [PATCH 17/31] Add LXC to hypervisor.list configuration value on fresh install Signed-off-by: Edison Su --- server/src/com/cloud/configuration/Config.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java index e69ea19e979..299396641d6 100755 --- a/server/src/com/cloud/configuration/Config.java +++ b/server/src/com/cloud/configuration/Config.java @@ -196,7 +196,7 @@ public enum Config { CPUOverprovisioningFactor("Advanced", ManagementServer.class, String.class, "cpu.overprovisioning.factor", "1", "Used for CPU overprovisioning calculation; available CPU will be (actualCpuCapacity * cpu.overprovisioning.factor)", null), MemOverprovisioningFactor("Advanced", ManagementServer.class, String.class, "mem.overprovisioning.factor", "1", "Used for memory overprovisioning calculation", null), LinkLocalIpNums("Advanced", ManagementServer.class, Integer.class, "linkLocalIp.nums", "10", "The number of link local ip that needed by domR(in power of 2)", null), - HypervisorList("Advanced", ManagementServer.class, String.class, "hypervisor.list", HypervisorType.KVM + "," + HypervisorType.XenServer + "," + HypervisorType.VMware + "," + HypervisorType.BareMetal + "," + HypervisorType.Ovm, "The list of hypervisors that this deployment will use.", "hypervisorList"), + HypervisorList("Advanced", ManagementServer.class, String.class, "hypervisor.list", HypervisorType.KVM + "," + HypervisorType.XenServer + "," + HypervisorType.VMware + "," + HypervisorType.BareMetal + "," + HypervisorType.Ovm + "," + HypervisorType.LXC, "The list of hypervisors that this deployment will use.", "hypervisorList"), ManagementHostIPAdr("Advanced", ManagementServer.class, String.class, "host", "localhost", "The ip address of management server", null), ManagementNetwork("Advanced", ManagementServer.class, String.class, "management.network.cidr", null, "The cidr of management server network", null), EventPurgeDelay("Advanced", ManagementServer.class, Integer.class, "event.purge.delay", "15", "Events older than specified number days will be purged. Set this value to 0 to never delete events", null), From ff4b55fff8b93d5e56acad2b1b059bd8ee55cbf4 Mon Sep 17 00:00:00 2001 From: Mice Xia Date: Wed, 17 Apr 2013 21:06:38 +0800 Subject: [PATCH 18/31] Fix CLOUDSTACK-1852 showing disconnected host as suitable target during system vms migration --- ui/scripts/system.js | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index dbe177a9e23..73bf3fd4160 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -2410,15 +2410,13 @@ select: function(args) { $.ajax({ url: createURL("listHosts&VirtualMachineId=" + args.context.routers[0].id), - //url: createURL("listHosts"), //for testing only, comment it out before checking in. dataType: "json", async: true, success: function(json) { var hostObjs = json.listhostsresponse.host; var items = []; $(hostObjs).each(function() { - //items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); //listHosts API no longer returns hasEnoughCapacity proprety - items.push({id: this.id, description: this.name}); + items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")}); }); args.response.success({data: items}); } @@ -2986,15 +2984,13 @@ select: function(args) { $.ajax({ url: createURL("listHosts&VirtualMachineId=" + args.context.routers[0].id), - //url: createURL("listHosts"), //for testing only, comment it out before checking in. dataType: "json", async: true, success: function(json) { var hostObjs = json.listhostsresponse.host; var items = []; $(hostObjs).each(function() { - //items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); //listHosts API no longer returns hasEnoughCapacity proprety - items.push({id: this.id, description: this.name}); + items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")}); }); args.response.success({data: items}); } @@ -5272,15 +5268,13 @@ select: function(args) { $.ajax({ url: createURL("listHosts&VirtualMachineId=" + args.context.systemVMs[0].id), - //url: createURL("listHosts"), //for testing only, comment it out before checking in. dataType: "json", async: true, success: function(json) { var hostObjs = json.listhostsresponse.host; var items = []; $(hostObjs).each(function() { - //items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); //listHosts API no longer returns hasEnoughCapacity proprety - items.push({id: this.id, description: this.name}); + items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")}); }); args.response.success({data: items}); } @@ -6011,15 +6005,13 @@ select: function(args) { $.ajax({ url: createURL("listHosts&VirtualMachineId=" + args.context.routers[0].id), - //url: createURL("listHosts"), //for testing only, comment it out before checking in. dataType: "json", async: true, success: function(json) { var hostObjs = json.listhostsresponse.host; var items = []; $(hostObjs).each(function() { - //items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); //listHosts API no longer returns hasEnoughCapacity proprety - items.push({id: this.id, description: this.name}); + items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")}); }); args.response.success({data: items}); } @@ -6473,15 +6465,13 @@ select: function(args) { $.ajax({ url: createURL("listHosts&VirtualMachineId=" + args.context.systemVMs[0].id), - //url: createURL("listHosts"), //for testing only, comment it out before checking in. dataType: "json", async: true, success: function(json) { var hostObjs = json.listhostsresponse.host; var items = []; $(hostObjs).each(function() { - //items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); //listHosts API no longer returns hasEnoughCapacity proprety - items.push({id: this.id, description: this.name}); + items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")}); }); args.response.success({data: items}); } From 774fd505c7b0b40e74931dafe91efdb504192a20 Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Wed, 17 Apr 2013 18:45:08 +0530 Subject: [PATCH 19/31] include account name and domain id in the globalloadbalancerrule response object --- server/src/com/cloud/api/ApiResponseHelper.java | 1 + 1 file changed, 1 insertion(+) diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index b899fa192f0..50d8de25702 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -774,6 +774,7 @@ public class ApiResponseHelper implements ResponseGenerator { response.setDescription(globalLoadBalancerRule.getDescription()); response.setRegionIdId(globalLoadBalancerRule.getRegion()); response.setId(globalLoadBalancerRule.getUuid()); + populateOwner(response, globalLoadBalancerRule); response.setObjectName("globalloadbalancer"); return response; } From 4d0a460bad05bfc89a9f2d93724221c7c517626e Mon Sep 17 00:00:00 2001 From: Mice Xia Date: Wed, 17 Apr 2013 21:24:33 +0800 Subject: [PATCH 20/31] fix CLOUDSTACK 1991 CreateTagsCmd.java, DeleteTagsCmd.java, and ListTagsCmd.java all contain invalid version --- .../apache/cloudstack/api/command/user/tag/CreateTagsCmd.java | 2 +- .../apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java | 2 +- .../org/apache/cloudstack/api/command/user/tag/ListTagsCmd.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java b/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java index 63e2788b77c..a01bac39a4b 100644 --- a/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java @@ -35,7 +35,7 @@ import org.apache.log4j.Logger; import com.cloud.event.EventTypes; import com.cloud.server.ResourceTag; import com.cloud.server.ResourceTag.TaggedResourceType; -@APICommand(name = "createTags", description = "Creates resource tag(s)", responseObject = SuccessResponse.class, since = "Burbank") +@APICommand(name = "createTags", description = "Creates resource tag(s)", responseObject = SuccessResponse.class, since = "4.0.0") public class CreateTagsCmd extends BaseAsyncCmd{ public static final Logger s_logger = Logger.getLogger(CreateTagsCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java b/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java index 084a5142aa1..a6ba0da82b7 100644 --- a/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java @@ -34,7 +34,7 @@ import org.apache.log4j.Logger; import com.cloud.event.EventTypes; import com.cloud.server.ResourceTag.TaggedResourceType; -@APICommand(name = "deleteTags", description = "Deleting resource tag(s)", responseObject = SuccessResponse.class, since = "Burbank") +@APICommand(name = "deleteTags", description = "Deleting resource tag(s)", responseObject = SuccessResponse.class, since = "4.0.0") public class DeleteTagsCmd extends BaseAsyncCmd{ public static final Logger s_logger = Logger.getLogger(DeleteTagsCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/tag/ListTagsCmd.java b/api/src/org/apache/cloudstack/api/command/user/tag/ListTagsCmd.java index e3dc108a757..f80da204cce 100644 --- a/api/src/org/apache/cloudstack/api/command/user/tag/ListTagsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/tag/ListTagsCmd.java @@ -24,7 +24,7 @@ import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.response.ListResponse; import org.apache.cloudstack.api.response.ResourceTagResponse; -@APICommand(name = "listTags", description = "List resource tag(s)", responseObject = ResourceTagResponse.class, since = "Burbank") +@APICommand(name = "listTags", description = "List resource tag(s)", responseObject = ResourceTagResponse.class, since = "4.0.0") public class ListTagsCmd extends BaseListProjectAndAccountResourcesCmd{ private static final String s_name = "listtagsresponse"; From 73f8f46afdcc8cd1bb9b0fbbd4ac65d7093688c6 Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Wed, 17 Apr 2013 19:05:47 +0530 Subject: [PATCH 21/31] deletGlobalLoadbalancer rule was only markign the rule as revoked, but never removing it from the DB after applying the configuration on GSLB provider. This fix will delete the rule from the DB. --- .../gslb/GlobalLoadBalancingRulesServiceImpl.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java b/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java index 696e6e9aa48..1ed2618f6cb 100644 --- a/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java +++ b/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java @@ -392,6 +392,7 @@ public class GlobalLoadBalancingRulesServiceImpl implements GlobalLoadBalancingR //mark all the GSLB-LB mapping to be in revoke state for (GlobalLoadBalancerLbRuleMapVO gslbLbMap : gslbLbMapVos) { gslbLbMap.setRevoke(true); + _gslbLbMapDao.update(gslbLbMap.getId(), gslbLbMap); } } @@ -411,6 +412,16 @@ public class GlobalLoadBalancingRulesServiceImpl implements GlobalLoadBalancingR throw new CloudRuntimeException("Failed to update the gloabal load balancer"); } + txn.start(); + //remove all mappings between GSLB rule and load balancer rules + if (gslbLbMapVos != null) { + for (GlobalLoadBalancerLbRuleMapVO gslbLbMap : gslbLbMapVos) { + _gslbLbMapDao.remove(gslbLbMap.getId()); + } + } + //remove the GSLB rule itself + _gslbRuleDao.remove(gslbRuleId); + txn.commit(); return success; } From 167781ec0184f1332c0b45ca599f460d7d7b5c92 Mon Sep 17 00:00:00 2001 From: Prasanna Santhanam Date: Wed, 17 Apr 2013 17:06:15 +0530 Subject: [PATCH 22/31] refactor marvin to use requests instead of urllib2 Use python-requests [1] for Marvin. Requests enables graceful handling of http connections. Marvin's cloudstackConnection has been refactored, cleaned up to act as a single module for all kinds of cloudstack API requesting. TODO: 1. session based login mechanism of the UI should work from cloudstackConnection 2. cloudmonkey can also reuse /import marvin.cloudstackConnection 3. More graceful handling of POST requests [1] http://docs.python-requests.org/en/latest/ Signed-off-by: Prasanna Santhanam --- tools/marvin/marvin/asyncJobMgr.py | 2 +- tools/marvin/marvin/cloudstackConnection.py | 238 ++++++++++---------- tools/marvin/marvin/cloudstackTestClient.py | 3 +- tools/marvin/marvin/codegenerator.py | 4 +- tools/marvin/marvin/deployDataCenter.py | 1 - tools/marvin/marvin/jsonHelper.py | 7 +- tools/marvin/setup.py | 1 + 7 files changed, 130 insertions(+), 126 deletions(-) diff --git a/tools/marvin/marvin/asyncJobMgr.py b/tools/marvin/marvin/asyncJobMgr.py index 935bebe4d7a..40304fa4141 100644 --- a/tools/marvin/marvin/asyncJobMgr.py +++ b/tools/marvin/marvin/asyncJobMgr.py @@ -54,7 +54,7 @@ class workThread(threading.Thread): try: self.lock.acquire() - result = self.connection.pollAsyncJob(job.jobId, job.responsecls).jobresult + result = self.connection.poll(job.jobId, job.responsecls).jobresult except cloudstackException.cloudstackAPIException, e: result = str(e) finally: diff --git a/tools/marvin/marvin/cloudstackConnection.py b/tools/marvin/marvin/cloudstackConnection.py index 1caeef35ff2..5fd3e1226a4 100644 --- a/tools/marvin/marvin/cloudstackConnection.py +++ b/tools/marvin/marvin/cloudstackConnection.py @@ -15,126 +15,132 @@ # specific language governing permissions and limitations # under the License. -import urllib2 +import requests import urllib -import httplib import base64 import hmac import hashlib -import json -import xml.dom.minidom -import types import time -import inspect import cloudstackException from cloudstackAPI import * import jsonHelper +from requests import ConnectionError +from requests import HTTPError +from requests import Timeout +from requests import RequestException class cloudConnection(object): - def __init__(self, mgtSvr, port=8096, apiKey = None, securityKey = None, asyncTimeout=3600, logging=None, protocol='http', path='/client/api'): + def __init__(self, mgtSvr, port=8096, apiKey=None, securityKey=None, asyncTimeout=3600, logging=None, + scheme='http', path='client/api'): self.apiKey = apiKey self.securityKey = securityKey self.mgtSvr = mgtSvr self.port = port self.logging = logging - if protocol != 'http' and protocol != 'https': - raise ValueError("Protocol must be 'http' or 'https'.") - else: - self.protocol=protocol self.path = path - if port == 8096 or (self.apiKey == None and self.securityKey == None): - self.auth = False - else: - self.auth = True self.retries = 5 self.asyncTimeout = asyncTimeout - - def close(self): - try: - self.connection.close() - except: - pass - + self.auth = True + if port == 8096 or \ + (self.apiKey == None and self.securityKey == None): + self.auth = False + if scheme not in ['http', 'https']: + raise RequestException("Protocol must be HTTP") + self.protocol = scheme + self.baseurl = "%s://%s:%d/%s"%(self.protocol, self.mgtSvr, self.port, self.path) + def __copy__(self): - return cloudConnection(self.mgtSvr, self.port, self.apiKey, self.securityKey, self.asyncTimeout, self.logging, self.protocol, self.path) - - def make_request_with_auth(self, command, requests={}): - requests["command"] = command - requests["apiKey"] = self.apiKey - requests["response"] = "json" - request = zip(requests.keys(), requests.values()) - request.sort(key=lambda x: str.lower(x[0])) - - requestUrl = "&".join(["=".join([r[0], urllib.quote_plus(str(r[1]))]) for r in request]) - hashStr = "&".join(["=".join([str.lower(r[0]), str.lower(urllib.quote_plus(str(r[1]))).replace("+", "%20")]) for r in request]) + return cloudConnection(self.mgtSvr, self.port, self.apiKey, self.securityKey, self.asyncTimeout, + self.logging, self.protocol, self.path) - sig = urllib.quote_plus(base64.encodestring(hmac.new(self.securityKey, hashStr, hashlib.sha1).digest()).strip()) - requestUrl += "&signature=%s"%sig - - try: - self.connection = urllib2.urlopen("%s://%s:%d%s?%s"%(self.protocol, self.mgtSvr, self.port, self.path, requestUrl)) - if self.logging is not None: - self.logging.debug("sending GET request: %s"%requestUrl) - response = self.connection.read() - if self.logging is not None: - self.logging.info("got response: %s"%response) - except IOError, e: - if hasattr(e, 'reason'): - if self.logging is not None: - self.logging.critical("failed to reach %s because of %s"%(self.mgtSvr, e.reason)) - elif hasattr(e, 'code'): - if self.logging is not None: - self.logging.critical("server returned %d error code"%e.code) - raise e - except httplib.HTTPException, h: - if self.logging is not None: - self.logging.debug("encountered http Exception %s"%h.args) - if self.retries > 0: - self.retries = self.retries - 1 - self.make_request_with_auth(command, requests) - else: - self.retries = 5 - raise h - else: - return response - - def make_request_without_auth(self, command, requests={}): - requests["command"] = command - requests["response"] = "json" - requests = zip(requests.keys(), requests.values()) - requestUrl = "&".join(["=".join([request[0], urllib.quote_plus(str(request[1]))]) for request in requests]) - - self.connection = urllib2.urlopen("%s://%s:%d%s?%s"%(self.protocol, self.mgtSvr, self.port, self.path, requestUrl)) - if self.logging is not None: - self.logging.debug("sending GET request without auth: %s"%requestUrl) - response = self.connection.read() - if self.logging is not None: - self.logging.info("got response: %s"%response) - return response - - def pollAsyncJob(self, jobId, response): + def poll(self, jobid, response): + """ + polls the completion of a given jobid + @param jobid: + @param response: + @return: + """ cmd = queryAsyncJobResult.queryAsyncJobResultCmd() - cmd.jobid = jobId + cmd.jobid = jobid timeout = self.asyncTimeout - + while timeout > 0: - asyncResonse = self.make_request(cmd, response, True) - + asyncResonse = self.marvin_request(cmd, response_type=response) + if asyncResonse.jobstatus == 2: raise cloudstackException.cloudstackAPIException("asyncquery", asyncResonse.jobresult) elif asyncResonse.jobstatus == 1: return asyncResonse - + time.sleep(5) if self.logging is not None: - self.logging.debug("job: %s still processing, will timeout in %ds"%(jobId, timeout)) + self.logging.debug("job: %s still processing, will timeout in %ds"%(jobid, timeout)) timeout = timeout - 5 - - raise cloudstackException.cloudstackAPIException("asyncquery", "Async job timeout %s"%jobId) - - def make_request(self, cmd, response = None, raw=False): - commandName = cmd.__class__.__name__.replace("Cmd", "") - isAsync = "false" + + raise cloudstackException.cloudstackAPIException("asyncquery", "Async job timeout %s"%jobid) + + def sign(self, payload): + """ + signs a given request URL when the apiKey and secretKey are known + + @param payload: dict of GET params to be signed + @return: the signature of the payload + """ + params = zip(payload.keys(), payload.values()) + params.sort(key=lambda k: str.lower(k[0])) + hashStr = "&".join( + ["=".join( + [str.lower(r[0]), str.lower(urllib.quote_plus(str(r[1]))).replace("+", "%20")] + ) for r in params] + ) + signature = base64.encodestring(hmac.new(self.securityKey, hashStr, hashlib.sha1).digest()).strip() + self.logging.info("Computed Signature by Marvin: %s"%signature) + return signature + + def request(self, command, auth=True, payload={}, data={}): + """ + Makes requests on the `integration.api.port` + @param command: cloudstack API command name eg: deployVirtualMachineCommand + @param auth: Authentication (apikey,secretKey) => True, else False + @param payload: GET param data composed as a dictionary of key,value pairs + @param data: POST data as a dictionary + @return: + """ + payload["command"] = command + payload["response"] = "json" + + if auth: + payload["apiKey"] = self.apiKey + signature = self.sign(payload) + payload["signature"] = signature + + + try: + if data: + response = requests.get(self.baseurl, params=payload, data=data) + else: + response = requests.get(self.baseurl, params=payload) + except ConnectionError, c: + self.logging.debug("Connection refused. Reason: %s"%(self.baseurl, c)) + raise c + except HTTPError, h: + self.logging.debug("Server returned error code: %s"%h) + raise h + except Timeout, t: + self.logging.debug("Connection timed out with %s"%t) + raise t + except RequestException,r: + self.logging.debug("Error returned by server %s"%r) + raise r + else: + return response + + def sanitize_command(self, cmd): + """ + Removes None values, Validates all required params are present + @param cmd: Cmd object eg: createPhysicalNetwork + @return: + """ requests = {} required = [] for attribute in dir(cmd): @@ -145,11 +151,11 @@ class cloudConnection(object): required = getattr(cmd, attribute) else: requests[attribute] = getattr(cmd, attribute) - + + cmdname = cmd.__class__.__name__.replace("Cmd", "") for requiredPara in required: if requests[requiredPara] is None: - raise cloudstackException.cloudstackAPIException(commandName, "%s is required"%requiredPara) - '''remove none value''' + raise cloudstackException.cloudstackAPIException(cmdname, "%s is required"%requiredPara) for param, value in requests.items(): if value is None: requests.pop(param) @@ -166,28 +172,30 @@ class cloudConnection(object): for k,v in val.iteritems(): requests["%s[%d].%s"%(param,i,k)] = v i = i + 1 - - if self.logging is not None: - self.logging.info("sending command: %s %s"%(commandName, str(requests))) - result = None + return cmdname, isAsync, requests + + def marvin_request(self, cmd, data={}, response_type=None): + """ + Requester for marvin command objects + @param cmd: marvin's command from cloudstackAPI + @param data: any data to be sent in as POST + @param response_type: response type of the command in cmd + @param raw: + @return: + """ + cmdname, isAsync, payload = self.sanitize_command(cmd) + self.logging.info("sending command: %s %s"%(cmdname, str(payload))) if self.auth: - result = self.make_request_with_auth(commandName, requests) + response = self.request(cmdname, auth=True, payload=payload, data=data) else: - result = self.make_request_without_auth(commandName, requests) - - if result is None: - return None - - result = jsonHelper.getResultObj(result, response) - if raw or isAsync == "false": - return result + response = self.request(cmdname, auth=False, payload=payload, data=data) + + self.logging.info("Request: %s Response: %s"%(response.url, response.text)) + response = jsonHelper.getResultObj(response.json, response_type) + + if isAsync == "false": + return response else: - asynJobId = result.jobid - result = self.pollAsyncJob(asynJobId, response) - return result.jobresult - -if __name__ == '__main__': - xml = '407i-1-407-RS3i-1-407-RS3system1ROOT2011-07-30T14:45:19-0700Runningfalse1CA13kvm-50-2054CentOS 5.5(64-bit) no GUI (KVM)CentOS 5.5(64-bit) no GUI (KVM)false1Small Instance15005121120NetworkFilesystem380203255.255.255.065.19.181.165.19.181.110vlan://65vlan://65GuestDirecttrue06:52:da:00:00:08KVM' - conn = cloudConnection(None) - - print conn.paraseReturnXML(xml, deployVirtualMachine.deployVirtualMachineResponse()) + asyncJobId = response.jobid + response = self.poll(asyncJobId, response_type) + return response.jobresult diff --git a/tools/marvin/marvin/cloudstackTestClient.py b/tools/marvin/marvin/cloudstackTestClient.py index e4735e453db..85552ed5523 100644 --- a/tools/marvin/marvin/cloudstackTestClient.py +++ b/tools/marvin/marvin/cloudstackTestClient.py @@ -111,7 +111,8 @@ class cloudstackTestClient(object): apiKey = registerUserRes.apikey securityKey = registerUserRes.secretkey - newUserConnection = cloudstackConnection.cloudConnection(self.connection.mgtSvr, self.connection.port, apiKey, securityKey, self.connection.asyncTimeout, self.connection.logging) + newUserConnection = cloudstackConnection.cloudConnection(self.connection.mgtSvr, self.connection.port, + apiKey, securityKey, self.connection.asyncTimeout, self.connection.logging) self.userApiClient = cloudstackAPIClient.CloudStackAPIClient(newUserConnection) self.userApiClient.connection = newUserConnection return self.userApiClient diff --git a/tools/marvin/marvin/codegenerator.py b/tools/marvin/marvin/codegenerator.py index 0622e5dbc9e..b3b2a863029 100644 --- a/tools/marvin/marvin/codegenerator.py +++ b/tools/marvin/marvin/codegenerator.py @@ -184,9 +184,9 @@ class codeGenerator: body += "\n" for cmdName in self.cmdsName: - body += self.space + 'def %s(self,command):\n'%cmdName + body += self.space + 'def %s(self, command, postdata={}):\n'%cmdName body += self.space + self.space + 'response = %sResponse()\n'%cmdName - body += self.space + self.space + 'response = self.connection.make_request(command, response)\n' + body += self.space + self.space + 'response = self.connection.marvin_request(command, data=postdata, response_type=response)\n' body += self.space + self.space + 'return response\n' body += '\n' diff --git a/tools/marvin/marvin/deployDataCenter.py b/tools/marvin/marvin/deployDataCenter.py index 2e270a7cd58..d358789d8da 100644 --- a/tools/marvin/marvin/deployDataCenter.py +++ b/tools/marvin/marvin/deployDataCenter.py @@ -407,7 +407,6 @@ class deployDataCenters(): logging=self.testClientLogger) if mgt.apiKey is None: apiKey, securityKey = self.registerApiKey() - self.testClient.close() self.testClient = \ cloudstackTestClient.cloudstackTestClient(mgt.mgtSvrIp, 8080, \ apiKey, securityKey, \ diff --git a/tools/marvin/marvin/jsonHelper.py b/tools/marvin/marvin/jsonHelper.py index 652cce0bf9e..37363bc8c91 100644 --- a/tools/marvin/marvin/jsonHelper.py +++ b/tools/marvin/marvin/jsonHelper.py @@ -19,7 +19,6 @@ import cloudstackException import json import inspect from cloudstackAPI import * -import pdb class jsonLoader: '''The recursive class for building and representing objects with.''' @@ -113,12 +112,8 @@ def finalizeResultObj(result, responseName, responsecls): return result else: return result - - - + def getResultObj(returnObj, responsecls=None): - returnObj = json.loads(returnObj) - if len(returnObj) == 0: return None responseName = filter(lambda a: a!=u'cloudstack-version', returnObj.keys())[0] diff --git a/tools/marvin/setup.py b/tools/marvin/setup.py index ab5eb6f7c24..da138ce162b 100644 --- a/tools/marvin/setup.py +++ b/tools/marvin/setup.py @@ -45,6 +45,7 @@ setup(name="Marvin", license="LICENSE.txt", install_requires=[ "mysql-connector-python", + "requests", "paramiko", "nose" ], From 7cc82db345b341f4be3695dfd2406169fedba2c1 Mon Sep 17 00:00:00 2001 From: Mice Xia Date: Wed, 17 Apr 2013 22:05:54 +0800 Subject: [PATCH 23/31] Fix CLOUDSTACK-2062 NPE while deleting the primary storage[Added with scope=cluster] --- .../lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java | 3 +-- server/src/com/cloud/storage/StorageManagerImpl.java | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java index 51ea2126756..a0c991b5ad6 100644 --- a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java +++ b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java @@ -532,8 +532,7 @@ public class CloudStackPrimaryDataStoreLifeCycleImpl implements throw new CloudRuntimeException("Failed to delete storage pool on host"); } - this.dataStoreHelper.deletePrimaryDataStore(store); - return false; + return this.dataStoreHelper.deletePrimaryDataStore(store); } @Override diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index 4e410e4b41e..a182e39dd86 100755 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -963,9 +963,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C DataStoreLifeCycle lifeCycle = storeProvider.getDataStoreLifeCycle(); DataStore store = dataStoreMgr.getDataStore( sPool.getId(), DataStoreRole.Primary); - lifeCycle.deleteDataStore(store); - - return false; + return lifeCycle.deleteDataStore(store); } @Override From 5ee3cc41fecb08b0dba16341fef12684a50ecc98 Mon Sep 17 00:00:00 2001 From: Talluri Date: Wed, 17 Apr 2013 23:36:05 +0530 Subject: [PATCH 24/31] CLOUDSTACK-2032: populate mode in the services dict from the list zones instead of hard coding Signed-off-by: Prasanna Santhanam --- test/integration/component/test_accounts.py | 10 ++++++++-- .../integration/component/test_allocation_states.py | 2 +- test/integration/component/test_blocker_bugs.py | 8 ++++++-- test/integration/component/test_egress_rules.py | 13 +++++++++++-- test/integration/component/test_eip_elb.py | 3 ++- test/integration/component/test_network_offering.py | 5 ++++- test/integration/component/test_project_configs.py | 6 +++++- test/integration/component/test_project_limits.py | 4 +++- .../integration/component/test_project_resources.py | 7 ++++++- test/integration/component/test_project_usage.py | 10 +++++++++- test/integration/component/test_projects.py | 8 +++++++- test/integration/component/test_resource_limits.py | 4 +++- test/integration/component/test_routers.py | 5 ++++- test/integration/component/test_security_groups.py | 9 +++++++-- test/integration/component/test_snapshots.py | 8 +++++++- test/integration/component/test_templates.py | 3 ++- test/integration/component/test_usage.py | 10 +++++++++- test/integration/component/test_vm_passwdenabled.py | 1 + test/integration/component/test_volumes.py | 6 +++++- 19 files changed, 100 insertions(+), 22 deletions(-) diff --git a/test/integration/component/test_accounts.py b/test/integration/component/test_accounts.py index cdb3e58dd94..882423e5764 100644 --- a/test/integration/component/test_accounts.py +++ b/test/integration/component/test_accounts.py @@ -95,7 +95,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced' } @@ -110,6 +109,7 @@ class TestAccounts(cloudstackTestCase): cls.services = Services().services # Get Zone, Domain and templates cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, @@ -239,6 +239,7 @@ class TestRemoveUserFromAccount(cloudstackTestCase): cls.services = Services().services # Get Zone, Domain and templates cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, @@ -506,7 +507,7 @@ class TestNonRootAdminsPrivileges(cloudstackTestCase): cls.services = Services().services # Get Zone settings cls.zone = get_zone(cls.api_client, cls.services) - + cls.services['mode'] = zone.networktype # Create an account, domain etc cls.domain = Domain.create( cls.api_client, @@ -852,6 +853,7 @@ class TesttemplateHierarchy(cloudstackTestCase): cls.services = Services().services # Get Zone settings cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.services["template"]["zoneid"] = cls.zone.id # Create domains, accounts and template @@ -1000,6 +1002,7 @@ class TestAddVmToSubDomain(cloudstackTestCase): cls.api_client, cls.services, ) + cls.services['mode'] = zone.networktype cls.sub_domain = Domain.create( cls.api_client, cls.services["domain"], @@ -1145,6 +1148,7 @@ class TestUserDetails(cloudstackTestCase): # Get Zone, Domain etc cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls._cleanup = [] return @@ -1451,6 +1455,7 @@ class TestUserLogin(cloudstackTestCase): # Get Zone, Domain etc cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls._cleanup = [] return @@ -1615,6 +1620,7 @@ class TestDomainForceRemove(cloudstackTestCase): cls.api_client, cls.services, ) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, diff --git a/test/integration/component/test_allocation_states.py b/test/integration/component/test_allocation_states.py index 103cb10c0cc..efbb3ba9ab6 100644 --- a/test/integration/component/test_allocation_states.py +++ b/test/integration/component/test_allocation_states.py @@ -79,7 +79,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced', } @@ -94,6 +93,7 @@ class TestAllocationState(cloudstackTestCase): cls.services = Services().services # Get Zone, Domain and templates cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls._cleanup = [] return diff --git a/test/integration/component/test_blocker_bugs.py b/test/integration/component/test_blocker_bugs.py index 33e4a73f712..e85a07318b7 100644 --- a/test/integration/component/test_blocker_bugs.py +++ b/test/integration/component/test_blocker_bugs.py @@ -101,8 +101,6 @@ class Services: "ostype": 'CentOS 5.3 (64-bit)', # Cent OS 5.3 (64 bit) "sleep": 60, - "mode": 'advanced', - # Networking mode, Advanced, Basic } @@ -115,6 +113,7 @@ class TestSnapshots(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -422,6 +421,7 @@ class TestTemplate(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.services["virtual_machine"]["zoneid"] = cls.zone.id cls.services["templates"]["zoneid"] = cls.zone.id @@ -543,6 +543,7 @@ class TestNATRules(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, @@ -737,6 +738,7 @@ class TestRouters(cloudstackTestCase): cls.services = Services().services # Get Zone, Domain and templates cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, @@ -863,6 +865,7 @@ class TestRouterRestart(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, @@ -992,6 +995,7 @@ class TestTemplates(cloudstackTestCase): # Get Zone, templates etc cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, diff --git a/test/integration/component/test_egress_rules.py b/test/integration/component/test_egress_rules.py index 6b9cd4f25fc..ffcb299aeac 100644 --- a/test/integration/component/test_egress_rules.py +++ b/test/integration/component/test_egress_rules.py @@ -122,8 +122,6 @@ class Services: # CentOS 5.3 (64-bit) "sleep": 60, "timeout": 10, - "mode": 'basic', - # Networking mode: Basic or Advanced } @@ -156,6 +154,7 @@ class TestDefaultSecurityGroupEgress(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -314,6 +313,7 @@ class TestAuthorizeIngressRule(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -471,6 +471,7 @@ class TestDefaultGroupEgress(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -671,6 +672,7 @@ class TestDefaultGroupEgressAfterDeploy(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -853,6 +855,7 @@ class TestRevokeEgressRule(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -1114,6 +1117,7 @@ class TestInvalidAccountAuthroize(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -1235,6 +1239,7 @@ class TestMultipleAccountsEgressRuleNeg(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -1482,6 +1487,7 @@ class TestMultipleAccountsEgressRule(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -1778,6 +1784,7 @@ class TestStartStopVMWithEgressRule(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -1989,6 +1996,7 @@ class TestInvalidParametersForEgress(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -2171,6 +2179,7 @@ class TestEgressAfterHostMaintainance(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.pod = get_pod( cls.api_client, zoneid=cls.zone.id diff --git a/test/integration/component/test_eip_elb.py b/test/integration/component/test_eip_elb.py index 89fdd25fb25..c588c1bd1c4 100644 --- a/test/integration/component/test_eip_elb.py +++ b/test/integration/component/test_eip_elb.py @@ -85,7 +85,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'basic' } class TestEIP(cloudstackTestCase): @@ -97,6 +96,7 @@ class TestEIP(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, @@ -919,6 +919,7 @@ class TestELB(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, diff --git a/test/integration/component/test_network_offering.py b/test/integration/component/test_network_offering.py index 0de03aa0938..cc6f25e9756 100644 --- a/test/integration/component/test_network_offering.py +++ b/test/integration/component/test_network_offering.py @@ -142,7 +142,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced' } @@ -158,6 +157,7 @@ class TestNOVirtualRouter(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, @@ -736,6 +736,7 @@ class TestNOWithNetscaler(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, @@ -1371,6 +1372,7 @@ class TestNetworkUpgrade(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, @@ -1827,6 +1829,7 @@ class TestSharedNetworkWithoutIp(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, diff --git a/test/integration/component/test_project_configs.py b/test/integration/component/test_project_configs.py index 854b5a42853..92290d0adf3 100644 --- a/test/integration/component/test_project_configs.py +++ b/test/integration/component/test_project_configs.py @@ -102,7 +102,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced' } @@ -117,6 +116,7 @@ class TestUserProjectCreation(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype configs = Configurations.list( cls.api_client, @@ -282,6 +282,7 @@ class TestProjectCreationNegative(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype # Checking for prereqisits - global configs configs = Configurations.list( @@ -427,6 +428,7 @@ class TestProjectInviteRequired(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype # Create domains, account etc. cls.domain = get_domain(cls.api_client, cls.services) @@ -578,6 +580,7 @@ class TestProjectInviteRequiredTrue(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype # Create domains, account etc. cls.domain = get_domain(cls.api_client, cls.services) @@ -730,6 +733,7 @@ class TestProjectInviteTimeout(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype # Create domains, account etc. cls.domain = get_domain(cls.api_client, cls.services) diff --git a/test/integration/component/test_project_limits.py b/test/integration/component/test_project_limits.py index afae1808d04..2eceb884f7e 100644 --- a/test/integration/component/test_project_limits.py +++ b/test/integration/component/test_project_limits.py @@ -116,7 +116,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced', } @@ -131,6 +130,7 @@ class TestProjectLimits(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype # Create domains, account etc. cls.domain = Domain.create( @@ -481,6 +481,7 @@ class TestResourceLimitsProject(cloudstackTestCase): cls.services = Services().services # Get Zone, Domain and templates cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, @@ -921,6 +922,7 @@ class TestMaxProjectNetworks(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, diff --git a/test/integration/component/test_project_resources.py b/test/integration/component/test_project_resources.py index 24091d2f89c..9ad0365c80e 100644 --- a/test/integration/component/test_project_resources.py +++ b/test/integration/component/test_project_resources.py @@ -134,7 +134,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced', } @@ -149,6 +148,7 @@ class TestOfferings(cloudstackTestCase): cls.services = Services().services # Get Zone and template cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, @@ -329,6 +329,7 @@ class TestNetwork(cloudstackTestCase): cls.services = Services().services # Get Zone and template cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, @@ -516,6 +517,7 @@ class TestTemplates(cloudstackTestCase): cls.services = Services().services # Get Zone, Domain and templates cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, @@ -745,6 +747,7 @@ class TestSnapshots(cloudstackTestCase): cls.services = Services().services # Get Zone, Domain and templates cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, @@ -891,6 +894,7 @@ class TestPublicIpAddress(cloudstackTestCase): cls.services = Services().services # Get Zone, Domain and templates cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, @@ -1190,6 +1194,7 @@ class TestSecurityGroup(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, diff --git a/test/integration/component/test_project_usage.py b/test/integration/component/test_project_usage.py index 9f0488d20ce..34335b7bc4d 100644 --- a/test/integration/component/test_project_usage.py +++ b/test/integration/component/test_project_usage.py @@ -109,7 +109,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced' } @@ -125,6 +124,7 @@ class TestVmUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -319,6 +319,7 @@ class TestPublicIPUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, @@ -490,6 +491,7 @@ class TestVolumeUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -674,6 +676,7 @@ class TestTemplateUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.services["server"]["zoneid"] = cls.zone.id template = get_template( cls.api_client, @@ -846,6 +849,7 @@ class TestISOUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.services["server"]["zoneid"] = cls.zone.id cls.services["iso"]["zoneid"] = cls.zone.id # Create Account, ISO image etc @@ -993,6 +997,7 @@ class TestLBRuleUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, @@ -1175,6 +1180,7 @@ class TestSnapshotUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -1352,6 +1358,7 @@ class TestNatRuleUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, @@ -1534,6 +1541,7 @@ class TestVpnUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, diff --git a/test/integration/component/test_projects.py b/test/integration/component/test_projects.py index 3e45cae6651..767cb06675d 100644 --- a/test/integration/component/test_projects.py +++ b/test/integration/component/test_projects.py @@ -96,7 +96,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced' } @@ -111,6 +110,7 @@ class TestMultipleProjectCreation(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype # Create domains, account etc. cls.domain = get_domain( @@ -323,6 +323,7 @@ class TestCrossDomainAccountAdd(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.domain = get_domain( cls.api_client, cls.services @@ -456,6 +457,7 @@ class TestDeleteAccountWithProject(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.domain = get_domain( cls.api_client, cls.services @@ -569,6 +571,7 @@ class TestDeleteDomainWithProject(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype configs = Configurations.list( cls.api_client, @@ -713,6 +716,7 @@ class TestProjectOwners(cloudstackTestCase): cls.services ) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype configs = Configurations.list( cls.api_client, @@ -1136,6 +1140,7 @@ class TestProjectResources(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.domain = get_domain( cls.api_client, cls.services @@ -1444,6 +1449,7 @@ class TestProjectSuspendActivate(cloudstackTestCase): cls.services = Services().services # Get Zone, domain, template etc cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.domain = get_domain( cls.api_client, cls.services diff --git a/test/integration/component/test_resource_limits.py b/test/integration/component/test_resource_limits.py index c20770ab24f..3e7548ee7bd 100644 --- a/test/integration/component/test_resource_limits.py +++ b/test/integration/component/test_resource_limits.py @@ -105,7 +105,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced', } @@ -118,6 +117,7 @@ class TestResourceLimitsAccount(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, @@ -881,6 +881,7 @@ class TestResourceLimitsDomain(cloudstackTestCase): cls.services = Services().services # Get Zone, Domain and templates cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, @@ -1338,6 +1339,7 @@ class TestMaxAccountNetworks(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, diff --git a/test/integration/component/test_routers.py b/test/integration/component/test_routers.py index 02a08dee91c..41bf23f8817 100644 --- a/test/integration/component/test_routers.py +++ b/test/integration/component/test_routers.py @@ -91,7 +91,6 @@ class Services: }, "ostype": 'CentOS 5.3 (64-bit)', # Used for Get_Template : CentOS 5.3 (64 bit) - "mode": 'advanced', # Networking mode: Advanced, basic } @@ -105,6 +104,7 @@ class TestRouterServices(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, @@ -592,6 +592,7 @@ class TestRouterStopCreatePF(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, @@ -803,6 +804,7 @@ class TestRouterStopCreateLB(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, @@ -1014,6 +1016,7 @@ class TestRouterStopCreateFW(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, diff --git a/test/integration/component/test_security_groups.py b/test/integration/component/test_security_groups.py index 39f6d6fcd26..4255d428a45 100644 --- a/test/integration/component/test_security_groups.py +++ b/test/integration/component/test_security_groups.py @@ -94,8 +94,6 @@ class Services: # CentOS 5.3 (64-bit) "sleep": 60, "timeout": 10, - "mode": 'basic', - # Networking mode: Basic or Advanced } @@ -125,6 +123,7 @@ class TestDefaultSecurityGroup(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -397,6 +396,7 @@ class TestAuthorizeIngressRule(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -532,6 +532,7 @@ class TestRevokeIngressRule(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -690,6 +691,7 @@ class TestDhcpOnlyRouter(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -826,6 +828,7 @@ class TestdeployVMWithUserData(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -985,6 +988,7 @@ class TestDeleteSecurityGroup(cloudstackTestCase): # Get Zone, Domain and templates self.domain = get_domain(self.apiclient, self.services) self.zone = get_zone(self.apiclient, self.services) + self.services['mode'] = zone.networktype template = get_template( self.apiclient, @@ -1230,6 +1234,7 @@ class TestIngressRule(cloudstackTestCase): # Get Zone, Domain and templates self.domain = get_domain(self.apiclient, self.services) self.zone = get_zone(self.apiclient, self.services) + self.services['mode'] = zone.networktype template = get_template( self.apiclient, diff --git a/test/integration/component/test_snapshots.py b/test/integration/component/test_snapshots.py index 825b8c6877e..9ff57ab346a 100644 --- a/test/integration/component/test_snapshots.py +++ b/test/integration/component/test_snapshots.py @@ -121,7 +121,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced', # Networking mode: Advanced, Basic } @@ -134,6 +133,7 @@ class TestSnapshotRootDisk(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -356,6 +356,7 @@ class TestSnapshots(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -1190,6 +1191,7 @@ class TestCreateVMsnapshotTemplate(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, @@ -1485,6 +1487,7 @@ class TestAccountSnapshotClean(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -1833,6 +1836,7 @@ class TestSnapshotDetachedDisk(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.disk_offering = DiskOffering.create( cls.api_client, @@ -2120,6 +2124,7 @@ class TestSnapshotLimit(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -2378,6 +2383,7 @@ class TestSnapshotEvents(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, diff --git a/test/integration/component/test_templates.py b/test/integration/component/test_templates.py index 65d9fe0a764..980640d976f 100644 --- a/test/integration/component/test_templates.py +++ b/test/integration/component/test_templates.py @@ -97,7 +97,6 @@ class Services: "ostype": 'CentOS 5.3 (64-bit)', "sleep": 60, "timeout": 10, - "mode": 'advanced', # Networking mode: Advanced, basic } @@ -128,6 +127,7 @@ class TestCreateTemplate(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.services["virtual_machine"]["zoneid"] = cls.zone.id cls.service_offering = ServiceOffering.create( @@ -283,6 +283,7 @@ class TestTemplates(cloudstackTestCase): # Get Zone, templates etc cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype #populate second zone id for iso copy cmd = listZones.listZonesCmd() zones = cls.api_client.listZones(cmd) diff --git a/test/integration/component/test_usage.py b/test/integration/component/test_usage.py index 82d13e5a9ff..27e3719e519 100644 --- a/test/integration/component/test_usage.py +++ b/test/integration/component/test_usage.py @@ -105,7 +105,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced' } @@ -118,6 +117,7 @@ class TestVmUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -301,6 +301,7 @@ class TestPublicIPUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -452,6 +453,7 @@ class TestVolumeUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -625,6 +627,7 @@ class TestTemplateUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.services["server"]["zoneid"] = cls.zone.id template = get_template( cls.api_client, @@ -789,6 +792,7 @@ class TestISOUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.services["server"]["zoneid"] = cls.zone.id cls.services["iso"]["zoneid"] = cls.zone.id # Create Account, ISO image etc @@ -925,6 +929,7 @@ class TestLBRuleUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, @@ -1086,6 +1091,7 @@ class TestSnapshotUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -1252,6 +1258,7 @@ class TestNatRuleUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, @@ -1413,6 +1420,7 @@ class TestVpnUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, diff --git a/test/integration/component/test_vm_passwdenabled.py b/test/integration/component/test_vm_passwdenabled.py index fb881708e2f..eccc488fcf9 100644 --- a/test/integration/component/test_vm_passwdenabled.py +++ b/test/integration/component/test_vm_passwdenabled.py @@ -83,6 +83,7 @@ class TestVMPasswordEnabled(cloudstackTestCase): # Get Zone, Domain and templates domain = get_domain(cls.api_client, cls.services) zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, zone.id, diff --git a/test/integration/component/test_volumes.py b/test/integration/component/test_volumes.py index bedf6efd8b4..d1f3cf5af09 100644 --- a/test/integration/component/test_volumes.py +++ b/test/integration/component/test_volumes.py @@ -87,7 +87,6 @@ class Services: }, "sleep": 50, "ostype": 'CentOS 5.3 (64-bit)', - "mode": 'advanced', } @@ -101,6 +100,7 @@ class TestAttachVolume(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -371,6 +371,7 @@ class TestAttachDetachVolume(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -616,6 +617,7 @@ class TestAttachVolumeISO(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -807,6 +809,7 @@ class TestVolumes(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -1046,6 +1049,7 @@ class TestDeployVmWithCustomDisk(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"], From 26fea7b660f96292f62c857a03fd6e4faaeba220 Mon Sep 17 00:00:00 2001 From: Marcus Sorensen Date: Wed, 17 Apr 2013 12:52:55 -0600 Subject: [PATCH 25/31] CLOUDSTACK-2067 - ACS4.2 - throw LibvirtException instead of squelching it so that callers of startVM in LibvirtComputingResource know that a vm failed to start Signed-off-by: Marcus Sorensen 1366224775 -0600 --- .../hypervisor/kvm/resource/LibvirtComputingResource.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java index 3de7a485fa5..0064edf6a68 100755 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -1077,8 +1077,7 @@ ServerResource { */ conn.domainCreateXML(domainXML, 0); } catch (final LibvirtException e) { - s_logger.warn("Failed to start domain " + vmName + ": " - + e.getMessage(), e); + throw e; } return null; } From 9584815d4f35073214d7893704ff4bf6729a3155 Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Wed, 17 Apr 2013 12:02:09 -0700 Subject: [PATCH 26/31] CLOUDSTACK-1941: introduced "default" flag to account/user objects. Admin/System accounts that come with the CS install are default, and can never be removed. All accounts created by the CS admin, have default flag set to false, and can be removed at any time. --- api/src/com/cloud/user/Account.java | 4 ++++ api/src/com/cloud/user/User.java | 2 ++ core/src/com/cloud/user/AccountVO.java | 7 +++++++ core/src/com/cloud/user/UserVO.java | 11 ++++++++++- .../cloud/server/ConfigurationServerImpl.java | 17 +++++++++++------ .../src/com/cloud/user/AccountManagerImpl.java | 15 ++++++++------- setup/db/db/schema-410to420.sql | 6 ++++++ 7 files changed, 48 insertions(+), 14 deletions(-) diff --git a/api/src/com/cloud/user/Account.java b/api/src/com/cloud/user/Account.java index 5d32fb23253..940a0eb2667 100755 --- a/api/src/com/cloud/user/Account.java +++ b/api/src/com/cloud/user/Account.java @@ -22,6 +22,7 @@ import org.apache.cloudstack.acl.ControlledEntity; import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.InternalIdentity; + public interface Account extends ControlledEntity, InternalIdentity, Identity { public enum Type { Normal, @@ -64,4 +65,7 @@ public interface Account extends ControlledEntity, InternalIdentity, Identity { public Long getDefaultZoneId(); public String getUuid(); + + boolean isDefault(); + } diff --git a/api/src/com/cloud/user/User.java b/api/src/com/cloud/user/User.java index 3742c7bf3e2..dcf27a0de69 100644 --- a/api/src/com/cloud/user/User.java +++ b/api/src/com/cloud/user/User.java @@ -72,5 +72,7 @@ public interface User extends OwnedBy, InternalIdentity { String getRegistrationToken(); boolean isRegistered(); + + boolean isDefault(); } diff --git a/core/src/com/cloud/user/AccountVO.java b/core/src/com/cloud/user/AccountVO.java index 5e939c52173..77110aedb95 100644 --- a/core/src/com/cloud/user/AccountVO.java +++ b/core/src/com/cloud/user/AccountVO.java @@ -65,6 +65,9 @@ public class AccountVO implements Account { @Column(name="default_zone_id") private Long defaultZoneId = null; + + @Column(name = "default") + boolean isDefault; public AccountVO() { this.uuid = UUID.randomUUID().toString(); @@ -179,4 +182,8 @@ public class AccountVO implements Account { this.uuid = uuid; } + @Override + public boolean isDefault() { + return isDefault; + } } diff --git a/core/src/com/cloud/user/UserVO.java b/core/src/com/cloud/user/UserVO.java index 8b7c4e3f1e1..2a857580506 100644 --- a/core/src/com/cloud/user/UserVO.java +++ b/core/src/com/cloud/user/UserVO.java @@ -29,10 +29,11 @@ import javax.persistence.Id; import javax.persistence.Table; import org.apache.cloudstack.api.Identity; +import org.apache.cloudstack.api.InternalIdentity; + import com.cloud.user.Account.State; import com.cloud.utils.db.Encrypt; import com.cloud.utils.db.GenericDao; -import org.apache.cloudstack.api.InternalIdentity; /** * A bean representing a user @@ -92,6 +93,9 @@ public class UserVO implements User, Identity, InternalIdentity { @Column(name="uuid") private String uuid; + + @Column(name = "default") + boolean isDefault; public UserVO() { this.uuid = UUID.randomUUID().toString(); @@ -262,4 +266,9 @@ public class UserVO implements User, Identity, InternalIdentity { this.uuid = uuid; } + @Override + public boolean isDefault() { + return isDefault; + } + } diff --git a/server/src/com/cloud/server/ConfigurationServerImpl.java b/server/src/com/cloud/server/ConfigurationServerImpl.java index 852c00b4c5d..06b787172d1 100755 --- a/server/src/com/cloud/server/ConfigurationServerImpl.java +++ b/server/src/com/cloud/server/ConfigurationServerImpl.java @@ -333,21 +333,24 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio @DB protected void saveUser() { // insert system account - String insertSql = "INSERT INTO `cloud`.`account` (id, uuid, account_name, type, domain_id) VALUES (1, UUID(), 'system', '1', '1')"; + String insertSql = "INSERT INTO `cloud`.`account` (id, uuid, account_name, type, domain_id, account.default) VALUES (1, UUID(), 'system', '1', '1', 1)"; Transaction txn = Transaction.currentTxn(); try { PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql); stmt.executeUpdate(); } catch (SQLException ex) { + s_logger.warn("Failed to system account due to ", ex); + } // insert system user - insertSql = "INSERT INTO `cloud`.`user` (id, uuid, username, password, account_id, firstname, lastname, created)" + - " VALUES (1, UUID(), 'system', RAND(), 1, 'system', 'cloud', now())"; + insertSql = "INSERT INTO `cloud`.`user` (id, uuid, username, password, account_id, firstname, lastname, created, user.default)" + + " VALUES (1, UUID(), 'system', RAND(), 1, 'system', 'cloud', now(), 1)"; txn = Transaction.currentTxn(); try { PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql); stmt.executeUpdate(); } catch (SQLException ex) { + s_logger.warn("Failed to create system user due to ", ex); } // insert admin user, but leave the account disabled until we set a @@ -358,23 +361,25 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio String lastname = "cloud"; // create an account for the admin user first - insertSql = "INSERT INTO `cloud`.`account` (id, uuid, account_name, type, domain_id) VALUES (" + id + ", UUID(), '" + username + "', '1', '1')"; + insertSql = "INSERT INTO `cloud`.`account` (id, uuid, account_name, type, domain_id, account.default) VALUES (" + id + ", UUID(), '" + username + "', '1', '1', 1)"; txn = Transaction.currentTxn(); try { PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql); stmt.executeUpdate(); } catch (SQLException ex) { + s_logger.warn("Failed to create admin account due to ", ex); } // now insert the user - insertSql = "INSERT INTO `cloud`.`user` (id, uuid, username, password, account_id, firstname, lastname, created, state) " + - "VALUES (" + id + ", UUID(), '" + username + "', RAND(), 2, '" + firstname + "','" + lastname + "',now(), 'disabled')"; + insertSql = "INSERT INTO `cloud`.`user` (id, uuid, username, password, account_id, firstname, lastname, created, state, user.default) " + + "VALUES (" + id + ", UUID(), '" + username + "', RAND(), 2, '" + firstname + "','" + lastname + "',now(), 'disabled', 1)"; txn = Transaction.currentTxn(); try { PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql); stmt.executeUpdate(); } catch (SQLException ex) { + s_logger.warn("Failed to create admin user due to ", ex); } try { diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java index e74c49124f7..8de73fbd582 100755 --- a/server/src/com/cloud/user/AccountManagerImpl.java +++ b/server/src/com/cloud/user/AccountManagerImpl.java @@ -37,7 +37,6 @@ import javax.ejb.Local; import javax.inject.Inject; import javax.naming.ConfigurationException; -import com.cloud.event.ActionEventUtils; import org.apache.cloudstack.acl.ControlledEntity; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.acl.SecurityChecker; @@ -53,7 +52,6 @@ import org.apache.log4j.Logger; import com.cloud.api.ApiDBUtils; import com.cloud.api.query.dao.UserAccountJoinDao; import com.cloud.api.query.vo.ControlledViewEntity; - import com.cloud.configuration.Config; import com.cloud.configuration.ConfigurationManager; import com.cloud.configuration.ResourceLimit; @@ -65,6 +63,7 @@ import com.cloud.domain.Domain; import com.cloud.domain.DomainVO; import com.cloud.domain.dao.DomainDao; import com.cloud.event.ActionEvent; +import com.cloud.event.ActionEventUtils; import com.cloud.event.EventTypes; import com.cloud.exception.AgentUnavailableException; import com.cloud.exception.CloudAuthenticationException; @@ -1178,8 +1177,9 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M checkAccess(caller, null, true, account); - if (account.getId() == Account.ACCOUNT_ID_SYSTEM) { - throw new PermissionDeniedException("Account id : " + accountId + " is a system account, delete is not allowed"); + //don't allow to delete default account (system and admin) + if (account.isDefault()) { + throw new InvalidParameterValueException("The account is default and can't be removed"); } // Account that manages project(s) can't be removed @@ -1384,9 +1384,10 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) { throw new InvalidParameterValueException("The specified user doesn't exist in the system"); } - - if (account.getId() == Account.ACCOUNT_ID_SYSTEM) { - throw new InvalidParameterValueException("Account id : " + user.getAccountId() + " is a system account, delete for user associated with this account is not allowed"); + + //don't allow to delete default user (system and admin users) + if (user.isDefault()) { + throw new InvalidParameterValueException("The user is default and can't be removed"); } checkAccess(UserContext.current().getCaller(), null, true, account); diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql index 6a7a72c5d2d..bd145cb82f2 100644 --- a/setup/db/db/schema-410to420.sql +++ b/setup/db/db/schema-410to420.sql @@ -720,3 +720,9 @@ ALTER TABLE `cloud`.`network_offerings` ADD COLUMN `eip_associate_public_ip` int -- Re-enable foreign key checking, at the end of the upgrade path SET foreign_key_checks = 1; + +-- Add "default" field to account/user tables +ALTER TABLE `cloud`.`account` ADD COLUMN `default` int(1) unsigned NOT NULL DEFAULT '0' COMMENT '1 if account is default'; +ALTER TABLE `cloud`.`user` ADD COLUMN `default` int(1) unsigned NOT NULL DEFAULT '0' COMMENT '1 if user is default'; +UPDATE `cloud`.`account` SET `cloud`.`account`.`default`=1 WHERE id IN (1,2); +UPDATE `cloud`.`user` SET `cloud`.`user`.`default`=1 WHERE id IN (1,2); From 8d0bea994dcd74cd6707b58ac2e4060a93f52d96 Mon Sep 17 00:00:00 2001 From: Marcus Sorensen Date: Wed, 17 Apr 2013 13:10:29 -0600 Subject: [PATCH 27/31] CLOUDSTACK-2071 - VirtualMachineManagerImpl.java start() method for instance can fail to start a VM without notifying caller, if no exception is triggered. The result is that VM start looks successful but was not. This fixes it by throwing an exception at the very end if the object to be passed back is still null. Signed-off-by: Marcus Sorensen 1366225829 -0600 --- server/src/com/cloud/vm/VirtualMachineManagerImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java index 40725314f46..a53e38072ff 100755 --- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -866,6 +866,11 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac } } + if (startedVm == null) { + throw new CloudRuntimeException("Unable to start instance '" + vm.getHostName() + + "' (" + vm.getUuid() + "), see management server log for details"); + } + return startedVm; } From 11480c3af8b7d55625e791f955d7d077ea7f488e Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Wed, 17 Apr 2013 12:29:09 -0700 Subject: [PATCH 28/31] CLOUDSTACK-1941: added isDefault parameter to account/user response --- .../api/response/AccountResponse.java | 7 + .../cloudstack/api/response/UserResponse.java | 8 + .../com/cloud/api/query/QueryManagerImpl.java | 11 +- .../api/query/dao/AccountJoinDaoImpl.java | 8 +- .../api/query/dao/UserAccountJoinDaoImpl.java | 1 + .../com/cloud/api/query/vo/AccountJoinVO.java | 10 + .../cloud/api/query/vo/UserAccountJoinVO.java | 16 +- .../cloud/server/ConfigurationServerImpl.java | 5 - setup/db/db/schema-410to420.sql | 330 ++++++++++-------- 9 files changed, 234 insertions(+), 162 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/response/AccountResponse.java b/api/src/org/apache/cloudstack/api/response/AccountResponse.java index c109a6325c8..1e59822180f 100644 --- a/api/src/org/apache/cloudstack/api/response/AccountResponse.java +++ b/api/src/org/apache/cloudstack/api/response/AccountResponse.java @@ -183,6 +183,9 @@ public class AccountResponse extends BaseResponse { @SerializedName(ApiConstants.ACCOUNT_DETAILS) @Param(description="details for the account") private Map details; + + @SerializedName(ApiConstants.IS_DEFAULT) @Param(description="true if account is default, false otherwise", since="4.2.0") + private Boolean isDefault; @Override @@ -381,4 +384,8 @@ public class AccountResponse extends BaseResponse { public void setDefaultZone(String defaultZoneId) { this.defaultZoneId = defaultZoneId; } + + public void setIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + } } diff --git a/api/src/org/apache/cloudstack/api/response/UserResponse.java b/api/src/org/apache/cloudstack/api/response/UserResponse.java index 9cd25cb7ad6..e70a310bf06 100644 --- a/api/src/org/apache/cloudstack/api/response/UserResponse.java +++ b/api/src/org/apache/cloudstack/api/response/UserResponse.java @@ -18,6 +18,7 @@ package org.apache.cloudstack.api.response; import java.util.Date; +import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseResponse; import org.apache.cloudstack.api.EntityReference; @@ -74,6 +75,9 @@ public class UserResponse extends BaseResponse { @SerializedName("iscallerchilddomain") @Param(description="the boolean value representing if the updating target is in caller's child domain") private boolean isCallerChildDomain; + + @SerializedName(ApiConstants.IS_DEFAULT) @Param(description="true if user is default, false otherwise", since="4.2.0") + private Boolean isDefault; @Override public String getObjectId() { @@ -206,4 +210,8 @@ public class UserResponse extends BaseResponse { public void setIsCallerChildDomain(boolean isCallerChildDomain) { this.isCallerChildDomain = isCallerChildDomain; } + + public void setIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + } } diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java index 5ffc2db995c..3114ea5c243 100644 --- a/server/src/com/cloud/api/query/QueryManagerImpl.java +++ b/server/src/com/cloud/api/query/QueryManagerImpl.java @@ -25,12 +25,9 @@ import java.util.Set; import javax.ejb.Local; import javax.inject.Inject; -import javax.naming.ConfigurationException; -import org.apache.cloudstack.affinity.AffinityGroup; import org.apache.cloudstack.affinity.AffinityGroupResponse; import org.apache.cloudstack.affinity.AffinityGroupVMMapVO; -import org.apache.cloudstack.affinity.AffinityGroupVO; import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao; import org.apache.cloudstack.api.command.admin.host.ListHostsCmd; import org.apache.cloudstack.api.command.admin.router.ListRoutersCmd; @@ -111,7 +108,6 @@ import com.cloud.api.query.vo.UserAccountJoinVO; import com.cloud.api.query.vo.UserVmJoinVO; import com.cloud.api.query.vo.VolumeJoinVO; import com.cloud.configuration.dao.ConfigurationDao; -import com.cloud.dc.DataCenterVO; import com.cloud.domain.Domain; import com.cloud.domain.DomainVO; import com.cloud.domain.dao.DomainDao; @@ -124,9 +120,9 @@ import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.network.security.SecurityGroupVMMapVO; import com.cloud.network.security.dao.SecurityGroupVMMapDao; import com.cloud.org.Grouping; -import com.cloud.projects.ProjectInvitation; -import com.cloud.projects.Project.ListProjectResourcesCriteria; import com.cloud.projects.Project; +import com.cloud.projects.Project.ListProjectResourcesCriteria; +import com.cloud.projects.ProjectInvitation; import com.cloud.projects.ProjectManager; import com.cloud.projects.dao.ProjectAccountDao; import com.cloud.projects.dao.ProjectDao; @@ -142,10 +138,8 @@ import com.cloud.user.dao.AccountDao; import com.cloud.utils.DateUtil; import com.cloud.utils.Pair; import com.cloud.utils.Ternary; -import com.cloud.utils.component.Manager; import com.cloud.utils.component.ManagerBase; import com.cloud.utils.db.Filter; -import com.cloud.utils.db.JoinBuilder; import com.cloud.utils.db.SearchBuilder; import com.cloud.utils.db.SearchCriteria; import com.cloud.utils.db.SearchCriteria.Func; @@ -1699,6 +1693,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService { sb.and("typeNEQ", sb.entity().getType(), SearchCriteria.Op.NEQ); sb.and("idNEQ", sb.entity().getId(), SearchCriteria.Op.NEQ); + if (listForDomain && isRecursive) { sb.and("path", sb.entity().getDomainPath(), SearchCriteria.Op.LIKE); } diff --git a/server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java index 51ac5e61edb..796ae54d52f 100644 --- a/server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java +++ b/server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java @@ -20,17 +20,16 @@ import java.util.List; import javax.ejb.Local; +import org.apache.cloudstack.api.response.AccountResponse; +import org.apache.cloudstack.api.response.UserResponse; import org.apache.log4j.Logger; +import org.springframework.stereotype.Component; import com.cloud.api.ApiDBUtils; import com.cloud.api.query.ViewResponseHelper; import com.cloud.api.query.vo.AccountJoinVO; import com.cloud.api.query.vo.UserAccountJoinVO; import com.cloud.configuration.Resource.ResourceType; -import org.apache.cloudstack.api.response.AccountResponse; -import org.apache.cloudstack.api.response.UserResponse; -import org.springframework.stereotype.Component; - import com.cloud.user.Account; import com.cloud.utils.db.GenericDaoBase; import com.cloud.utils.db.SearchBuilder; @@ -66,6 +65,7 @@ public class AccountJoinDaoImpl extends GenericDaoBase impl accountResponse.setState(account.getState().toString()); accountResponse.setNetworkDomain(account.getNetworkDomain()); accountResponse.setDefaultZone(account.getDataCenterUuid()); + accountResponse.setIsDefault(account.isDefault()); // get network stat accountResponse.setBytesReceived(account.getBytesReceived()); diff --git a/server/src/com/cloud/api/query/dao/UserAccountJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/UserAccountJoinDaoImpl.java index 7072324080d..43b3a2d0a1f 100644 --- a/server/src/com/cloud/api/query/dao/UserAccountJoinDaoImpl.java +++ b/server/src/com/cloud/api/query/dao/UserAccountJoinDaoImpl.java @@ -80,6 +80,7 @@ public class UserAccountJoinDaoImpl extends GenericDaoBase Date: Wed, 17 Apr 2013 16:59:03 -0400 Subject: [PATCH 29/31] Removing the VMware template upgrade step from the 4.0.x to 4.1.0 upgrade process, as it's actually only needed from 3.x --- docs/en-US/Release_Notes.xml | 88 +----------------------------------- 1 file changed, 1 insertion(+), 87 deletions(-) diff --git a/docs/en-US/Release_Notes.xml b/docs/en-US/Release_Notes.xml index 97531afe5cd..f243a26cce2 100644 --- a/docs/en-US/Release_Notes.xml +++ b/docs/en-US/Release_Notes.xml @@ -4112,7 +4112,7 @@ under the License. If you run into any issues during upgrades, please feel free to ask questions on users@apache.cloudstack.org or dev@apache.cloudstack.org.
Upgrade from 4.0.x to 4.1.0 - This section will guide you from Apache CloudStack 4.0.x versions to &PRODUCT; 4.1.0. + This section will guide you from &PRODUCT; 4.0.x versions to &PRODUCT; 4.1.0. Any steps that are hypervisor-specific will be called out with a note. Package Structure Changes The package structure for &PRODUCT; has changed significantly since the 4.0.x releases. If you've compiled your own packages, you'll notice that the package names and the number of packages has changed. This is not a bug. @@ -4125,92 +4125,6 @@ under the License. Create RPM or Debian packages (as appropriate) and a repository from the 4.1.0 source, or check the Apache CloudStack downloads page at http://cloudstack.apache.org/downloads.html for package repositories supplied by community members. You will need them for step or step . Instructions for creating packages from the &PRODUCT; source are in the Installation Guide. - - For VMware Only - This step is only required if you are using VMware. You can safely skip this step if you are using KVM and/or Xen only. - - In each zone that includes VMware hosts, you need to add a new system VM template. - - - While running the existing 3.0.2 system, log in to the UI as root administrator. - - - In the left navigation bar, click Templates. - - - In Select view, click Templates. - - - Click Register template. - The Register template dialog box is displayed. - - - In the Register template dialog box, specify the following values (do not change these): - - - - - - - Field - Value - - - - - Name - systemvm-vmware-4.1 - - - Description - systemvm-vmware-4.1 - - - URL - http://download.cloud.com/templates/burbank/burbank-systemvm-08012012.ova - - - Zone - Choose the zone where this hypervisor is used - - - Hypervisor - VMware - - - Format - OVA - - - OS Type - Debian GNU/Linux 5.0 (32-bit) - - - Extractable - no - - - Password Enabled - no - - - Public - no - - - Featured - no - - - - - - - Watch the screen to be sure that the template downloads successfully and enters - the READY state. Do not proceed until this is successful. - - - Stop your management server or servers. Run this on all management server hosts: # service cloud-management stop From 112446602d119a7599e7077831ea73892d889a66 Mon Sep 17 00:00:00 2001 From: Prachi Damle Date: Wed, 17 Apr 2013 14:59:04 -0700 Subject: [PATCH 30/31] (CLOUDSTACK-2068) Anti-Affinity - When Vm deployment associated with anity-affinity group fails , it is still included in the vmlist of the anti-affiity group Changes: - Added removal of the groups association when VM reaches 'Error' state. --- .../org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java | 2 +- .../apache/cloudstack/affinity/AffinityGroupServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java index 30f03b88995..08f94570ee8 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java @@ -95,7 +95,7 @@ public class ListVMsCmd extends BaseListTaggedResourcesCmd { @Parameter(name=ApiConstants.DETAILS, type=CommandType.LIST, collectionType=CommandType.STRING, description="comma separated list of host details requested, " + - "value can be a list of [all, group, nics, stats, secgrp, tmpl, servoff, iso, volume, min]." + + "value can be a list of [all, group, nics, stats, secgrp, tmpl, servoff, iso, volume, min, affgrp]." + " If no parameter is passed in, the details will be defaulted to all" ) private List viewDetails; diff --git a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java index 2b490efe6e5..fc2cfcf8d95 100644 --- a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java +++ b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java @@ -295,7 +295,7 @@ public class AffinityGroupServiceImpl extends ManagerBase implements AffinityGro if (!status) { return false; } - if ((newState == State.Expunging)) { + if ((newState == State.Expunging) || (newState == State.Error)) { // cleanup all affinity groups associations of the Expunged VM SearchCriteria sc = _affinityGroupVMMapDao.createSearchCriteria(); sc.addAnd("instanceId", SearchCriteria.Op.EQ, vo.getId()); From 11162f5917ab194f85e41bca7b3dc39bd3bbaeef Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Wed, 17 Apr 2013 15:04:36 -0700 Subject: [PATCH 31/31] Removed set() methods from IpAddress related interfaces --- api/src/com/cloud/network/IpAddress.java | 9 --------- api/src/com/cloud/network/PublicIpAddress.java | 3 --- .../src/com/cloud/network/addr/PublicIp.java | 18 +----------------- .../src/com/cloud/network/dao/IPAddressVO.java | 2 -- 4 files changed, 1 insertion(+), 31 deletions(-) diff --git a/api/src/com/cloud/network/IpAddress.java b/api/src/com/cloud/network/IpAddress.java index fce8f38c2f2..71c9b4e0bf3 100644 --- a/api/src/com/cloud/network/IpAddress.java +++ b/api/src/com/cloud/network/IpAddress.java @@ -78,16 +78,7 @@ public interface IpAddress extends ControlledEntity, Identity, InternalIdentity boolean getSystem(); - /** - * @return - */ Long getVpcId(); - /** - * @param vpcId - */ - void setVpcId(Long vpcId); String getVmIp(); - void setVmIp(String vmIp); - } diff --git a/api/src/com/cloud/network/PublicIpAddress.java b/api/src/com/cloud/network/PublicIpAddress.java index d81e9c1ee6c..916d43428e9 100644 --- a/api/src/com/cloud/network/PublicIpAddress.java +++ b/api/src/com/cloud/network/PublicIpAddress.java @@ -30,7 +30,4 @@ public interface PublicIpAddress extends ControlledEntity, IpAddress, Vlan, Inte public String getNetmask(); public String getGateway(); - - @Override - public String getVlanTag(); } diff --git a/server/src/com/cloud/network/addr/PublicIp.java b/server/src/com/cloud/network/addr/PublicIp.java index 8217e4e47b9..25e9d308b14 100644 --- a/server/src/com/cloud/network/addr/PublicIp.java +++ b/server/src/com/cloud/network/addr/PublicIp.java @@ -194,23 +194,12 @@ public class PublicIp implements PublicIpAddress { public boolean getSystem() { return _addr.getSystem(); } - - /* (non-Javadoc) - * @see com.cloud.network.IpAddress#getVpcId() - */ + @Override public Long getVpcId() { return _addr.getVpcId(); } - /* (non-Javadoc) - * @see com.cloud.network.IpAddress#setVpcId(java.lang.Long) - */ - @Override - public void setVpcId(Long vpcId) { - _addr.setVpcId(vpcId); - } - @Override public String getIp6Gateway() { return _vlan.getIp6Gateway(); @@ -230,9 +219,4 @@ public class PublicIp implements PublicIpAddress { public String getVmIp() { return _addr.getVmIp(); } - - @Override - public void setVmIp(String vmIp) { - _addr.setVmIp(vmIp); - } } diff --git a/server/src/com/cloud/network/dao/IPAddressVO.java b/server/src/com/cloud/network/dao/IPAddressVO.java index 8ce8d3382b2..c5c78e557ae 100644 --- a/server/src/com/cloud/network/dao/IPAddressVO.java +++ b/server/src/com/cloud/network/dao/IPAddressVO.java @@ -292,7 +292,6 @@ public class IPAddressVO implements IpAddress { return vpcId; } - @Override public void setVpcId(Long vpcId) { this.vpcId = vpcId; } @@ -302,7 +301,6 @@ public class IPAddressVO implements IpAddress { return vmIp; } - @Override public void setVmIp(String vmIp) { this.vmIp = vmIp; }