You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ah...@apache.org on 2013/06/27 22:57:03 UTC
[01/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Updated Branches:
refs/heads/vmsync cbca4bb6f -> 3c2aa1850
CLOUDSTACK-3060: condition for vmware while getting process status.
Signed-off-by: Prasanna Santhanam <ts...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1fc7aeaa
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1fc7aeaa
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1fc7aeaa
Branch: refs/heads/vmsync
Commit: 1fc7aeaaea80e30651a47024cf928ff11fb29e9c
Parents: 0962633
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Thu Jun 20 00:27:29 2013 -0400
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Tue Jun 25 12:30:18 2013 +0530
----------------------------------------------------------------------
test/integration/smoke/test_routers.py | 52 ++++++++++++++++++++++++++---
1 file changed, 48 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1fc7aeaa/test/integration/smoke/test_routers.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_routers.py b/test/integration/smoke/test_routers.py
index d89acf9..2e4553b 100644
--- a/test/integration/smoke/test_routers.py
+++ b/test/integration/smoke/test_routers.py
@@ -180,7 +180,18 @@ class TestRouterServices(cloudstackTestCase):
"Check list router response for router state"
)
- result = get_process_status(
+ if self.apiclient.hypervisor.lower() == 'vmware':
+ result = get_process_status(
+ self.apiclient.connection.mgtSvr,
+ 22,
+ self.apiclient.connection.user,
+ self.apiclient.connection.passwd,
+ router.linklocalip,
+ "service dnsmasq status",
+ hypervisor=self.apiclient.hypervisor
+ )
+ else:
+ result = get_process_status(
host.ipaddress,
self.services['virtual_machine']["publicport"],
self.vm_1.username,
@@ -242,7 +253,18 @@ class TestRouterServices(cloudstackTestCase):
"Check list router response for router state"
)
- result = get_process_status(
+ if self.apiclient.hypervisor.lower() == 'vmware':
+ result = get_process_status(
+ self.apiclient.connection.mgtSvr,
+ 22,
+ self.apiclient.connection.user,
+ self.apiclient.connection.passwd,
+ router.linklocalip,
+ "service dnsmasq status",
+ hypervisor=self.apiclient.hypervisor
+ )
+ else:
+ result = get_process_status(
host.ipaddress,
self.services['virtual_machine']["publicport"],
self.vm_1.username,
@@ -259,7 +281,18 @@ class TestRouterServices(cloudstackTestCase):
"Check dnsmasq service is running or not"
)
- result = get_process_status(
+ if self.apiclient.hypervisor.lower() == 'vmware':
+ result = get_process_status(
+ self.apiclient.connection.mgtSvr,
+ 22,
+ self.apiclient.connection.user,
+ self.apiclient.connection.passwd,
+ router.linklocalip,
+ "service haproxy status",
+ hypervisor=self.apiclient.hypervisor
+ )
+ else:
+ result = get_process_status(
host.ipaddress,
self.services['virtual_machine']["publicport"],
self.vm_1.username,
@@ -423,7 +456,18 @@ class TestRouterServices(cloudstackTestCase):
)
host = hosts[0]
- res = get_process_status(
+ if self.apiclient.hypervisor.lower() == 'vmware':
+ res = get_process_status(
+ self.apiclient.connection.mgtSvr,
+ 22,
+ self.apiclient.connection.user,
+ self.apiclient.connection.passwd,
+ router.linklocalip,
+ "uptime",
+ hypervisor=self.apiclient.hypervisor
+ )
+ else:
+ res = get_process_status(
host.ipaddress,
self.services['virtual_machine']["publicport"],
self.vm_1.username,
[13/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-3121: UI > VPC dashboard - fix a bug that showed wrong count number of private gateways.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6fdd0eea
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6fdd0eea
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6fdd0eea
Branch: refs/heads/vmsync
Commit: 6fdd0eea1b85642833d0f32dab11aa0518a43e31
Parents: 774141a
Author: Jessica Wang <je...@apache.org>
Authored: Tue Jun 25 16:44:37 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Tue Jun 25 16:44:37 2013 -0700
----------------------------------------------------------------------
ui/scripts/vpc.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6fdd0eea/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index f610889..310fbb6 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -3453,7 +3453,10 @@
$.ajax({
url: createURL('listPrivateGateways'),
async: false,
- data: { 'vpcid': args.context.vpc[0].id },
+ data: {
+ 'vpcid': args.context.vpc[0].id,
+ listAll: true
+ },
success: function(json) {
privateGateways = json.listprivategatewaysresponse;
},
[22/50] [abbrv] CLOUDSTACK-3050 XS - Enforce recommended guest OS
values for ram Signed off by : nitin mehta
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f90279d9/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java
index 95774bf..407f069 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java
@@ -124,6 +124,34 @@ public class XenServer56FP1Resource extends XenServer56Resource {
}
}
+ public long getStaticMax(String os, boolean b, long dynamicMinRam, long dynamicMaxRam){
+ long recommendedValue = CitrixHelper.getXenServer56FP1StaticMax(os, b);
+ if(recommendedValue == 0){
+ s_logger.warn("No recommended value found for dynamic max, setting static max and dynamic max equal");
+ return dynamicMaxRam;
+ }
+
+ long staticMax = Math.min(recommendedValue, 4l * dynamicMinRam); // XS constraint for stability
+ if (dynamicMaxRam > staticMax){ // XS contraint that dynamic max <= static max
+ s_logger.warn("dynamixMax " + dynamicMaxRam + " cant be greater than static max " + staticMax + ", can lead to stability issues. Setting static max as much as dynamic max ");
+ return dynamicMaxRam;
+ }
+ return staticMax;
+ }
+
+ public long getStaticMin(String os, boolean b, long dynamicMinRam, long dynamicMaxRam){
+ long recommendedValue = CitrixHelper.getXenServer56FP1StaticMin(os, b);
+ if(recommendedValue == 0){
+ s_logger.warn("No recommended value found for dynamic min");
+ return dynamicMinRam;
+ }
+
+ if(dynamicMinRam < recommendedValue){ // XS contraint that dynamic min > static min
+ s_logger.warn("Vm is set to dynamixMin " + dynamicMinRam + " less than the recommended static min " + recommendedValue + ", could lead to stability issues.");
+ }
+ return dynamicMinRam;
+ }
+
@Override
protected VM createVmFromTemplate(Connection conn, VirtualMachineTO vmSpec, Host host) throws XenAPIException, XmlRpcException {
String guestOsTypeName = getGuestOsType(vmSpec.getOs(), vmSpec.getBootloader() == BootloaderType.CD);
@@ -144,9 +172,8 @@ public class XenServer56FP1Resource extends XenServer56Resource {
Map<String, String> details = vmSpec.getDetails();
if (isDmcEnabled(conn, host) && vmSpec.isEnableDynamicallyScaleVm()) {
//scaling is allowed
- vmr.memoryStaticMin = mem_128m; //128MB
- //TODO: Remove hardcoded 8GB and assign proportionate to ServiceOffering and mem overcommit ratio
- vmr.memoryStaticMax = 8589934592L; //8GB
+ vmr.memoryStaticMin = getStaticMin(vmSpec.getOs(), vmSpec.getBootloader() == BootloaderType.CD, vmSpec.getMinRam(), vmSpec.getMaxRam());
+ vmr.memoryStaticMax = getStaticMax(vmSpec.getOs(), vmSpec.getBootloader() == BootloaderType.CD, vmSpec.getMinRam(), vmSpec.getMaxRam());
vmr.memoryDynamicMin = vmSpec.getMinRam();
vmr.memoryDynamicMax = vmSpec.getMaxRam();
} else {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f90279d9/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java
index 38e1271..7c6443f 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java
@@ -57,4 +57,33 @@ public class XenServer56SP2Resource extends XenServer56FP1Resource {
return files;
}
+ @Override
+ public long getStaticMax(String os, boolean b, long dynamicMinRam, long dynamicMaxRam){
+ long recommendedValue = CitrixHelper.getXenServer56SP2StaticMax(os, b);
+ if(recommendedValue == 0){
+ s_logger.warn("No recommended value found for dynamic max, setting static max and dynamic max equal");
+ return dynamicMaxRam;
+ }
+ long staticMax = Math.min(recommendedValue, 4l * dynamicMinRam); // XS constraint for stability
+ if (dynamicMaxRam > staticMax){ // XS contraint that dynamic max <= static max
+ s_logger.warn("dynamixMax " + dynamicMaxRam + " cant be greater than static max " + staticMax + ", can lead to stability issues. Setting static max as much as dynamic max ");
+ return dynamicMaxRam;
+ }
+ return staticMax;
+ }
+
+ @Override
+ public long getStaticMin(String os, boolean b, long dynamicMinRam, long dynamicMaxRam){
+ long recommendedValue = CitrixHelper.getXenServer56SP2StaticMin(os, b);
+ if(recommendedValue == 0){
+ s_logger.warn("No recommended value found for dynamic min");
+ return dynamicMinRam;
+ }
+
+ if(dynamicMinRam < recommendedValue){ // XS contraint that dynamic min > static min
+ s_logger.warn("Vm is set to dynamixMin " + dynamicMinRam + " less than the recommended static min " + recommendedValue + ", could lead to stability issues");
+ }
+ return dynamicMinRam;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f90279d9/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer600Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer600Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer600Resource.java
index bd8518b..d1d11eb 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer600Resource.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer600Resource.java
@@ -42,6 +42,35 @@ public class XenServer600Resource extends XenServer56FP1Resource {
protected String getGuestOsType(String stdType, boolean bootFromCD) {
return CitrixHelper.getXenServer600GuestOsType(stdType, bootFromCD);
}
+
+ @Override
+ public long getStaticMax(String os, boolean b, long dynamicMinRam, long dynamicMaxRam){
+ long recommendedValue = CitrixHelper.getXenServer600StaticMax(os, b);
+ if(recommendedValue == 0){
+ s_logger.warn("No recommended value found for dynamic max, setting static max and dynamic max equal");
+ return dynamicMaxRam;
+ }
+ long staticMax = Math.min(recommendedValue, 4l * dynamicMinRam); // XS constraint for stability
+ if (dynamicMaxRam > staticMax){ // XS contraint that dynamic max <= static max
+ s_logger.warn("dynamixMax " + dynamicMaxRam + " cant be greater than static max " + staticMax + ", can lead to stability issues. Setting static max as much as dynamic max ");
+ return dynamicMaxRam;
+ }
+ return staticMax;
+ }
+
+ @Override
+ public long getStaticMin(String os, boolean b, long dynamicMinRam, long dynamicMaxRam){
+ long recommendedValue = CitrixHelper.getXenServer600StaticMin(os, b);
+ if(recommendedValue == 0){
+ s_logger.warn("No recommended value found for dynamic min");
+ return dynamicMinRam;
+ }
+
+ if(dynamicMinRam < recommendedValue){ // XS contraint that dynamic min > static min
+ s_logger.warn("Vm is set to dynamixMin " + dynamicMinRam + " less than the recommended static min " + recommendedValue + ", could lead to stability issues");
+ }
+ return dynamicMinRam;
+ }
@Override
protected List<File> getPatchFiles() {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f90279d9/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer602Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer602Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer602Resource.java
index 212bc47..9e442e3 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer602Resource.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer602Resource.java
@@ -56,4 +56,32 @@ public class XenServer602Resource extends XenServer56FP1Resource {
return files;
}
+ @Override
+ public long getStaticMax(String os, boolean b, long dynamicMinRam, long dynamicMaxRam){
+ long recommendedValue = CitrixHelper.getXenServer602StaticMax(os, b);
+ if(recommendedValue == 0){
+ s_logger.warn("No recommended value found for dynamic max, setting static max and dynamic max equal");
+ return dynamicMaxRam;
+ }
+ long staticMax = Math.min(recommendedValue, 4l * dynamicMinRam); // XS constraint for stability
+ if (dynamicMaxRam > staticMax){ // XS contraint that dynamic max <= static max
+ s_logger.warn("dynamixMax " + dynamicMaxRam + " cant be greater than static max " + staticMax + ", can lead to stability issues. Setting static max as much as dynamic max ");
+ return dynamicMaxRam;
+ }
+ return staticMax;
+ }
+
+ @Override
+ public long getStaticMin(String os, boolean b, long dynamicMinRam, long dynamicMaxRam){
+ long recommendedValue = CitrixHelper.getXenServer602StaticMin(os, b);
+ if(recommendedValue == 0){
+ s_logger.warn("No recommended value found for dynamic min");
+ return dynamicMinRam;
+ }
+ if(dynamicMinRam < recommendedValue){ // XS contraint that dynamic min > static min
+ s_logger.warn("Vm is set to dynamixMin " + dynamicMinRam + " less than the recommended static min " + recommendedValue + ", could lead to stability issues");
+ }
+ return dynamicMinRam;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f90279d9/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer610Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer610Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer610Resource.java
index 9589661..20d9a3d 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer610Resource.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer610Resource.java
@@ -417,4 +417,34 @@ public class XenServer610Resource extends XenServer56FP1Resource {
return new MigrateVolumeAnswer(cmd, false, msg, null);
}
}
+
+ @Override
+ public long getStaticMax(String os, boolean b, long dynamicMinRam, long dynamicMaxRam){
+ long recommendedValue = CitrixHelper.getXenServer610StaticMax(os, b);
+ if(recommendedValue == 0){
+ s_logger.warn("No recommended value found for dynamic max, setting static max and dynamic max equal");
+ return dynamicMaxRam;
+ }
+ long staticMax = Math.min(recommendedValue, 4l * dynamicMinRam); // XS constraint for stability
+ if (dynamicMaxRam > staticMax){ // XS contraint that dynamic max <= static max
+ s_logger.warn("dynamixMax " + dynamicMaxRam + " cant be greater than static max " + staticMax + ", can lead to stability issues. Setting static max as much as dynamic max ");
+ return dynamicMaxRam;
+ }
+ return staticMax;
+ }
+
+ @Override
+ public long getStaticMin(String os, boolean b, long dynamicMinRam, long dynamicMaxRam){
+ long recommendedValue = CitrixHelper.getXenServer610StaticMin(os, b);
+ if(recommendedValue == 0){
+ s_logger.warn("No recommended value found for dynamic min");
+ return dynamicMinRam;
+ }
+
+ if(dynamicMinRam < recommendedValue){ // XS contraint that dynamic min > static min
+ s_logger.warn("Vm is set to dynamixMin " + dynamicMinRam + " less than the recommended static min " + recommendedValue + ", could lead to stability issues");
+ }
+ return dynamicMinRam;
+ }
+
}
[43/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-3236, CLOUDSTACK-892
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/7d8a9e95
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/7d8a9e95
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/7d8a9e95
Branch: refs/heads/vmsync
Commit: 7d8a9e95d4cebf2cfb115d369c7471327a5684ed
Parents: f96442a
Author: Radhika PC <ra...@citrix.com>
Authored: Thu Jun 27 16:57:14 2013 +0530
Committer: Radhika PC <ra...@citrix.com>
Committed: Thu Jun 27 16:57:57 2013 +0530
----------------------------------------------------------------------
docs/en-US/acquire-new-ip-address.xml | 38 +++++++---
docs/en-US/portable-ip | 109 +++++++++++++++++++++++++++++
docs/en-US/portable-ip.xml | 94 ++++++++++++++++++++++---
3 files changed, 222 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7d8a9e95/docs/en-US/acquire-new-ip-address.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/acquire-new-ip-address.xml b/docs/en-US/acquire-new-ip-address.xml
index 8af130c..3dbd79e 100644
--- a/docs/en-US/acquire-new-ip-address.xml
+++ b/docs/en-US/acquire-new-ip-address.xml
@@ -21,16 +21,32 @@
specific language governing permissions and limitations
under the License.
-->
-
<section id="acquire-new-ip-address">
- <title>Acquiring a New IP Address</title>
- <orderedlist>
- <listitem><para>Log in to the &PRODUCT; UI as an administrator or end user. </para></listitem>
- <listitem><para>In the left navigation, choose Network.</para></listitem>
- <listitem><para>Click the name of the network where you want to work with.</para></listitem>
- <listitem><para>Click View IP Addresses.</para></listitem>
- <listitem><para>Click Acquire New IP, and click Yes in the confirmation dialog.</para>
- <para>You are prompted for confirmation because, typically, IP addresses are a limited resource. Within a few moments, the new IP address should appear with the state Allocated. You can now use the IP address in port forwarding or static NAT rules.</para>
- </listitem>
- </orderedlist>
+ <title>Acquiring a New IP Address</title>
+ <orderedlist>
+ <listitem>
+ <para>Log in to the &PRODUCT; UI as an administrator or end user. </para>
+ </listitem>
+ <listitem>
+ <para>In the left navigation, choose Network.</para>
+ </listitem>
+ <listitem>
+ <para>Click the name of the network where you want to work with.</para>
+ </listitem>
+ <listitem>
+ <para>Click View IP Addresses.</para>
+ </listitem>
+ <listitem>
+ <para>Click Acquire New IP.</para>
+ <para>The Acquire New IP window is displayed.</para>
+ </listitem>
+ <listitem>
+ <para>Specify whether you want cross-zone IP or not.</para>
+ <para>If you want Portable IP click Yes in the confirmation dialog. If you want a normal
+ Public IP click No.</para>
+ <para>For more information on Portable IP, see <xref linkend="portable-ip"/>.</para>
+ <para>Within a few moments, the new IP address should appear with the state Allocated. You can
+ now use the IP address in port forwarding or static NAT rules.</para>
+ </listitem>
+ </orderedlist>
</section>
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7d8a9e95/docs/en-US/portable-ip
----------------------------------------------------------------------
diff --git a/docs/en-US/portable-ip b/docs/en-US/portable-ip
new file mode 100644
index 0000000..6dfb526
--- /dev/null
+++ b/docs/en-US/portable-ip
@@ -0,0 +1,109 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
+%BOOK_ENTITIES;
+]>
+<!-- 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.
+-->
+<section id="portable-ip">
+ <title>Portable IPs</title>
+ <section id="about-pip">
+ <title>About Portable IP</title>
+ <para>Portable IPs in &PRODUCT; are nothing but elastic IPs that can be transferred across
+ geographically separated zones. As an administrator, you can provision a pool of portable IPs
+ at region level and are available for user consumption. The users can acquire portable IPs if
+ admin has provisioned portable public IPs at the region level they are part of. These IPs can
+ be use for any service within an advanced zone. You can also use portable IPs for EIP service
+ in basic zones. Additionally, a portable IP can be transferred from one network to another
+ network.</para>
+ </section>
+ <section id="config-pip">
+ <title>Configuring Portable IPs</title>
+ <orderedlist>
+ <listitem>
+ <para>Log in to the &PRODUCT; UI as an administrator or end user.</para>
+ </listitem>
+ <listitem>
+ <para>In the left navigation, click Regions.</para>
+ </listitem>
+ <listitem>
+ <para>Choose the Regions that you want to work with.</para>
+ </listitem>
+ <listitem>
+ <para>Click View Portable IP.</para>
+ </listitem>
+ <listitem>
+ <para>Click Portable IP Range.</para>
+ <para>The Add Portable IP Range window is displayed.</para>
+ </listitem>
+ <listitem>
+ <para>Specify the following:</para>
+ <itemizedlist>
+ <listitem>
+ <para><emphasis role="bold">Start IP/ End IP</emphasis>: A range of IP addresses that
+ are accessible from the Internet and will be allocated to guest VMs. Enter the first
+ and last IP addresses that define a range that &PRODUCT; can assign to guest
+ VMs.</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">Gateway</emphasis>: The gateway in use for the Portable IP
+ addresses you are configuring.</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">Netmask</emphasis>: The netmask associated with the Portable
+ IP range.</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">VLAN</emphasis>: The VLAN that will be used for public
+ traffic.</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <para>Click OK.</para>
+ </listitem>
+ </orderedlist>
+ </section>
+ <section id="acquire-pip">
+ <title>Acquiring a Portable IP</title>
+ <orderedlist>
+ <listitem>
+ <para>Log in to the &PRODUCT; UI as an administrator or end user. </para>
+ </listitem>
+ <listitem>
+ <para>In the left navigation, choose Network.</para>
+ </listitem>
+ <listitem>
+ <para>Click the name of the network where you want to work with.</para>
+ </listitem>
+ <listitem>
+ <para>Click View IP Addresses.</para>
+ </listitem>
+ <listitem>
+ <para>Click Acquire New IP.</para>
+ <para>The Acquire New IP window is displayed.</para>
+ </listitem>
+ <listitem>
+ <para>Specify whether you want cross-zone IP or not.</para>
+ </listitem>
+ <listitem>
+ <para>Click Yes in the confirmation dialog.</para>
+ <para>Within a few moments, the new IP address should appear with the state Allocated. You
+ can now use the IP address in port forwarding or static NAT rules.</para>
+ </listitem>
+ </orderedlist>
+ </section>
+</section>
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7d8a9e95/docs/en-US/portable-ip.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/portable-ip.xml b/docs/en-US/portable-ip.xml
index ec1035e..81590df 100644
--- a/docs/en-US/portable-ip.xml
+++ b/docs/en-US/portable-ip.xml
@@ -19,12 +19,90 @@
under the License.
-->
<section id="portable-ip">
- <title>About Portable IP</title>
- <para>Portable IPs in &PRODUCT; are nothing but elastic IPs that can be transferred across
- geographically separated zones. As an administrator, you can provision a pool of portable IPs at
- region level and are available for user consumption. The users can acquire portable IPs if admin
- has provisioned portable public IPs at the region level they are part of. These IPs can be use
- for any service within an advanced zone. You can also use portable IPs for EIP service in basic
- zones. Additionally, a portable IP can be transferred from one network to another
- network.</para>
+ <title>Portable IPs</title>
+ <section id="about-pip">
+ <title>About Portable IP</title>
+ <para>Portable IPs in &PRODUCT; are nothing but elastic IPs that can be transferred across
+ geographically separated zones. As an administrator, you can provision a pool of portable IPs
+ at region level and are available for user consumption. The users can acquire portable IPs if
+ admin has provisioned portable public IPs at the region level they are part of. These IPs can
+ be use for any service within an advanced zone. You can also use portable IPs for EIP service
+ in basic zones. Additionally, a portable IP can be transferred from one network to another
+ network.</para>
+ </section>
+ <section id="config-pip">
+ <title>Configuring Portable IPs</title>
+ <para/>
+ <orderedlist>
+ <listitem>
+ <para>Log in to the &PRODUCT; UI as an administrator or end user.</para>
+ </listitem>
+ <listitem>
+ <para>In the left navigation, click Regions.</para>
+ </listitem>
+ <listitem>
+ <para>Choose the Regions that you want to work with.</para>
+ </listitem>
+ <listitem>
+ <para>Click View Portable IP.</para>
+ </listitem>
+ <listitem>
+ <para>Click Portable IP Range.</para>
+ <para>The Add Portable IP Range window is displayed.</para>
+ </listitem>
+ <listitem>
+ <para>Specify the following:</para>
+ <itemizedlist>
+ <listitem>
+ <para><emphasis role="bold">Start IP/ End IP</emphasis>: A range of IP addresses that
+ are accessible from the Internet and will be allocated to guest VMs. Enter the first
+ and last IP addresses that define a range that &PRODUCT; can assign to guest
+ VMs.</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">Gateway</emphasis>: The gateway in use for the Portable IP
+ addresses you are configuring.</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">Netmask</emphasis>: The netmask associated with the Portable
+ IP range.</para>
+ </listitem>
+ <listitem>
+ <para><emphasis role="bold">VLAN</emphasis>: The VLAN that will be used for public
+ traffic.</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem><para>Click OK.</para></listitem>
+ </orderedlist>
+ </section>
+ <section id="acquire-pip">
+ <title>Acquiring a Portable IP</title>
+ <orderedlist>
+ <listitem>
+ <para>Log in to the &PRODUCT; UI as an administrator or end user. </para>
+ </listitem>
+ <listitem>
+ <para>In the left navigation, choose Network.</para>
+ </listitem>
+ <listitem>
+ <para>Click the name of the network where you want to work with.</para>
+ </listitem>
+ <listitem>
+ <para>Click View IP Addresses.</para>
+ </listitem>
+ <listitem>
+ <para>Click Acquire New IP.</para>
+ <para>The Acquire New IP window is displayed.</para>
+ </listitem>
+ <listitem>
+ <para>Specify whether you want cross-zone IP or not.</para>
+ </listitem>
+ <listitem>
+ <para>Click Yes in the confirmation dialog.</para>
+ <para>Within a few moments, the new IP address should appear with the state Allocated. You
+ can now use the IP address in port forwarding or static NAT rules.</para>
+ </listitem>
+ </orderedlist>
+ </section>
</section>
[11/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-3171: UI > VPC > add private gateway dialog - fix ACL dropdown to only show ACL that belong to the VPC.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/fc93b687
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/fc93b687
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/fc93b687
Branch: refs/heads/vmsync
Commit: fc93b68738919b6784521f5346dbc4b1c3d4c86d
Parents: 1eacd78
Author: Jessica Wang <je...@apache.org>
Authored: Tue Jun 25 15:43:25 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Tue Jun 25 15:46:03 2013 -0700
----------------------------------------------------------------------
ui/scripts/vpc.js | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fc93b687/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index ed07a2c..ca02c77 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -1689,8 +1689,9 @@
select:function(args){
$.ajax({
url: createURL('listNetworkACLLists'),
- dataType: 'json',
- async: true,
+ data: {
+ vpcid: args.context.vpc[0].id
+ },
success: function(json) {
var objs = json.listnetworkacllistsresponse.networkacllist;
var items = [];
[08/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
Disable the NioTest, it is far to dependent on the network configuration of the machine running the test.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/881a6e16
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/881a6e16
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/881a6e16
Branch: refs/heads/vmsync
Commit: 881a6e164ece8e34154555b71e97c9f1763674f5
Parents: 6a711fc
Author: Hugo Trippaers <ht...@schubergphilis.com>
Authored: Wed Jun 19 17:08:25 2013 -0700
Committer: Hugo Trippaers <ht...@schubergphilis.com>
Committed: Tue Jun 25 12:20:51 2013 -0700
----------------------------------------------------------------------
utils/pom.xml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/881a6e16/utils/pom.xml
----------------------------------------------------------------------
diff --git a/utils/pom.xml b/utils/pom.xml
index 0690c35..f4ac12b 100644
--- a/utils/pom.xml
+++ b/utils/pom.xml
@@ -192,6 +192,7 @@
<excludes>
<exclude>com/cloud/utils/testcase/*TestCase*</exclude>
<exclude>com/cloud/utils/db/*Test*</exclude>
+ <exclude>com/cloud/utils/testcase/NioTest.java</exclude>
</excludes>
</configuration>
</plugin>
[38/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
Fix an issue of createVolumeCmd for regular user.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a654e52c
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a654e52c
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a654e52c
Branch: refs/heads/vmsync
Commit: a654e52cb6578c15a21bed127d63f2ba352296af
Parents: 53d1ce7
Author: Min Chen <mi...@citrix.com>
Authored: Wed Jun 26 15:38:57 2013 -0700
Committer: Min Chen <mi...@citrix.com>
Committed: Wed Jun 26 15:46:48 2013 -0700
----------------------------------------------------------------------
.../api/command/user/volume/CreateVolumeCmd.java | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a654e52c/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
index 107af11..6f0bf3a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
@@ -55,7 +55,7 @@ public class CreateVolumeCmd extends BaseAsyncCreateCmd {
@Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType=DomainResponse.class,
description="the domain ID associated with the disk offering. If used with the account parameter" +
- " returns the disk volume associated with the account for the specified domain.")
+ " returns the disk volume associated with the account for the specified domain.")
private Long domainId;
@Parameter(name=ApiConstants.DISK_OFFERING_ID,required = false, type=CommandType.UUID, entityType=DiskOfferingResponse.class,
@@ -79,7 +79,7 @@ public class CreateVolumeCmd extends BaseAsyncCreateCmd {
@Parameter(name=ApiConstants.DISPLAY_VOLUME, type=CommandType.BOOLEAN, description="an optional field, whether to display the volume to the end user or not.")
private Boolean displayVolume;
-/////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -117,7 +117,7 @@ public class CreateVolumeCmd extends BaseAsyncCreateCmd {
}
public Boolean getDisplayVolume() {
- return displayVolume != null ? displayVolume : Boolean.TRUE;
+ return displayVolume;
}
/////////////////////////////////////////////////////
@@ -132,6 +132,7 @@ public class CreateVolumeCmd extends BaseAsyncCreateCmd {
return "volume";
}
+ @Override
public AsyncJob.Type getInstanceType() {
return AsyncJob.Type.Volume;
}
@@ -179,12 +180,12 @@ public class CreateVolumeCmd extends BaseAsyncCreateCmd {
Snapshot snap = _entityMgr.findById(Snapshot.class, getSnapshotId());
if (snap != null) {
response.setSnapshotId(snap.getUuid()); // if the volume was
- // created from a
- // snapshot,
- // snapshotId will
- // be set so we pass
- // it back in the
- // response
+ // created from a
+ // snapshot,
+ // snapshotId will
+ // be set so we pass
+ // it back in the
+ // response
}
}
response.setResponseName(getCommandName());
[26/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-3208: showing xenhost username and password details in plain text in logs when we pefrom removehost from CS
Signed-off-by: Abhinandan Prateek <ap...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/0d1f5127
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/0d1f5127
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/0d1f5127
Branch: refs/heads/vmsync
Commit: 0d1f512728f909aec296bf0e1cfbcdcaf2f563f6
Parents: ec2bf09
Author: Harikrishna Patnala <ha...@citrix.com>
Authored: Wed Jun 26 15:25:40 2013 +0530
Committer: Abhinandan Prateek <ap...@apache.org>
Committed: Wed Jun 26 15:57:31 2013 +0530
----------------------------------------------------------------------
.../com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0d1f5127/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java
index e4dd675..5af1781 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java
@@ -550,7 +550,7 @@ public class XenServerConnectionPool {
}
} catch (UuidInvalid e) {
String msg = "Host(" + hostUuid + ") doesn't belong to pool(" + poolUuid + "), please execute 'xe pool-join master-address=" + mConn.getIp()
- + " master-username=" + mConn.getUsername() + " master-password=" + mConn.getPassword();
+ + " master-username=" + mConn.getUsername();
if (s_logger.isDebugEnabled()) {
s_logger.debug(msg);
}
[36/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-728 For Nicira NVP a specified port-group must be used,
instead of a dynamically configured one.
Refactor bits of the HypervisorHostHelper to better
support multiple BroadcastDomainTypes
Cleanup some parts of the code that was using tab indents and removed some dead code.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/98dc68d8
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/98dc68d8
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/98dc68d8
Branch: refs/heads/vmsync
Commit: 98dc68d8c9f6d4ea788652582cf9df611d18ffa3
Parents: 079f920
Author: Hugo Trippaers <ht...@schubergphilis.com>
Authored: Sat Jun 22 15:06:25 2013 -0700
Committer: Hugo Trippaers <ht...@schubergphilis.com>
Committed: Wed Jun 26 15:41:52 2013 -0700
----------------------------------------------------------------------
.../vmware/manager/VmwareManagerImpl.java | 4 +-
.../vmware/resource/VmwareResource.java | 82 +-
vmware-base/pom.xml | 5 +
.../vmware/mo/HypervisorHostHelper.java | 1088 ++++++++++--------
4 files changed, 599 insertions(+), 580 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/98dc68d8/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
index 06451d8..fd99561 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
@@ -92,6 +92,7 @@ import com.cloud.hypervisor.vmware.util.VmwareContext;
import com.cloud.hypervisor.vmware.util.VmwareHelper;
import com.cloud.network.CiscoNexusVSMDeviceVO;
import com.cloud.network.NetworkModel;
+import com.cloud.network.Networks.BroadcastDomainType;
import com.cloud.network.dao.CiscoNexusVSMDeviceDao;
import com.cloud.org.Cluster.ClusterType;
import com.cloud.secstorage.CommandExecLogDao;
@@ -346,7 +347,8 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw
}
}
s_logger.info("Preparing network on host " + hostMo.getContext().toString() + " for " + privateTrafficLabel);
- HypervisorHostHelper.prepareNetwork(vSwitchName, "cloud.private", hostMo, vlanId, null, null, 180000, false);
+ //The management network is probably always going to be a physical network with vlans, so assume BroadcastDomainType VLAN
+ HypervisorHostHelper.prepareNetwork(vSwitchName, "cloud.private", hostMo, vlanId, null, null, 180000, false, BroadcastDomainType.Vlan);
}
@Override
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/98dc68d8/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index d860383..80e87e9 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -229,6 +229,7 @@ import com.cloud.network.HAProxyConfigurator;
import com.cloud.network.LoadBalancerConfigurator;
import com.cloud.network.Networks;
import com.cloud.network.Networks.BroadcastDomainType;
+import com.cloud.network.Networks.IsolationType;
import com.cloud.network.Networks.TrafficType;
import com.cloud.network.VmwareTrafficLabel;
import com.cloud.network.rules.FirewallRule;
@@ -1787,12 +1788,15 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
if (_publicTrafficInfo != null) {
vSwitchType = _publicTrafficInfo.getVirtualSwitchType();
}
+ /** FIXME We have no clue which network this nic is on and that means that we can't figure out the BroadcastDomainType
+ * so we assume that it's VLAN for now
+ */
if (VirtualSwitchType.StandardVirtualSwitch == vSwitchType) {
networkInfo = HypervisorHostHelper.prepareNetwork(_publicTrafficInfo.getVirtualSwitchName(), "cloud.public",
- vmMo.getRunningHost(), vlanId, null, null, _ops_timeout, true);
+ vmMo.getRunningHost(), vlanId, null, null, _ops_timeout, true, BroadcastDomainType.Vlan);
} else {
- networkInfo = HypervisorHostHelper.prepareNetwork(this._publicTrafficInfo.getVirtualSwitchName(), "cloud.public",
- vmMo.getRunningHost(), vlanId, null, null, null, this._ops_timeout, vSwitchType, _portsPerDvPortGroup, null, false);
+ networkInfo = HypervisorHostHelper.prepareNetwork(_publicTrafficInfo.getVirtualSwitchName(), "cloud.public",
+ vmMo.getRunningHost(), vlanId, null, null, null, _ops_timeout, vSwitchType, _portsPerDvPortGroup, null, false, BroadcastDomainType.Vlan);
}
int nicIndex = allocPublicNicIndex(vmMo);
@@ -2953,7 +2957,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
if (VirtualSwitchType.StandardVirtualSwitch == switchType) {
networkInfo = HypervisorHostHelper.prepareNetwork(switchName.first(), namePrefix,
hostMo, getVlanInfo(nicTo, switchName.second()), nicTo.getNetworkRateMbps(), nicTo.getNetworkRateMulticastMbps(), _ops_timeout,
- !namePrefix.startsWith("cloud.private"));
+ !namePrefix.startsWith("cloud.private"), nicTo.getBroadcastType());
}
else {
String vlanId = getVlanInfo(nicTo, switchName.second());
@@ -2967,7 +2971,8 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
svlanId = getPvlanInfo(nicTo);
}
networkInfo = HypervisorHostHelper.prepareNetwork(switchName.first(), namePrefix, hostMo, vlanId, svlanId,
- nicTo.getNetworkRateMbps(), nicTo.getNetworkRateMulticastMbps(), _ops_timeout, switchType, _portsPerDvPortGroup, nicTo.getGateway(), configureVServiceInNexus);
+ nicTo.getNetworkRateMbps(), nicTo.getNetworkRateMulticastMbps(), _ops_timeout, switchType,
+ _portsPerDvPortGroup, nicTo.getGateway(), configureVServiceInNexus, nicTo.getBroadcastType());
}
return networkInfo;
@@ -5329,73 +5334,6 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
return VirtualMachineGuestOsIdentifier.OTHER_GUEST;
}
- private void prepareNetworkForVmTargetHost(HostMO hostMo, VirtualMachineMO vmMo) throws Exception {
- assert (vmMo != null);
- assert (hostMo != null);
-
- String[] networks = vmMo.getNetworks();
- for (String networkName : networks) {
- HostPortGroupSpec portGroupSpec = hostMo.getHostPortGroupSpec(networkName);
- HostNetworkTrafficShapingPolicy shapingPolicy = null;
- if (portGroupSpec != null) {
- shapingPolicy = portGroupSpec.getPolicy().getShapingPolicy();
- }
-
- if (networkName.startsWith("cloud.private")) {
- String[] tokens = networkName.split("\\.");
- if (tokens.length == 3) {
- Integer networkRateMbps = null;
- if (shapingPolicy != null && shapingPolicy.isEnabled() != null && shapingPolicy.isEnabled().booleanValue()) {
- networkRateMbps = (int) (shapingPolicy.getPeakBandwidth().longValue() / (1024 * 1024));
- }
- String vlanId = null;
- if(!"untagged".equalsIgnoreCase(tokens[2]))
- vlanId = tokens[2];
-
- HypervisorHostHelper.prepareNetwork(_privateNetworkVSwitchName, "cloud.private",
- hostMo, vlanId, networkRateMbps, null, _ops_timeout, false);
- } else {
- s_logger.info("Skip suspecious cloud network " + networkName);
- }
- } else if (networkName.startsWith("cloud.public")) {
- String[] tokens = networkName.split("\\.");
- if (tokens.length == 3) {
- Integer networkRateMbps = null;
- if (shapingPolicy != null && shapingPolicy.isEnabled() != null && shapingPolicy.isEnabled().booleanValue()) {
- networkRateMbps = (int) (shapingPolicy.getPeakBandwidth().longValue() / (1024 * 1024));
- }
- String vlanId = null;
- if(!"untagged".equalsIgnoreCase(tokens[2]))
- vlanId = tokens[2];
-
- HypervisorHostHelper.prepareNetwork(_publicTrafficInfo.getVirtualSwitchName(), "cloud.public",
- hostMo, vlanId, networkRateMbps, null, _ops_timeout, false);
- } else {
- s_logger.info("Skip suspecious cloud network " + networkName);
- }
- } else if (networkName.startsWith("cloud.guest")) {
- String[] tokens = networkName.split("\\.");
- if (tokens.length >= 3) {
- Integer networkRateMbps = null;
- if (shapingPolicy != null && shapingPolicy.isEnabled() != null && shapingPolicy.isEnabled().booleanValue()) {
- networkRateMbps = (int) (shapingPolicy.getPeakBandwidth().longValue() / (1024 * 1024));
- }
-
- String vlanId = null;
- if(!"untagged".equalsIgnoreCase(tokens[2]))
- vlanId = tokens[2];
-
- HypervisorHostHelper.prepareNetwork(_guestTrafficInfo.getVirtualSwitchName(), "cloud.guest",
- hostMo, vlanId, networkRateMbps, null, _ops_timeout, false);
- } else {
- s_logger.info("Skip suspecious cloud network " + networkName);
- }
- } else {
- s_logger.info("Skip non-cloud network " + networkName + " when preparing target host");
- }
- }
- }
-
private HashMap<String, State> getVmStates() throws Exception {
VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext());
ObjectContent[] ocs = hyperHost.getVmPropertiesOnHyperHost(new String[] { "name", "runtime.powerState", "config.template" });
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/98dc68d8/vmware-base/pom.xml
----------------------------------------------------------------------
diff --git a/vmware-base/pom.xml b/vmware-base/pom.xml
index da4fb21..c5d555e 100644
--- a/vmware-base/pom.xml
+++ b/vmware-base/pom.xml
@@ -33,6 +33,11 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.apache.cloudstack</groupId>
+ <artifactId>cloud-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${cs.gson.version}</version>
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/98dc68d8/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
index 994fb30..9df7bc3 100755
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
@@ -19,7 +19,9 @@ package com.cloud.hypervisor.vmware.mo;
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
+import java.security.InvalidParameterException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import java.util.Map;
@@ -27,6 +29,7 @@ import org.apache.log4j.Logger;
import com.cloud.hypervisor.vmware.util.VmwareContext;
import com.cloud.hypervisor.vmware.util.VmwareHelper;
+import com.cloud.network.Networks.BroadcastDomainType;
import com.cloud.utils.ActionDelegate;
import com.cloud.utils.Pair;
import com.cloud.utils.cisco.n1kv.vsm.NetconfHelper;
@@ -60,7 +63,6 @@ import com.vmware.vim25.ObjectContent;
import com.vmware.vim25.OvfCreateImportSpecParams;
import com.vmware.vim25.OvfCreateImportSpecResult;
import com.vmware.vim25.OvfFileItem;
-import com.vmware.vim25.TaskInfo;
import com.vmware.vim25.VMwareDVSConfigSpec;
import com.vmware.vim25.VMwareDVSPortSetting;
import com.vmware.vim25.VMwareDVSPvlanConfigSpec;
@@ -70,7 +72,6 @@ import com.vmware.vim25.VirtualDeviceConfigSpecOperation;
import com.vmware.vim25.VirtualLsiLogicController;
import com.vmware.vim25.VirtualMachineConfigSpec;
import com.vmware.vim25.VirtualMachineFileInfo;
-import com.vmware.vim25.VirtualMachineRelocateSpec;
import com.vmware.vim25.VirtualMachineVideoCard;
import com.vmware.vim25.VirtualSCSISharing;
import com.vmware.vim25.VmwareDistributedVirtualSwitchPvlanSpec;
@@ -85,73 +86,73 @@ public class HypervisorHostHelper {
// make vmware-base loosely coupled with cloud-specific stuff, duplicate VLAN.UNTAGGED constant here
private static final String UNTAGGED_VLAN_NAME = "untagged";
- public static VirtualMachineMO findVmFromObjectContent(VmwareContext context,
- ObjectContent[] ocs, String name) {
-
- if(ocs != null && ocs.length > 0) {
- for(ObjectContent oc : ocs) {
- DynamicProperty prop = oc.getPropSet().get(0);
- assert(prop != null);
- if(prop.getVal().toString().equals(name))
- return new VirtualMachineMO(context, oc.getObj());
- }
- }
- return null;
- }
-
- public static ManagedObjectReference findDatastoreWithBackwardsCompatibility(VmwareHypervisorHost hyperHost, String uuidName) throws Exception {
- ManagedObjectReference morDs = hyperHost.findDatastore(uuidName.replace("-", ""));
- if(morDs == null)
- morDs = hyperHost.findDatastore(uuidName);
-
- return morDs;
- }
-
- public static DatastoreMO getHyperHostDatastoreMO(VmwareHypervisorHost hyperHost, String datastoreName) throws Exception {
- ObjectContent[] ocs = hyperHost.getDatastorePropertiesOnHyperHost(new String[] { "name"} );
- if(ocs != null && ocs.length > 0) {
- for(ObjectContent oc : ocs) {
- List<DynamicProperty> objProps = oc.getPropSet();
- if(objProps != null) {
- for(DynamicProperty objProp : objProps) {
- if(objProp.getVal().toString().equals(datastoreName))
- return new DatastoreMO(hyperHost.getContext(), oc.getObj());
- }
- }
- }
- }
- return null;
- }
-
- public static String getPublicNetworkNamePrefix(String vlanId) {
- if (UNTAGGED_VLAN_NAME.equalsIgnoreCase(vlanId)) {
- return "cloud.public.untagged";
- } else {
- return "cloud.public." + vlanId;
- }
- }
+ public static VirtualMachineMO findVmFromObjectContent(VmwareContext context,
+ ObjectContent[] ocs, String name) {
+
+ if(ocs != null && ocs.length > 0) {
+ for(ObjectContent oc : ocs) {
+ DynamicProperty prop = oc.getPropSet().get(0);
+ assert(prop != null);
+ if(prop.getVal().toString().equals(name))
+ return new VirtualMachineMO(context, oc.getObj());
+ }
+ }
+ return null;
+ }
+
+ public static ManagedObjectReference findDatastoreWithBackwardsCompatibility(VmwareHypervisorHost hyperHost, String uuidName) throws Exception {
+ ManagedObjectReference morDs = hyperHost.findDatastore(uuidName.replace("-", ""));
+ if(morDs == null)
+ morDs = hyperHost.findDatastore(uuidName);
+
+ return morDs;
+ }
+
+ public static DatastoreMO getHyperHostDatastoreMO(VmwareHypervisorHost hyperHost, String datastoreName) throws Exception {
+ ObjectContent[] ocs = hyperHost.getDatastorePropertiesOnHyperHost(new String[] { "name"} );
+ if(ocs != null && ocs.length > 0) {
+ for(ObjectContent oc : ocs) {
+ List<DynamicProperty> objProps = oc.getPropSet();
+ if(objProps != null) {
+ for(DynamicProperty objProp : objProps) {
+ if(objProp.getVal().toString().equals(datastoreName))
+ return new DatastoreMO(hyperHost.getContext(), oc.getObj());
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ public static String getPublicNetworkNamePrefix(String vlanId) {
+ if (UNTAGGED_VLAN_NAME.equalsIgnoreCase(vlanId)) {
+ return "cloud.public.untagged";
+ } else {
+ return "cloud.public." + vlanId;
+ }
+ }
public static String composeCloudNetworkName(String prefix, String vlanId, String svlanId, Integer networkRateMbps, String vSwitchName) {
- StringBuffer sb = new StringBuffer(prefix);
+ StringBuffer sb = new StringBuffer(prefix);
if(vlanId == null || UNTAGGED_VLAN_NAME.equalsIgnoreCase(vlanId)) {
- sb.append(".untagged");
+ sb.append(".untagged");
} else {
- sb.append(".").append(vlanId);
+ sb.append(".").append(vlanId);
if (svlanId != null) {
sb.append(".").append("s" + svlanId);
}
}
- if(networkRateMbps != null && networkRateMbps.intValue() > 0)
- sb.append(".").append(String.valueOf(networkRateMbps));
- else
- sb.append(".0");
- sb.append(".").append(VersioningContants.PORTGROUP_NAMING_VERSION);
- sb.append("-").append(vSwitchName);
+ if(networkRateMbps != null && networkRateMbps.intValue() > 0)
+ sb.append(".").append(String.valueOf(networkRateMbps));
+ else
+ sb.append(".0");
+ sb.append(".").append(VersioningContants.PORTGROUP_NAMING_VERSION);
+ sb.append("-").append(vSwitchName);
- return sb.toString();
- }
+ return sb.toString();
+ }
public static Map<String, String> getValidatedVsmCredentials(VmwareContext context) throws Exception {
Map<String, String> vsmCredentials = context.getStockObject("vsmcredentials");
@@ -234,8 +235,8 @@ public class HypervisorHostHelper {
+ ". Exception: " + e.toString();
s_logger.error(msg);
if(netconfClient != null) {
- netconfClient.disconnect();
- s_logger.debug("Disconnected Nexus 1000v session.");
+ netconfClient.disconnect();
+ s_logger.debug("Disconnected Nexus 1000v session.");
}
throw new CloudRuntimeException(msg);
}
@@ -409,23 +410,23 @@ public class HypervisorHostHelper {
}
}
- /**
- * @param ethPortProfileName
- * @param namePrefix
- * @param hostMo
- * @param vlanId
- * @param networkRateMbps
- * @param networkRateMulticastMbps
- * @param timeOutMs
+ /**
+ * @param ethPortProfileName
+ * @param namePrefix
+ * @param hostMo
+ * @param vlanId
+ * @param networkRateMbps
+ * @param networkRateMulticastMbps
+ * @param timeOutMs
* @param vSwitchType
* @param numPorts
- * @return
- * @throws Exception
- */
+ * @return
+ * @throws Exception
+ */
public static Pair<ManagedObjectReference, String> prepareNetwork(String physicalNetwork, String namePrefix,
HostMO hostMo, String vlanId, String secondaryvlanId, Integer networkRateMbps, Integer networkRateMulticastMbps, long timeOutMs,
- VirtualSwitchType vSwitchType, int numPorts, String gateway, boolean configureVServiceInNexus) throws Exception {
+ VirtualSwitchType vSwitchType, int numPorts, String gateway, boolean configureVServiceInNexus, BroadcastDomainType broadcastDomainType) throws Exception {
ManagedObjectReference morNetwork = null;
VmwareContext context = hostMo.getContext();
ManagedObjectReference dcMor = hostMo.getHyperHostDatacenter();
@@ -434,7 +435,6 @@ public class HypervisorHostHelper {
ManagedObjectReference morEthernetPortProfile = null;
String ethPortProfileName = null;
ManagedObjectReference morDvSwitch = null;
- ManagedObjectReference morDvPortGroup = null;
String dvSwitchName = null;
boolean bWaitPortGroupReady = false;
boolean createGCTag = false;
@@ -445,26 +445,47 @@ public class HypervisorHostHelper {
Integer vid = null;
Integer spvlanid = null; // secondary pvlan id
- if(vlanId != null && !UNTAGGED_VLAN_NAME.equalsIgnoreCase(vlanId)) {
- createGCTag = true;
- vid = Integer.parseInt(vlanId);
+ /** This is the list of BroadcastDomainTypes we can actually
+ * prepare networks for in this function.
+ */
+ BroadcastDomainType[] supportedBroadcastTypes =
+ new BroadcastDomainType[] { BroadcastDomainType.Lswitch,
+ BroadcastDomainType.LinkLocal,
+ BroadcastDomainType.Native,
+ BroadcastDomainType.Pvlan,
+ BroadcastDomainType.Storage,
+ BroadcastDomainType.UnDecided,
+ BroadcastDomainType.Vlan };
+
+ if (!Arrays.asList(supportedBroadcastTypes).contains(broadcastDomainType)) {
+ throw new InvalidParameterException("BroadcastDomainType " + broadcastDomainType +
+ " it not supported on a VMWare hypervisor at this time.");
}
- if (secondaryvlanId != null) {
- spvlanid = Integer.parseInt(secondaryvlanId);
+
+ if (broadcastDomainType == BroadcastDomainType.Lswitch) {
+ if (vSwitchType == VirtualSwitchType.NexusDistributedVirtualSwitch) {
+ throw new InvalidParameterException("Nexus Distributed Virtualswitch is not supported with BroadcastDomainType " +
+ broadcastDomainType);
+ }
+ // Fixed name for the port-group on the vApp vswitch
+ networkName = "br-int";
+ // No doubt about this, depending on vid=null to avoid lots of code below
+ vid = null;
+ } else {
+ networkName = composeCloudNetworkName(namePrefix, vlanId, secondaryvlanId, networkRateMbps, physicalNetwork);
+
+ if(vlanId != null && !UNTAGGED_VLAN_NAME.equalsIgnoreCase(vlanId)) {
+ createGCTag = true;
+ vid = Integer.parseInt(vlanId);
+ }
+ if (secondaryvlanId != null) {
+ spvlanid = Integer.parseInt(secondaryvlanId);
+ }
}
- networkName = composeCloudNetworkName(namePrefix, vlanId, secondaryvlanId, networkRateMbps, physicalNetwork);
if (vSwitchType == VirtualSwitchType.VMwareDistributedVirtualSwitch) {
- VMwareDVSConfigSpec dvsSpec = null;
DVSTrafficShapingPolicy shapingPolicy;
- VmwareDistributedVirtualSwitchVlanSpec vlanSpec = null;
- VmwareDistributedVirtualSwitchPvlanSpec pvlanSpec = null;
- //VMwareDVSPvlanConfigSpec pvlanSpec = null;
DVSSecurityPolicy secPolicy;
- VMwareDVSPortSetting dvsPortSetting = null;
- DVPortgroupConfigSpec dvPortGroupSpec;
- DVPortgroupConfigInfo dvPortgroupInfo;
- //DVSConfigInfo dvsInfo;
vcApiVersion = getVcenterApiVersion(context);
minVcApiVersionSupportingAutoExpand = "5.0";
autoExpandSupported = isFeatureSupportedInVcenterApiVersion(vcApiVersion, minVcApiVersionSupportingAutoExpand);
@@ -485,120 +506,31 @@ public class HypervisorHostHelper {
s_logger.info("Found distributed vSwitch " + morDvSwitch);
}
- dvSwitchMo = new DistributedVirtualSwitchMO(context, morDvSwitch);
-
- shapingPolicy = getDVSShapingPolicy(networkRateMbps);
- secPolicy = createDVSSecurityPolicy();
-
- // First, if both vlan id and pvlan id are provided, we need to
- // reconfigure the DVSwitch to have a tuple <vlan id, pvlan id> of
- // type isolated.
- if (vid != null && spvlanid != null) {
- // First check if the vlan/pvlan pair already exists on this dvswitch.
-
- Map<Integer, HypervisorHostHelper.PvlanType> vlanmap = dvSwitchMo.retrieveVlanPvlan(vid, spvlanid, morDvSwitch);
- if (vlanmap.size() != 0) {
- // Then either vid or pvlanid or both are already being used.
- if (vlanmap.containsKey(vid) && vlanmap.get(vid) != HypervisorHostHelper.PvlanType.promiscuous) {
- // This VLAN ID is already setup as a non-promiscuous vlan id on the DVS. Throw an exception.
- String msg = "VLAN ID " + vid + " is already in use as a " + vlanmap.get(vid).toString() + " VLAN on the DVSwitch";
- s_logger.error(msg);
- throw new Exception(msg);
- }
- if ((vid != spvlanid) && vlanmap.containsKey(spvlanid) && vlanmap.get(spvlanid) != HypervisorHostHelper.PvlanType.isolated) {
- // This PVLAN ID is already setup as a non-isolated vlan id on the DVS. Throw an exception.
- String msg = "PVLAN ID " + spvlanid + " is already in use as a " + vlanmap.get(spvlanid).toString() + " VLAN in the DVSwitch";
- s_logger.error(msg);
- throw new Exception(msg);
- }
- }
-
- // First create a DVSconfig spec.
- dvsSpec = new VMwareDVSConfigSpec();
- // Next, add the required primary and secondary vlan config specs to the dvs config spec.
- if (!vlanmap.containsKey(vid)) {
- VMwareDVSPvlanConfigSpec ppvlanConfigSpec = createDVPortPvlanConfigSpec(vid, vid, PvlanType.promiscuous, PvlanOperation.add);
- dvsSpec.getPvlanConfigSpec().add(ppvlanConfigSpec);
+ if (broadcastDomainType == BroadcastDomainType.Lswitch) {
+ if (!dataCenterMo.hasDvPortGroup(networkName)) {
+ // It'a bad thing if the integration bridge port-group does not exist
+ throw new InvalidParameterException("Unable to find port-group " + networkName + " on dvSwitch " + dvSwitchName);
}
- if ( !vid.equals(spvlanid) && !vlanmap.containsKey(spvlanid)) {
- VMwareDVSPvlanConfigSpec spvlanConfigSpec = createDVPortPvlanConfigSpec(vid, spvlanid, PvlanType.isolated, PvlanOperation.add);
- dvsSpec.getPvlanConfigSpec().add(spvlanConfigSpec);
- }
-
- if (dvsSpec.getPvlanConfigSpec().size() > 0) {
- // We have something to configure on the DVS... so send it the command.
- // When reconfiguring a vmware DVSwitch, we need to send in the configVersion in the spec.
- // Let's retrieve this switch's configVersion first.
- String dvsConfigVersion = dvSwitchMo.getDVSConfigVersion(morDvSwitch);
- dvsSpec.setConfigVersion(dvsConfigVersion);
- // Reconfigure the dvs using this spec.
-
- try {
- TaskInfo reconfigTask = dvSwitchMo.updateVMWareDVSwitchGetTask(morDvSwitch, dvsSpec);
- } catch (Exception e) {
- if(e instanceof AlreadyExistsFaultMsg) {
- s_logger.info("Specified vlan id (" + vid + ") private vlan id (" + spvlanid + ") tuple already configured on VMWare DVSwitch");
- // Do nothing, good if the tuple's already configured on the dvswitch.
+ bWaitPortGroupReady = false;
} else {
- // Rethrow the exception
- s_logger.error("Failed to configure vlan/pvlan tuple on VMware DVSwitch: " + vid + "/" + spvlanid + ", failure message: " + e.getMessage());
- e.printStackTrace();
- throw e;
- }
- }
- }
- // Else the vlan/pvlan pair already exists on the DVSwitch, and we needn't configure it again.
- }
-
- // Next, create the port group. For this, we need to create a VLAN spec.
- // NOTE - VmwareDistributedVirtualSwitchPvlanSpec extends VmwareDistributedVirtualSwitchVlanSpec.
- if (vid == null || spvlanid == null) {
- vlanSpec = createDVPortVlanIdSpec(vid);
- dvsPortSetting = createVmwareDVPortSettingSpec(shapingPolicy, secPolicy, vlanSpec);
- } else if (spvlanid != null) {
- // Create a pvlan spec. The pvlan spec is different from the pvlan config spec
- // that we created earlier. The pvlan config spec is used to configure the switch
- // with a <primary vlanId, secondary vlanId> tuple. The pvlan spec is used
- // to configure a port group (i.e., a network) with a secondary vlan id. We don't
- // need to mention more than the secondary vlan id because one secondary vlan id
- // can be associated with only one primary vlan id. Give vCenter the secondary vlan id,
- // and it will find out the associated primary vlan id and do the rest of the
- // port group configuration.
- pvlanSpec = createDVPortPvlanIdSpec(spvlanid);
- dvsPortSetting = createVmwareDVPortSettingSpec(shapingPolicy, secPolicy, pvlanSpec);
- }
+ dvSwitchMo = new DistributedVirtualSwitchMO(context, morDvSwitch);
- dvPortGroupSpec = createDvPortGroupSpec(networkName, dvsPortSetting, numPorts, autoExpandSupported);
+ shapingPolicy = getDVSShapingPolicy(networkRateMbps);
+ secPolicy = createDVSSecurityPolicy();
- if (!dataCenterMo.hasDvPortGroup(networkName)) {
- s_logger.info("Distributed Virtual Port group " + networkName + " not found.");
- // TODO(sateesh): Handle Exceptions
- try {
- dvSwitchMo.createDVPortGroup(dvPortGroupSpec);
- } catch (Exception e) {
- String msg = "Failed to create distributed virtual port group " + networkName + " on dvSwitch " + physicalNetwork;
- throw new Exception(msg);
+ // First, if both vlan id and pvlan id are provided, we need to
+ // reconfigure the DVSwitch to have a tuple <vlan id, pvlan id> of
+ // type isolated.
+ if (vid != null && spvlanid != null) {
+ setupPVlanPair(dvSwitchMo, morDvSwitch, vid, spvlanid);
}
+
+ // Next, create the port group. For this, we need to create a VLAN spec.
+ createPortGroup(physicalNetwork, networkName, vid, spvlanid, dataCenterMo, shapingPolicy, secPolicy, dvSwitchMo, numPorts, autoExpandSupported);
bWaitPortGroupReady = true;
- } else {
- s_logger.info("Found Distributed Virtual Port group " + networkName);
- // TODO(sateesh): Handle Exceptions
- dvPortgroupInfo = dataCenterMo.getDvPortGroupSpec(networkName);
- if (!isSpecMatch(dvPortgroupInfo, vid, shapingPolicy)) {
- s_logger.info("Updating Distributed Virtual Port group " + networkName);
- dvPortGroupSpec.setDefaultPortConfig(dvsPortSetting);
- dvPortGroupSpec.setConfigVersion(dvPortgroupInfo.getConfigVersion());
- morDvPortGroup = dataCenterMo.getDvPortGroupMor(networkName);
- try {
- dvSwitchMo.updateDvPortGroup(morDvPortGroup, dvPortGroupSpec);
- } catch (Exception e) {
- String msg = "Failed to update distributed virtual port group " + networkName + " on dvSwitch " + physicalNetwork;
- throw new Exception(msg);
- }
- bWaitPortGroupReady = true;
- }
}
} else if (vSwitchType == VirtualSwitchType.NexusDistributedVirtualSwitch) {
+
ethPortProfileName = physicalNetwork;
// TODO(sateesh): Remove this after ensuring proper default value for vSwitchName throughout traffic types
// and switch types.
@@ -665,59 +597,168 @@ public class HypervisorHostHelper {
return vCenterApiVersion.compareTo(minVcenterApiVersionForFeature) >= 0 ? true : false;
}
- public static ManagedObjectReference waitForDvPortGroupReady(
- DatacenterMO dataCenterMo, String dvPortGroupName, long timeOutMs) throws Exception {
- ManagedObjectReference morDvPortGroup = null;
-
- // if DvPortGroup is just created, we may fail to retrieve it, we
- // need to retry
- long startTick = System.currentTimeMillis();
- while (System.currentTimeMillis() - startTick <= timeOutMs) {
- morDvPortGroup = dataCenterMo.getDvPortGroupMor(dvPortGroupName);
- if (morDvPortGroup != null) {
- break;
- }
-
- s_logger.info("Waiting for dvPortGroup " + dvPortGroupName + " to be ready");
- Thread.sleep(1000);
- }
- return morDvPortGroup;
- }
+ private static void setupPVlanPair(DistributedVirtualSwitchMO dvSwitchMo, ManagedObjectReference morDvSwitch,
+ Integer vid, Integer spvlanid) throws Exception {
+ Map<Integer, HypervisorHostHelper.PvlanType> vlanmap = dvSwitchMo.retrieveVlanPvlan(vid, spvlanid, morDvSwitch);
+ if (vlanmap.size() != 0) {
+ // Then either vid or pvlanid or both are already being used.
+ if (vlanmap.containsKey(vid) && vlanmap.get(vid) != HypervisorHostHelper.PvlanType.promiscuous) {
+ // This VLAN ID is already setup as a non-promiscuous vlan id on the DVS. Throw an exception.
+ String msg = "VLAN ID " + vid + " is already in use as a " + vlanmap.get(vid).toString() + " VLAN on the DVSwitch";
+ s_logger.error(msg);
+ throw new Exception(msg);
+ }
+ if ((vid != spvlanid) && vlanmap.containsKey(spvlanid) && vlanmap.get(spvlanid) != HypervisorHostHelper.PvlanType.isolated) {
+ // This PVLAN ID is already setup as a non-isolated vlan id on the DVS. Throw an exception.
+ String msg = "PVLAN ID " + spvlanid + " is already in use as a " + vlanmap.get(spvlanid).toString() + " VLAN in the DVSwitch";
+ s_logger.error(msg);
+ throw new Exception(msg);
+ }
+ }
+
+ // First create a DVSconfig spec.
+ VMwareDVSConfigSpec dvsSpec = new VMwareDVSConfigSpec();
+ // Next, add the required primary and secondary vlan config specs to the dvs config spec.
+ if (!vlanmap.containsKey(vid)) {
+ VMwareDVSPvlanConfigSpec ppvlanConfigSpec = createDVPortPvlanConfigSpec(vid, vid, PvlanType.promiscuous, PvlanOperation.add);
+ dvsSpec.getPvlanConfigSpec().add(ppvlanConfigSpec);
+ }
+ if ( !vid.equals(spvlanid) && !vlanmap.containsKey(spvlanid)) {
+ VMwareDVSPvlanConfigSpec spvlanConfigSpec = createDVPortPvlanConfigSpec(vid, spvlanid, PvlanType.isolated, PvlanOperation.add);
+ dvsSpec.getPvlanConfigSpec().add(spvlanConfigSpec);
+ }
+
+ if (dvsSpec.getPvlanConfigSpec().size() > 0) {
+ // We have something to configure on the DVS... so send it the command.
+ // When reconfiguring a vmware DVSwitch, we need to send in the configVersion in the spec.
+ // Let's retrieve this switch's configVersion first.
+ String dvsConfigVersion = dvSwitchMo.getDVSConfigVersion(morDvSwitch);
+ dvsSpec.setConfigVersion(dvsConfigVersion);
+
+ // Reconfigure the dvs using this spec.
+ try {
+ dvSwitchMo.updateVMWareDVSwitchGetTask(morDvSwitch, dvsSpec);
+ } catch (AlreadyExistsFaultMsg e) {
+ s_logger.info("Specified vlan id (" + vid + ") private vlan id (" + spvlanid + ") tuple already configured on VMWare DVSwitch");
+ // Do nothing, good if the tuple's already configured on the dvswitch.
+ } catch (Exception e) {
+ // Rethrow the exception
+ s_logger.error("Failed to configure vlan/pvlan tuple on VMware DVSwitch: " + vid + "/" + spvlanid + ", failure message: ", e);
+ throw e;
+ }
+ }
+
+ }
+
+ private static void createPortGroup(String physicalNetwork, String networkName, Integer vid, Integer spvlanid, DatacenterMO dataCenterMo,
+ DVSTrafficShapingPolicy shapingPolicy, DVSSecurityPolicy secPolicy, DistributedVirtualSwitchMO dvSwitchMo, int numPorts, boolean autoExpandSupported) throws Exception{
+ VmwareDistributedVirtualSwitchVlanSpec vlanSpec = null;
+ VmwareDistributedVirtualSwitchPvlanSpec pvlanSpec = null;
+ VMwareDVSPortSetting dvsPortSetting = null;
+ DVPortgroupConfigSpec dvPortGroupSpec;
+
+ // Next, create the port group. For this, we need to create a VLAN spec.
+ // NOTE - VmwareDistributedVirtualSwitchPvlanSpec extends VmwareDistributedVirtualSwitchVlanSpec.
+ if (vid == null || spvlanid == null) {
+ vlanSpec = createDVPortVlanIdSpec(vid);
+ dvsPortSetting = createVmwareDVPortSettingSpec(shapingPolicy, secPolicy, vlanSpec);
+ } else if (spvlanid != null) {
+ // Create a pvlan spec. The pvlan spec is different from the pvlan config spec
+ // that we created earlier. The pvlan config spec is used to configure the switch
+ // with a <primary vlanId, secondary vlanId> tuple. The pvlan spec is used
+ // to configure a port group (i.e., a network) with a secondary vlan id. We don't
+ // need to mention more than the secondary vlan id because one secondary vlan id
+ // can be associated with only one primary vlan id. Give vCenter the secondary vlan id,
+ // and it will find out the associated primary vlan id and do the rest of the
+ // port group configuration.
+ pvlanSpec = createDVPortPvlanIdSpec(spvlanid);
+ dvsPortSetting = createVmwareDVPortSettingSpec(shapingPolicy, secPolicy, pvlanSpec);
+ }
+
+ dvPortGroupSpec = createDvPortGroupSpec(networkName, dvsPortSetting, numPorts, autoExpandSupported);
+
+
+ if (!dataCenterMo.hasDvPortGroup(networkName)) {
+ s_logger.info("Distributed Virtual Port group " + networkName + " not found.");
+ // TODO(sateesh): Handle Exceptions
+ try {
+ dvSwitchMo.createDVPortGroup(dvPortGroupSpec);
+ } catch (Exception e) {
+ String msg = "Failed to create distributed virtual port group " + networkName + " on dvSwitch " + physicalNetwork;
+ throw new Exception(msg);
+ }
+ } else {
+ s_logger.info("Found Distributed Virtual Port group " + networkName);
+ // TODO(sateesh): Handle Exceptions
+ DVPortgroupConfigInfo dvPortgroupInfo = dataCenterMo.getDvPortGroupSpec(networkName);
+ if (!isSpecMatch(dvPortgroupInfo, vid, shapingPolicy)) {
+ s_logger.info("Updating Distributed Virtual Port group " + networkName);
+ dvPortGroupSpec.setDefaultPortConfig(dvsPortSetting);
+ dvPortGroupSpec.setConfigVersion(dvPortgroupInfo.getConfigVersion());
+ ManagedObjectReference morDvPortGroup = dataCenterMo.getDvPortGroupMor(networkName);
+ try {
+ dvSwitchMo.updateDvPortGroup(morDvPortGroup, dvPortGroupSpec);
+ } catch (Exception e) {
+ String msg = "Failed to update distributed virtual port group " + networkName + " on dvSwitch " + physicalNetwork;
+ throw new Exception(msg);
+ }
+ }
+ }
+ }
+
+ public static ManagedObjectReference waitForDvPortGroupReady(
+ DatacenterMO dataCenterMo, String dvPortGroupName, long timeOutMs) throws Exception {
+ ManagedObjectReference morDvPortGroup = null;
+
+ // if DvPortGroup is just created, we may fail to retrieve it, we
+ // need to retry
+ long startTick = System.currentTimeMillis();
+ while (System.currentTimeMillis() - startTick <= timeOutMs) {
+ morDvPortGroup = dataCenterMo.getDvPortGroupMor(dvPortGroupName);
+ if (morDvPortGroup != null) {
+ break;
+ }
+
+ s_logger.info("Waiting for dvPortGroup " + dvPortGroupName + " to be ready");
+ Thread.sleep(1000);
+ }
+ return morDvPortGroup;
+ }
public static boolean isSpecMatch(DVPortgroupConfigInfo configInfo, Integer vid, DVSTrafficShapingPolicy shapingPolicy) {
- DVSTrafficShapingPolicy currentTrafficShapingPolicy;
+ DVSTrafficShapingPolicy currentTrafficShapingPolicy;
currentTrafficShapingPolicy = configInfo.getDefaultPortConfig().getInShapingPolicy();
- assert(currentTrafficShapingPolicy != null);
+ assert(currentTrafficShapingPolicy != null);
- LongPolicy averageBandwidth = currentTrafficShapingPolicy.getAverageBandwidth();
- LongPolicy burstSize = currentTrafficShapingPolicy.getBurstSize();
- LongPolicy peakBandwidth = currentTrafficShapingPolicy.getPeakBandwidth();
- BoolPolicy isEnabled = currentTrafficShapingPolicy.getEnabled();
+ LongPolicy averageBandwidth = currentTrafficShapingPolicy.getAverageBandwidth();
+ LongPolicy burstSize = currentTrafficShapingPolicy.getBurstSize();
+ LongPolicy peakBandwidth = currentTrafficShapingPolicy.getPeakBandwidth();
+ BoolPolicy isEnabled = currentTrafficShapingPolicy.getEnabled();
if (!isEnabled.equals(shapingPolicy.getEnabled())) {
- return false;
+ return false;
+ }
+
+ if(averageBandwidth != null && !averageBandwidth.equals(shapingPolicy.getAverageBandwidth())) {
+ if(s_logger.isInfoEnabled()) {
+ s_logger.info("Average bandwidth setting in shaping policy doesn't match with existing setting.");
+ }
+ return false;
+ } else if(burstSize != null && !burstSize.equals(shapingPolicy.getBurstSize())) {
+ if(s_logger.isInfoEnabled()) {
+ s_logger.info("Burst size setting in shaping policy doesn't match with existing setting.");
+ }
+ return false;
+ } else if(peakBandwidth != null && !peakBandwidth.equals(shapingPolicy.getPeakBandwidth())) {
+ if(s_logger.isInfoEnabled()) {
+ s_logger.info("Peak bandwidth setting in shaping policy doesn't match with existing setting.");
+ }
+ return false;
}
- if(averageBandwidth != null && !averageBandwidth.equals(shapingPolicy.getAverageBandwidth())) {
- if(s_logger.isInfoEnabled()) {
- s_logger.info("Average bandwidth setting in shaping policy doesn't match with existing setting.");
- }
- return false;
- } else if(burstSize != null && !burstSize.equals(shapingPolicy.getBurstSize())) {
- if(s_logger.isInfoEnabled()) {
- s_logger.info("Burst size setting in shaping policy doesn't match with existing setting.");
- }
- return false;
- } else if(peakBandwidth != null && !peakBandwidth.equals(shapingPolicy.getPeakBandwidth())) {
- if(s_logger.isInfoEnabled()) {
- s_logger.info("Peak bandwidth setting in shaping policy doesn't match with existing setting.");
- }
- return false;
- }
-
- return true;
- }
+ return true;
+ }
public static DVPortgroupConfigSpec createDvPortGroupSpec(String dvPortGroupName, DVPortSetting portSetting, int numPorts, boolean autoExpandSupported) {
DVPortgroupConfigSpec spec = new DVPortgroupConfigSpec();
@@ -813,9 +854,9 @@ public class HypervisorHostHelper {
return secPolicy;
}
- public static Pair<ManagedObjectReference, String> prepareNetwork(String vSwitchName, String namePrefix,
+ public static Pair<ManagedObjectReference, String> prepareNetwork(String vSwitchName, String namePrefix,
HostMO hostMo, String vlanId, Integer networkRateMbps, Integer networkRateMulticastMbps,
- long timeOutMs, boolean syncPeerHosts) throws Exception {
+ long timeOutMs, boolean syncPeerHosts, BroadcastDomainType broadcastDomainType) throws Exception {
HostVirtualSwitch vSwitch;
if (vSwitchName == null) {
@@ -834,12 +875,37 @@ public class HypervisorHostHelper {
String networkName;
Integer vid = null;
- if(vlanId != null && !UNTAGGED_VLAN_NAME.equalsIgnoreCase(vlanId)) {
- createGCTag = true;
- vid = Integer.parseInt(vlanId);
+ /** This is the list of BroadcastDomainTypes we can actually
+ * prepare networks for in this function.
+ */
+ BroadcastDomainType[] supportedBroadcastTypes =
+ new BroadcastDomainType[] { BroadcastDomainType.Lswitch,
+ BroadcastDomainType.LinkLocal,
+ BroadcastDomainType.Native,
+ BroadcastDomainType.Pvlan,
+ BroadcastDomainType.Storage,
+ BroadcastDomainType.UnDecided,
+ BroadcastDomainType.Vlan };
+
+ if (!Arrays.asList(supportedBroadcastTypes).contains(broadcastDomainType)) {
+ throw new InvalidParameterException("BroadcastDomainType " + broadcastDomainType +
+ " it not supported on a VMWare hypervisor at this time.");
+ }
+
+ if (broadcastDomainType == BroadcastDomainType.Lswitch) {
+ // Fixed name for the port-group on the vApp vswitch
+ networkName = "br-int";
+ // No doubt about this, depending on vid=null to avoid lots of code below
+ vid = null;
+ } else {
+ networkName = composeCloudNetworkName(namePrefix, vlanId, null, networkRateMbps, vSwitchName);
+
+ if(vlanId != null && !UNTAGGED_VLAN_NAME.equalsIgnoreCase(vlanId) ) {
+ createGCTag = true;
+ vid = Integer.parseInt(vlanId);
+ }
}
- networkName = composeCloudNetworkName(namePrefix, vlanId, null, networkRateMbps, vSwitchName);
HostNetworkSecurityPolicy secPolicy = null;
if (namePrefix.equalsIgnoreCase("cloud.private")) {
secPolicy = new HostNetworkSecurityPolicy();
@@ -865,17 +931,25 @@ public class HypervisorHostHelper {
}
boolean bWaitPortGroupReady = false;
- if (!hostMo.hasPortGroup(vSwitch, networkName)) {
- hostMo.createPortGroup(vSwitch, networkName, vid, secPolicy, shapingPolicy);
- bWaitPortGroupReady = true;
+ if (broadcastDomainType == BroadcastDomainType.Lswitch) {
+ if (!hostMo.hasPortGroup(vSwitch, networkName)) {
+ // It'a bad thing if the integration bridge port-group does not exist
+ throw new InvalidParameterException("Unable to find port-group " + networkName + " on dvSwitch " + vSwitchName);
+ }
+ bWaitPortGroupReady = false;
} else {
- HostPortGroupSpec spec = hostMo.getPortGroupSpec(networkName);
- if(!isSpecMatch(spec, vid, shapingPolicy)) {
- hostMo.updatePortGroup(vSwitch, networkName, vid, secPolicy, shapingPolicy);
+ if (!hostMo.hasPortGroup(vSwitch, networkName)) {
+ hostMo.createPortGroup(vSwitch, networkName, vid, secPolicy, shapingPolicy);
bWaitPortGroupReady = true;
+ } else {
+ HostPortGroupSpec spec = hostMo.getPortGroupSpec(networkName);
+ if(!isSpecMatch(spec, vid, shapingPolicy)) {
+ hostMo.updatePortGroup(vSwitch, networkName, vid, secPolicy, shapingPolicy);
+ bWaitPortGroupReady = true;
+ }
}
}
-
+
ManagedObjectReference morNetwork;
if(bWaitPortGroupReady)
morNetwork = waitForNetworkReady(hostMo, networkName, timeOutMs);
@@ -908,7 +982,7 @@ public class HypervisorHostHelper {
try {
if(s_logger.isDebugEnabled())
s_logger.debug("Prepare network on other host, vlan: " + vlanId + ", host: " + otherHostMo.getHostName());
- prepareNetwork(vSwitchName, namePrefix, otherHostMo, vlanId, networkRateMbps, networkRateMulticastMbps, timeOutMs, false);
+ prepareNetwork(vSwitchName, namePrefix, otherHostMo, vlanId, networkRateMbps, networkRateMulticastMbps, timeOutMs, false, broadcastDomainType);
} catch(Exception e) {
s_logger.warn("Unable to prepare network on other host, vlan: " + vlanId + ", host: " + otherHostMo.getHostName());
}
@@ -931,273 +1005,273 @@ public class HypervisorHostHelper {
return new Pair<ManagedObjectReference, String>(morNetwork, networkName);
}
- private static boolean isSpecMatch(HostPortGroupSpec spec, Integer vlanId, HostNetworkTrafficShapingPolicy shapingPolicy) {
- // check VLAN configuration
- if(vlanId != null) {
- if(vlanId.intValue() != spec.getVlanId())
- return false;
- } else {
- if(spec.getVlanId() != 0)
- return false;
- }
-
- // check traffic shaping configuration
- HostNetworkTrafficShapingPolicy policyInSpec = null;
- if(spec.getPolicy() != null)
- policyInSpec = spec.getPolicy().getShapingPolicy();
-
- if(policyInSpec != null && shapingPolicy == null || policyInSpec == null && shapingPolicy != null)
- return false;
-
- if(policyInSpec == null && shapingPolicy == null)
- return true;
-
- // so far policyInSpec and shapingPolicy should both not be null
- if(policyInSpec.isEnabled() == null || !policyInSpec.isEnabled().booleanValue())
- return false;
-
- if(policyInSpec.getAverageBandwidth() == null || policyInSpec.getAverageBandwidth().longValue() != shapingPolicy.getAverageBandwidth().longValue())
- return false;
-
- if(policyInSpec.getPeakBandwidth() == null || policyInSpec.getPeakBandwidth().longValue() != shapingPolicy.getPeakBandwidth().longValue())
- return false;
-
- if(policyInSpec.getBurstSize() == null || policyInSpec.getBurstSize().longValue() != shapingPolicy.getBurstSize().longValue())
- return false;
-
- return true;
- }
-
- public static ManagedObjectReference waitForNetworkReady(HostMO hostMo,
- String networkName, long timeOutMs) throws Exception {
-
- ManagedObjectReference morNetwork = null;
-
- // if portGroup is just created, getNetwork may fail to retrieve it, we
- // need to retry
- long startTick = System.currentTimeMillis();
- while (System.currentTimeMillis() - startTick <= timeOutMs) {
- morNetwork = hostMo.getNetworkMor(networkName);
- if (morNetwork != null) {
- break;
- }
-
- s_logger.info("Waiting for network " + networkName + " to be ready");
- Thread.sleep(1000);
- }
-
- return morNetwork;
- }
-
- public static boolean createBlankVm(VmwareHypervisorHost host, String vmName,
- int cpuCount, int cpuSpeedMHz, int cpuReservedMHz, boolean limitCpuUse, int memoryMB, int memoryReserveMB, String guestOsIdentifier,
- ManagedObjectReference morDs, boolean snapshotDirToParent) throws Exception {
-
- if(s_logger.isInfoEnabled())
- s_logger.info("Create blank VM. cpuCount: " + cpuCount + ", cpuSpeed(MHz): " + cpuSpeedMHz + ", mem(Mb): " + memoryMB);
-
- // VM config basics
- VirtualMachineConfigSpec vmConfig = new VirtualMachineConfigSpec();
- vmConfig.setName(vmName);
- VmwareHelper.setBasicVmConfig(vmConfig, cpuCount, cpuSpeedMHz, cpuReservedMHz, memoryMB, memoryReserveMB, guestOsIdentifier, limitCpuUse);
-
- // Scsi controller
- VirtualLsiLogicController scsiController = new VirtualLsiLogicController();
- scsiController.setSharedBus(VirtualSCSISharing.NO_SHARING);
- scsiController.setBusNumber(0);
- scsiController.setKey(1);
- VirtualDeviceConfigSpec scsiControllerSpec = new VirtualDeviceConfigSpec();
- scsiControllerSpec.setDevice(scsiController);
- scsiControllerSpec.setOperation(VirtualDeviceConfigSpecOperation.ADD);
-
- VirtualMachineFileInfo fileInfo = new VirtualMachineFileInfo();
- DatastoreMO dsMo = new DatastoreMO(host.getContext(), morDs);
- fileInfo.setVmPathName(String.format("[%s]", dsMo.getName()));
- vmConfig.setFiles(fileInfo);
-
- VirtualMachineVideoCard videoCard = new VirtualMachineVideoCard();
- videoCard.setControllerKey(100);
- videoCard.setUseAutoDetect(true);
-
- VirtualDeviceConfigSpec videoDeviceSpec = new VirtualDeviceConfigSpec();
- videoDeviceSpec.setDevice(videoCard);
- videoDeviceSpec.setOperation(VirtualDeviceConfigSpecOperation.ADD);
-
- vmConfig.getDeviceChange().add(scsiControllerSpec);
- vmConfig.getDeviceChange().add(videoDeviceSpec);
- if(host.createVm(vmConfig)) {
- VirtualMachineMO vmMo = host.findVmOnHyperHost(vmName);
- assert(vmMo != null);
-
- int ideControllerKey = -1;
- while(ideControllerKey < 0) {
- ideControllerKey = vmMo.tryGetIDEDeviceControllerKey();
- if(ideControllerKey >= 0)
- break;
-
- s_logger.info("Waiting for IDE controller be ready in VM: " + vmName);
- Thread.sleep(1000);
- }
-
- if(snapshotDirToParent) {
- String snapshotDir = String.format("/vmfs/volumes/%s/", dsMo.getName());
-
- s_logger.info("Switch snapshot working directory to " + snapshotDir + " for " + vmName);
- vmMo.setSnapshotDirectory(snapshotDir);
-
- // Don't have a good way to test if the VM is really ready for use through normal API after configuration file manipulation,
- // delay 3 seconds
- Thread.sleep(3000);
- }
-
- s_logger.info("Blank VM: " + vmName + " is ready for use");
- return true;
- }
- return false;
- }
-
- public static String resolveHostNameInUrl(DatacenterMO dcMo, String url) {
-
- s_logger.info("Resolving host name in url through vCenter, url: " + url);
-
- URI uri;
- try {
- uri = new URI(url);
- } catch (URISyntaxException e) {
- s_logger.warn("URISyntaxException on url " + url);
- return url;
- }
-
- String host = uri.getHost();
- if(NetUtils.isValidIp(host)) {
- s_logger.info("host name in url is already in IP address, url: " + url);
- return url;
- }
-
- try {
- ManagedObjectReference morHost = dcMo.findHost(host);
- if(morHost != null) {
- HostMO hostMo = new HostMO(dcMo.getContext(), morHost);
- String managementPortGroupName;
- if(hostMo.getHostType() == VmwareHostType.ESXi)
- managementPortGroupName = (String)dcMo.getContext().getStockObject("manageportgroup");
- else
- managementPortGroupName = (String)dcMo.getContext().getStockObject("serviceconsole");
-
- VmwareHypervisorHostNetworkSummary summary = hostMo.getHyperHostNetworkSummary(managementPortGroupName);
- if(summary == null) {
- s_logger.warn("Unable to resolve host name in url through vSphere, url: " + url);
- return url;
- }
-
- String hostIp = summary.getHostIp();
-
- try {
- URI resolvedUri = new URI(uri.getScheme(), uri.getUserInfo(), hostIp, uri.getPort(), uri.getPath(), uri.getQuery(), uri.getFragment());
-
- s_logger.info("url " + url + " is resolved to " + resolvedUri.toString() + " through vCenter");
- return resolvedUri.toString();
- } catch (URISyntaxException e) {
- assert(false);
- return url;
- }
- }
- } catch(Exception e) {
- s_logger.warn("Unexpected exception ", e);
- }
-
- return url;
- }
-
- public static void importVmFromOVF(VmwareHypervisorHost host, String ovfFilePath, String vmName, DatastoreMO dsMo, String diskOption,
- ManagedObjectReference morRp, ManagedObjectReference morHost) throws Exception {
-
- assert(morRp != null);
-
- OvfCreateImportSpecParams importSpecParams = new OvfCreateImportSpecParams();
- importSpecParams.setHostSystem(morHost);
- importSpecParams.setLocale("US");
- importSpecParams.setEntityName(vmName);
- importSpecParams.setDeploymentOption("");
- importSpecParams.setDiskProvisioning(diskOption); // diskOption: thin, thick, etc
- //importSpecParams.setPropertyMapping(null);
-
- String ovfDescriptor = HttpNfcLeaseMO.readOvfContent(ovfFilePath);
- VmwareContext context = host.getContext();
- OvfCreateImportSpecResult ovfImportResult = context.getService().createImportSpec(
- context.getServiceContent().getOvfManager(), ovfDescriptor, morRp,
- dsMo.getMor(), importSpecParams);
-
- if(ovfImportResult == null) {
- String msg = "createImportSpec() failed. ovfFilePath: " + ovfFilePath + ", vmName: "
- + vmName + ", diskOption: " + diskOption;
- s_logger.error(msg);
- throw new Exception(msg);
- }
-
- DatacenterMO dcMo = new DatacenterMO(context, host.getHyperHostDatacenter());
- ManagedObjectReference morLease = context.getService().importVApp(morRp,
- ovfImportResult.getImportSpec(), dcMo.getVmFolder(), morHost);
- if(morLease == null) {
- String msg = "importVApp() failed. ovfFilePath: " + ovfFilePath + ", vmName: "
- + vmName + ", diskOption: " + diskOption;
- s_logger.error(msg);
- throw new Exception(msg);
- }
+ private static boolean isSpecMatch(HostPortGroupSpec spec, Integer vlanId, HostNetworkTrafficShapingPolicy shapingPolicy) {
+ // check VLAN configuration
+ if(vlanId != null) {
+ if(vlanId.intValue() != spec.getVlanId())
+ return false;
+ } else {
+ if(spec.getVlanId() != 0)
+ return false;
+ }
+
+ // check traffic shaping configuration
+ HostNetworkTrafficShapingPolicy policyInSpec = null;
+ if(spec.getPolicy() != null)
+ policyInSpec = spec.getPolicy().getShapingPolicy();
+
+ if(policyInSpec != null && shapingPolicy == null || policyInSpec == null && shapingPolicy != null)
+ return false;
+
+ if(policyInSpec == null && shapingPolicy == null)
+ return true;
+
+ // so far policyInSpec and shapingPolicy should both not be null
+ if(policyInSpec.isEnabled() == null || !policyInSpec.isEnabled().booleanValue())
+ return false;
+
+ if(policyInSpec.getAverageBandwidth() == null || policyInSpec.getAverageBandwidth().longValue() != shapingPolicy.getAverageBandwidth().longValue())
+ return false;
+
+ if(policyInSpec.getPeakBandwidth() == null || policyInSpec.getPeakBandwidth().longValue() != shapingPolicy.getPeakBandwidth().longValue())
+ return false;
+
+ if(policyInSpec.getBurstSize() == null || policyInSpec.getBurstSize().longValue() != shapingPolicy.getBurstSize().longValue())
+ return false;
+
+ return true;
+ }
+
+ public static ManagedObjectReference waitForNetworkReady(HostMO hostMo,
+ String networkName, long timeOutMs) throws Exception {
+
+ ManagedObjectReference morNetwork = null;
+
+ // if portGroup is just created, getNetwork may fail to retrieve it, we
+ // need to retry
+ long startTick = System.currentTimeMillis();
+ while (System.currentTimeMillis() - startTick <= timeOutMs) {
+ morNetwork = hostMo.getNetworkMor(networkName);
+ if (morNetwork != null) {
+ break;
+ }
+
+ s_logger.info("Waiting for network " + networkName + " to be ready");
+ Thread.sleep(1000);
+ }
+
+ return morNetwork;
+ }
+
+ public static boolean createBlankVm(VmwareHypervisorHost host, String vmName,
+ int cpuCount, int cpuSpeedMHz, int cpuReservedMHz, boolean limitCpuUse, int memoryMB, int memoryReserveMB, String guestOsIdentifier,
+ ManagedObjectReference morDs, boolean snapshotDirToParent) throws Exception {
+
+ if(s_logger.isInfoEnabled())
+ s_logger.info("Create blank VM. cpuCount: " + cpuCount + ", cpuSpeed(MHz): " + cpuSpeedMHz + ", mem(Mb): " + memoryMB);
+
+ // VM config basics
+ VirtualMachineConfigSpec vmConfig = new VirtualMachineConfigSpec();
+ vmConfig.setName(vmName);
+ VmwareHelper.setBasicVmConfig(vmConfig, cpuCount, cpuSpeedMHz, cpuReservedMHz, memoryMB, memoryReserveMB, guestOsIdentifier, limitCpuUse);
+
+ // Scsi controller
+ VirtualLsiLogicController scsiController = new VirtualLsiLogicController();
+ scsiController.setSharedBus(VirtualSCSISharing.NO_SHARING);
+ scsiController.setBusNumber(0);
+ scsiController.setKey(1);
+ VirtualDeviceConfigSpec scsiControllerSpec = new VirtualDeviceConfigSpec();
+ scsiControllerSpec.setDevice(scsiController);
+ scsiControllerSpec.setOperation(VirtualDeviceConfigSpecOperation.ADD);
+
+ VirtualMachineFileInfo fileInfo = new VirtualMachineFileInfo();
+ DatastoreMO dsMo = new DatastoreMO(host.getContext(), morDs);
+ fileInfo.setVmPathName(String.format("[%s]", dsMo.getName()));
+ vmConfig.setFiles(fileInfo);
+
+ VirtualMachineVideoCard videoCard = new VirtualMachineVideoCard();
+ videoCard.setControllerKey(100);
+ videoCard.setUseAutoDetect(true);
+
+ VirtualDeviceConfigSpec videoDeviceSpec = new VirtualDeviceConfigSpec();
+ videoDeviceSpec.setDevice(videoCard);
+ videoDeviceSpec.setOperation(VirtualDeviceConfigSpecOperation.ADD);
+
+ vmConfig.getDeviceChange().add(scsiControllerSpec);
+ vmConfig.getDeviceChange().add(videoDeviceSpec);
+ if(host.createVm(vmConfig)) {
+ VirtualMachineMO vmMo = host.findVmOnHyperHost(vmName);
+ assert(vmMo != null);
+
+ int ideControllerKey = -1;
+ while(ideControllerKey < 0) {
+ ideControllerKey = vmMo.tryGetIDEDeviceControllerKey();
+ if(ideControllerKey >= 0)
+ break;
+
+ s_logger.info("Waiting for IDE controller be ready in VM: " + vmName);
+ Thread.sleep(1000);
+ }
+
+ if(snapshotDirToParent) {
+ String snapshotDir = String.format("/vmfs/volumes/%s/", dsMo.getName());
+
+ s_logger.info("Switch snapshot working directory to " + snapshotDir + " for " + vmName);
+ vmMo.setSnapshotDirectory(snapshotDir);
+
+ // Don't have a good way to test if the VM is really ready for use through normal API after configuration file manipulation,
+ // delay 3 seconds
+ Thread.sleep(3000);
+ }
+
+ s_logger.info("Blank VM: " + vmName + " is ready for use");
+ return true;
+ }
+ return false;
+ }
+
+ public static String resolveHostNameInUrl(DatacenterMO dcMo, String url) {
+
+ s_logger.info("Resolving host name in url through vCenter, url: " + url);
+
+ URI uri;
+ try {
+ uri = new URI(url);
+ } catch (URISyntaxException e) {
+ s_logger.warn("URISyntaxException on url " + url);
+ return url;
+ }
+
+ String host = uri.getHost();
+ if(NetUtils.isValidIp(host)) {
+ s_logger.info("host name in url is already in IP address, url: " + url);
+ return url;
+ }
+
+ try {
+ ManagedObjectReference morHost = dcMo.findHost(host);
+ if(morHost != null) {
+ HostMO hostMo = new HostMO(dcMo.getContext(), morHost);
+ String managementPortGroupName;
+ if(hostMo.getHostType() == VmwareHostType.ESXi)
+ managementPortGroupName = (String)dcMo.getContext().getStockObject("manageportgroup");
+ else
+ managementPortGroupName = (String)dcMo.getContext().getStockObject("serviceconsole");
+
+ VmwareHypervisorHostNetworkSummary summary = hostMo.getHyperHostNetworkSummary(managementPortGroupName);
+ if(summary == null) {
+ s_logger.warn("Unable to resolve host name in url through vSphere, url: " + url);
+ return url;
+ }
+
+ String hostIp = summary.getHostIp();
+
+ try {
+ URI resolvedUri = new URI(uri.getScheme(), uri.getUserInfo(), hostIp, uri.getPort(), uri.getPath(), uri.getQuery(), uri.getFragment());
+
+ s_logger.info("url " + url + " is resolved to " + resolvedUri.toString() + " through vCenter");
+ return resolvedUri.toString();
+ } catch (URISyntaxException e) {
+ assert(false);
+ return url;
+ }
+ }
+ } catch(Exception e) {
+ s_logger.warn("Unexpected exception ", e);
+ }
+
+ return url;
+ }
+
+ public static void importVmFromOVF(VmwareHypervisorHost host, String ovfFilePath, String vmName, DatastoreMO dsMo, String diskOption,
+ ManagedObjectReference morRp, ManagedObjectReference morHost) throws Exception {
+
+ assert(morRp != null);
+
+ OvfCreateImportSpecParams importSpecParams = new OvfCreateImportSpecParams();
+ importSpecParams.setHostSystem(morHost);
+ importSpecParams.setLocale("US");
+ importSpecParams.setEntityName(vmName);
+ importSpecParams.setDeploymentOption("");
+ importSpecParams.setDiskProvisioning(diskOption); // diskOption: thin, thick, etc
+ //importSpecParams.setPropertyMapping(null);
+
+ String ovfDescriptor = HttpNfcLeaseMO.readOvfContent(ovfFilePath);
+ VmwareContext context = host.getContext();
+ OvfCreateImportSpecResult ovfImportResult = context.getService().createImportSpec(
+ context.getServiceContent().getOvfManager(), ovfDescriptor, morRp,
+ dsMo.getMor(), importSpecParams);
+
+ if(ovfImportResult == null) {
+ String msg = "createImportSpec() failed. ovfFilePath: " + ovfFilePath + ", vmName: "
+ + vmName + ", diskOption: " + diskOption;
+ s_logger.error(msg);
+ throw new Exception(msg);
+ }
+
+ DatacenterMO dcMo = new DatacenterMO(context, host.getHyperHostDatacenter());
+ ManagedObjectReference morLease = context.getService().importVApp(morRp,
+ ovfImportResult.getImportSpec(), dcMo.getVmFolder(), morHost);
+ if(morLease == null) {
+ String msg = "importVApp() failed. ovfFilePath: " + ovfFilePath + ", vmName: "
+ + vmName + ", diskOption: " + diskOption;
+ s_logger.error(msg);
+ throw new Exception(msg);
+ }
boolean importSuccess = true;
- final HttpNfcLeaseMO leaseMo = new HttpNfcLeaseMO(context, morLease);
- HttpNfcLeaseState state = leaseMo.waitState(
- new HttpNfcLeaseState[] { HttpNfcLeaseState.READY, HttpNfcLeaseState.ERROR });
- try {
- if(state == HttpNfcLeaseState.READY) {
- final long totalBytes = HttpNfcLeaseMO.calcTotalBytes(ovfImportResult);
- File ovfFile = new File(ovfFilePath);
-
- HttpNfcLeaseInfo httpNfcLeaseInfo = leaseMo.getLeaseInfo();
- List<HttpNfcLeaseDeviceUrl> deviceUrls = httpNfcLeaseInfo.getDeviceUrl();
- long bytesAlreadyWritten = 0;
-
- final HttpNfcLeaseMO.ProgressReporter progressReporter = leaseMo.createProgressReporter();
- try {
- for (HttpNfcLeaseDeviceUrl deviceUrl : deviceUrls) {
- String deviceKey = deviceUrl.getImportKey();
- for (OvfFileItem ovfFileItem : ovfImportResult.getFileItem()) {
- if (deviceKey.equals(ovfFileItem.getDeviceId())) {
- String absoluteFile = ovfFile.getParent() + File.separator + ovfFileItem.getPath();
- String urlToPost = deviceUrl.getUrl();
- urlToPost = resolveHostNameInUrl(dcMo, urlToPost);
-
- context.uploadVmdkFile(ovfFileItem.isCreate() ? "PUT" : "POST", urlToPost, absoluteFile,
- bytesAlreadyWritten, new ActionDelegate<Long> () {
+ final HttpNfcLeaseMO leaseMo = new HttpNfcLeaseMO(context, morLease);
+ HttpNfcLeaseState state = leaseMo.waitState(
+ new HttpNfcLeaseState[] { HttpNfcLeaseState.READY, HttpNfcLeaseState.ERROR });
+ try {
+ if(state == HttpNfcLeaseState.READY) {
+ final long totalBytes = HttpNfcLeaseMO.calcTotalBytes(ovfImportResult);
+ File ovfFile = new File(ovfFilePath);
+
+ HttpNfcLeaseInfo httpNfcLeaseInfo = leaseMo.getLeaseInfo();
+ List<HttpNfcLeaseDeviceUrl> deviceUrls = httpNfcLeaseInfo.getDeviceUrl();
+ long bytesAlreadyWritten = 0;
+
+ final HttpNfcLeaseMO.ProgressReporter progressReporter = leaseMo.createProgressReporter();
+ try {
+ for (HttpNfcLeaseDeviceUrl deviceUrl : deviceUrls) {
+ String deviceKey = deviceUrl.getImportKey();
+ for (OvfFileItem ovfFileItem : ovfImportResult.getFileItem()) {
+ if (deviceKey.equals(ovfFileItem.getDeviceId())) {
+ String absoluteFile = ovfFile.getParent() + File.separator + ovfFileItem.getPath();
+ String urlToPost = deviceUrl.getUrl();
+ urlToPost = resolveHostNameInUrl(dcMo, urlToPost);
+
+ context.uploadVmdkFile(ovfFileItem.isCreate() ? "PUT" : "POST", urlToPost, absoluteFile,
+ bytesAlreadyWritten, new ActionDelegate<Long> () {
@Override
- public void action(Long param) {
- progressReporter.reportProgress((int)(param * 100 / totalBytes));
- }
- });
-
- bytesAlreadyWritten += ovfFileItem.getSize();
- }
- }
- }
+ public void action(Long param) {
+ progressReporter.reportProgress((int)(param * 100 / totalBytes));
+ }
+ });
+
+ bytesAlreadyWritten += ovfFileItem.getSize();
+ }
+ }
+ }
} catch (Exception e) {
s_logger.error("Failed to complete file upload task. " + e.getMessage());
// Set flag to cleanup the stale template left due to failed import operation, if any
importSuccess = false;
throw e;
- } finally {
- progressReporter.close();
- }
+ } finally {
+ progressReporter.close();
+ }
if (bytesAlreadyWritten == totalBytes) {
- leaseMo.updateLeaseProgress(100);
- }
+ leaseMo.updateLeaseProgress(100);
+ }
}
- } finally {
+ } finally {
if (!importSuccess) {
s_logger.error("Aborting the lease on " + vmName + " after import operation failed.");
leaseMo.abortLease();
} else {
- leaseMo.completeLease();
- }
- }
- }
+ leaseMo.completeLease();
+ }
+ }
+ }
}
[23/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-3050
XS - Enforce recommended guest OS values for ram
Signed off by : nitin mehta<ni...@citrix.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f90279d9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f90279d9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f90279d9
Branch: refs/heads/vmsync
Commit: f90279d9bb2d745b759f7b750bfd7910cb078074
Parents: 55f0e16
Author: Nitin Mehta <ni...@citrix.com>
Authored: Wed Jun 26 12:38:50 2013 +0530
Committer: Nitin Mehta <ni...@citrix.com>
Committed: Wed Jun 26 15:44:48 2013 +0530
----------------------------------------------------------------------
.../hypervisor/xen/resource/CitrixHelper.java | 842 ++++++++++++++++++-
.../xen/resource/XenServer56FP1Resource.java | 33 +-
.../xen/resource/XenServer56SP2Resource.java | 29 +
.../xen/resource/XenServer600Resource.java | 29 +
.../xen/resource/XenServer602Resource.java | 28 +
.../xen/resource/XenServer610Resource.java | 30 +
6 files changed, 979 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f90279d9/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java
index 8157de2..8eb6b7e 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java
@@ -35,6 +35,11 @@ public class CitrixHelper {
private static final HashMap<String, String> _xenServer600GuestOsMap = new HashMap<String, String>(70);
private static final HashMap<String, String> _xenServer602GuestOsMap = new HashMap<String, String>(70);
private static final HashMap<String, String> _xenServer610GuestOsMap = new HashMap<String, String>(70);
+ private static final HashMap<String, MemoryValues> _xenServer610GuestOsMemoryMap = new HashMap<String, MemoryValues>(70);
+ private static final HashMap<String, MemoryValues> _xenServer602GuestOsMemoryMap = new HashMap<String, MemoryValues>(70);
+ private static final HashMap<String, MemoryValues> _xenServer600GuestOsMemoryMap = new HashMap<String, MemoryValues>(70);
+ private static final HashMap<String, MemoryValues> _xenServer56SP2GuestOsMemoryMap = new HashMap<String, MemoryValues>(70);
+ private static final HashMap<String, MemoryValues> _xenServer56FP1GuestOsMemoryMap = new HashMap<String, MemoryValues>(70);
private static final ArrayList<String> _guestOsList = new ArrayList<String>(70);
@@ -333,7 +338,138 @@ public class CitrixHelper {
_xenServer56FP1GuestOsMap.put("Other PV (32-bit)", "CentOS 5 (32-bit)");
_xenServer56FP1GuestOsMap.put("Other PV (64-bit)", "CentOS 5 (64-bit)");
}
-
+
+ static {
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 4.5 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 4.6 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 4.7 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 4.8 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 5.0 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 5.0 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 5.1 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 5.1 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 5.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 5.2 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 5.3 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 5.3 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 5.4 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 5.4 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 5.5 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 5.5 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 5.6 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 5.6 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 5.7 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 5.7 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 6.0 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 6.0 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 6.1 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 6.1 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 6.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("CentOS 6.2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Debian GNU/Linux 6(32-bit)", new MemoryValues(128l, 32*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Debian GNU/Linux 6(64-bit)", new MemoryValues(128l, 32*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));// ??
+ _xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128*1024l)); //?
+ _xenServer56FP1GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer56FP1GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer56FP1GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer56FP1GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 (32-bit)", new MemoryValues(256l, 64*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 (64-bit)", new MemoryValues(256l, 128*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 PAE (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2008 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2008 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2008 R2 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2012 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Windows Server 8 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Windows Vista (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Windows XP SP3 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Ubuntu 10.04 (32-bit)", new MemoryValues(128l, 512l));
+ _xenServer56FP1GuestOsMemoryMap.put("Ubuntu 10.04 (64-bit)", new MemoryValues(128l, 32*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Ubuntu 10.10 (32-bit)", new MemoryValues(512l, 16*1024l));//?
+ _xenServer56FP1GuestOsMemoryMap.put("Ubuntu 10.10 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer56FP1GuestOsMemoryMap.put("Ubuntu 12.04 (32-bit)", new MemoryValues(128l, 32*1024l));
+ _xenServer56FP1GuestOsMemoryMap.put("Ubuntu 12.04 (64-bit)", new MemoryValues(128l, 128*1024l));
+ // _xenServer56FP1GuestOsMemoryMap.put("Other Linux (32-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer56FP1GuestOsMemoryMap.put("Other Linux (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Other (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Other (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Other CentOS (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Other CentOS (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Other Ubuntu (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Other Ubuntu (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Other SUSE Linux(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Other SUSE Linux(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Other PV (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Other PV (64-bit)", new MemoryValues(512l, 16*1024l));
+ }
+
+
static {
_xenServer56FP2GuestOsMap.put("CentOS 4.5 (32-bit)", "CentOS 4.5 (32-bit)");
_xenServer56FP2GuestOsMap.put("CentOS 4.6 (32-bit)", "CentOS 4.6 (32-bit)");
@@ -409,6 +545,136 @@ public class CitrixHelper {
_xenServer56FP2GuestOsMap.put("Other PV (64-bit)", "CentOS 5 (64-bit)");
}
+ static {
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 4.5 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 4.6 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 4.7 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 4.8 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 5.0 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 5.0 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 5.1 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 5.1 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 5.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 5.2 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 5.3 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 5.3 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 5.4 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 5.4 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 5.5 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 5.5 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 5.6 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 5.6 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 5.7 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 5.7 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 6.0 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 6.0 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 6.1 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 6.1 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 6.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("CentOS 6.2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Debian GNU/Linux 6(32-bit)", new MemoryValues(128l, 32*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Debian GNU/Linux 6(64-bit)", new MemoryValues(128l, 32*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));// ??
+ _xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128*1024l)); //?
+ _xenServer56SP2GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer56SP2GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer56SP2GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer56SP2GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 (32-bit)", new MemoryValues(256l, 64*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 (64-bit)", new MemoryValues(256l, 128*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 PAE (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2008 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2008 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2008 R2 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2012 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Windows Server 8 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Windows Vista (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Windows XP SP3 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Ubuntu 10.04 (32-bit)", new MemoryValues(128l, 512l));
+ _xenServer56SP2GuestOsMemoryMap.put("Ubuntu 10.04 (64-bit)", new MemoryValues(128l, 32*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Ubuntu 10.10 (32-bit)", new MemoryValues(512l, 16*1024l));//?
+ _xenServer56SP2GuestOsMemoryMap.put("Ubuntu 10.10 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer56SP2GuestOsMemoryMap.put("Ubuntu 12.04 (32-bit)", new MemoryValues(128l, 32*1024l));
+ _xenServer56SP2GuestOsMemoryMap.put("Ubuntu 12.04 (64-bit)", new MemoryValues(128l, 128*1024l));
+ // _xenServer56SP2GuestOsMemoryMap.put("Other Linux (32-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer56SP2GuestOsMemoryMap.put("Other Linux (64-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer56SP2GuestOsMemoryMap.put("Other (32-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer56SP2GuestOsMemoryMap.put("Other (64-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer56SP2GuestOsMemoryMap.put("Other CentOS (32-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer56SP2GuestOsMemoryMap.put("Other CentOS (64-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer56SP2GuestOsMemoryMap.put("Other Ubuntu (32-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer56SP2GuestOsMemoryMap.put("Other Ubuntu (64-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer56SP2GuestOsMemoryMap.put("Other SUSE Linux(32-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer56SP2GuestOsMemoryMap.put("Other SUSE Linux(64-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer56SP2GuestOsMemoryMap.put("Other PV (32-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer56SP2GuestOsMemoryMap.put("Other PV (64-bit)", new MemoryValues(512l, 16*1024l));
+ }
+
static {
_xenServer600GuestOsMap.put("CentOS 4.5 (32-bit)", "CentOS 4.5 (32-bit)");
@@ -515,8 +781,137 @@ public class CitrixHelper {
_xenServer600GuestOsMap.put("Other PV (32-bit)", "CentOS 5 (32-bit)");
_xenServer600GuestOsMap.put("Other PV (64-bit)", "CentOS 5 (64-bit)");
}
-
-
+
+ static {
+ _xenServer600GuestOsMemoryMap.put("CentOS 4.5 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 4.6 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 4.7 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 4.8 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 5.0 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 5.0 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 5.1 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 5.1 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 5.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 5.2 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 5.3 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 5.3 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 5.4 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 5.4 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 5.5 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 5.5 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 5.6 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 5.6 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 5.7 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 5.7 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 6.0 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 6.0 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 6.1 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 6.1 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 6.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("CentOS 6.2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer600GuestOsMemoryMap.put("Debian GNU/Linux 6(32-bit)", new MemoryValues(128l, 32*1024l));
+ _xenServer600GuestOsMemoryMap.put("Debian GNU/Linux 6(64-bit)", new MemoryValues(128l, 32*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));// ??
+ _xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128*1024l)); //?
+ _xenServer600GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer600GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer600GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer600GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer600GuestOsMemoryMap.put("Windows Server 2003 (32-bit)", new MemoryValues(256l, 64*1024l));
+ _xenServer600GuestOsMemoryMap.put("Windows Server 2003 (64-bit)", new MemoryValues(256l, 128*1024l));
+ _xenServer600GuestOsMemoryMap.put("Windows Server 2003 PAE (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Windows Server 2008 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Windows Server 2008 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Windows Server 2008 R2 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Windows Server 2012 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Windows Server 8 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Windows Vista (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Windows XP SP3 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer600GuestOsMemoryMap.put("Ubuntu 10.04 (32-bit)", new MemoryValues(128l, 512l));
+ _xenServer600GuestOsMemoryMap.put("Ubuntu 10.04 (64-bit)", new MemoryValues(128l, 32*1024l));
+ _xenServer600GuestOsMemoryMap.put("Ubuntu 10.10 (32-bit)", new MemoryValues(512l, 16*1024l));//?
+ _xenServer600GuestOsMemoryMap.put("Ubuntu 10.10 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer600GuestOsMemoryMap.put("Ubuntu 12.04 (32-bit)", new MemoryValues(128l, 32*1024l));
+ _xenServer600GuestOsMemoryMap.put("Ubuntu 12.04 (64-bit)", new MemoryValues(128l, 128*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other Linux (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other Linux (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other CentOS (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other CentOS (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other Ubuntu (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other Ubuntu (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other SUSE Linux(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other SUSE Linux(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other PV (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Other PV (64-bit)", new MemoryValues(512l, 16*1024l));
+ }
+
static {
_xenServer602GuestOsMap.put("CentOS 4.5 (32-bit)", "CentOS 4.5 (32-bit)");
_xenServer602GuestOsMap.put("CentOS 4.6 (32-bit)", "CentOS 4.6 (32-bit)");
@@ -634,6 +1029,137 @@ public class CitrixHelper {
}
static {
+ _xenServer602GuestOsMemoryMap.put("CentOS 4.5 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 4.6 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 4.7 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 4.8 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 5.0 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 5.0 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 5.1 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 5.1 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 5.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 5.2 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 5.3 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 5.3 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 5.4 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 5.4 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 5.5 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 5.5 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 5.6 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 5.6 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 5.7 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 5.7 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 6.0 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 6.0 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 6.1 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 6.1 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 6.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("CentOS 6.2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer602GuestOsMemoryMap.put("Debian GNU/Linux 5.0 (32-bit)", new MemoryValues(128l, 32*1024l));
+ _xenServer602GuestOsMemoryMap.put("Debian GNU/Linux 6(32-bit)", new MemoryValues(128l, 32*1024l));
+ _xenServer602GuestOsMemoryMap.put("Debian GNU/Linux 6(64-bit)", new MemoryValues(128l, 32*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));// ??
+ _xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128*1024l)); //?
+ _xenServer602GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer602GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer602GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer602GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer602GuestOsMemoryMap.put("Windows Server 2003 (32-bit)", new MemoryValues(256l, 64*1024l));
+ _xenServer602GuestOsMemoryMap.put("Windows Server 2003 (64-bit)", new MemoryValues(256l, 128*1024l));
+ _xenServer602GuestOsMemoryMap.put("Windows Server 2003 PAE (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Windows Server 2008 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Windows Server 2008 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Windows Server 2008 R2 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Windows Server 2012 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Windows Server 8 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Windows Vista (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Windows XP SP3 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer602GuestOsMemoryMap.put("Ubuntu 10.04 (32-bit)", new MemoryValues(128l, 512l));
+ _xenServer602GuestOsMemoryMap.put("Ubuntu 10.04 (64-bit)", new MemoryValues(128l, 32*1024l));
+ _xenServer602GuestOsMemoryMap.put("Ubuntu 10.10 (32-bit)", new MemoryValues(512l, 16*1024l));//?
+ _xenServer602GuestOsMemoryMap.put("Ubuntu 10.10 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer602GuestOsMemoryMap.put("Ubuntu 12.04 (32-bit)", new MemoryValues(128l, 32*1024l));
+ _xenServer602GuestOsMemoryMap.put("Ubuntu 12.04 (64-bit)", new MemoryValues(128l, 128*1024l));
+ // _xenServer602GuestOsMemoryMap.put("Other Linux (32-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer602GuestOsMemoryMap.put("Other Linux (64-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer602GuestOsMemoryMap.put("Other (32-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer602GuestOsMemoryMap.put("Other (64-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer602GuestOsMemoryMap.put("Other CentOS (32-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer602GuestOsMemoryMap.put("Other CentOS (64-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer602GuestOsMemoryMap.put("Other Ubuntu (32-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer602GuestOsMemoryMap.put("Other Ubuntu (64-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer602GuestOsMemoryMap.put("Other SUSE Linux(32-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer602GuestOsMemoryMap.put("Other SUSE Linux(64-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer602GuestOsMemoryMap.put("Other PV (32-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer602GuestOsMemoryMap.put("Other PV (64-bit)", new MemoryValues(512l, 16*1024l));
+ }
+
+ static {
_xenServer610GuestOsMap.put("CentOS 4.5 (32-bit)", "CentOS 4.5 (32-bit)");
_xenServer610GuestOsMap.put("CentOS 4.6 (32-bit)", "CentOS 4.6 (32-bit)");
_xenServer610GuestOsMap.put("CentOS 4.7 (32-bit)", "CentOS 4.7 (32-bit)");
@@ -767,6 +1293,155 @@ public class CitrixHelper {
_xenServer610GuestOsMap.put("Other PV (64-bit)", "CentOS 5 (64-bit)");
}
+ public static class MemoryValues {
+ long max;
+ long min;
+
+ public MemoryValues(long min, long max) {
+ this.min = min * 1024 * 1024;
+ this.max = max * 1024 * 1024;
+ }
+
+ public long getMax() {
+ return max;
+ }
+
+ public long getMin() {
+ return min;
+ }
+ }
+
+ static {
+ _xenServer610GuestOsMemoryMap.put("CentOS 4.5 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 4.6 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 4.7 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 4.8 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 5.0 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 5.0 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 5.1 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 5.1 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 5.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 5.2 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 5.3 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 5.3 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 5.4 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 5.4 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 5.5 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 5.5 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 5.6 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 5.6 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 5.7 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 5.7 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 6.0 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 6.0 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 6.1 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 6.1 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 6.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("CentOS 6.2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer610GuestOsMemoryMap.put("Debian GNU/Linux 6(32-bit)", new MemoryValues(128l, 32*1024l));
+ _xenServer610GuestOsMemoryMap.put("Debian GNU/Linux 6(64-bit)", new MemoryValues(128l, 32*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 64*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Oracle Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.5 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.6 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.7 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 4.8 (32-bit)", new MemoryValues(256l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.0 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.1 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.2 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.3 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.4 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.5 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.6 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 5.7 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.0 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (32-bit)", new MemoryValues(512l, 8*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP3 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP4 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer610GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(1024l, 4*1024l));
+ _xenServer610GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(2*1024l, 128*1024l));
+ _xenServer610GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer610GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer610GuestOsMemoryMap.put("Windows Server 2003 (32-bit)", new MemoryValues(256l, 64*1024l)); //?
+ _xenServer610GuestOsMemoryMap.put("Windows Server 2003 (64-bit)", new MemoryValues(256l, 128*1024l)); //?
+ _xenServer610GuestOsMemoryMap.put("Windows Server 2003 PAE (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer610GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer610GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer610GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer610GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer610GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer610GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer610GuestOsMemoryMap.put("Windows Server 2008 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer610GuestOsMemoryMap.put("Windows Server 2008 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer610GuestOsMemoryMap.put("Windows Server 2008 R2 (64-bit)", new MemoryValues(512l, 128*1024l));
+ _xenServer610GuestOsMemoryMap.put("Windows Server 2012 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer610GuestOsMemoryMap.put("Windows Server 8 (64-bit)", new MemoryValues(512l, 16*1024l));
+ _xenServer610GuestOsMemoryMap.put("Windows Vista (32-bit)", new MemoryValues(1024l, 4*1024l));
+ _xenServer610GuestOsMemoryMap.put("Windows XP SP3 (32-bit)", new MemoryValues(256l, 4*1024l));
+ _xenServer610GuestOsMemoryMap.put("Ubuntu 10.04 (32-bit)", new MemoryValues(128l, 512l));
+ _xenServer610GuestOsMemoryMap.put("Ubuntu 10.04 (64-bit)", new MemoryValues(128l, 32*1024l));
+ _xenServer610GuestOsMemoryMap.put("Ubuntu 10.10 (32-bit)", new MemoryValues(512l, 16*1024l));//?
+ _xenServer610GuestOsMemoryMap.put("Ubuntu 10.10 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ _xenServer610GuestOsMemoryMap.put("Ubuntu 12.04 (32-bit)", new MemoryValues(128l, 32*1024l));
+ _xenServer610GuestOsMemoryMap.put("Ubuntu 12.04 (64-bit)", new MemoryValues(128l, 128*1024l));
+ // _xenServer610GuestOsMemoryMap.put("Other Linux (32-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer610GuestOsMemoryMap.put("Other Linux (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer610GuestOsMemoryMap.put("Other (32-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer610GuestOsMemoryMap.put("Other (64-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer610GuestOsMemoryMap.put("Other CentOS (32-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer610GuestOsMemoryMap.put("Other CentOS (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer610GuestOsMemoryMap.put("Other Ubuntu (32-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer610GuestOsMemoryMap.put("Other Ubuntu (64-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer610GuestOsMemoryMap.put("Other SUSE Linux(32-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer610GuestOsMemoryMap.put("Other SUSE Linux(64-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer610GuestOsMemoryMap.put("Other PV (32-bit)", new MemoryValues(512l, 16*1024l));
+ // _xenServer610GuestOsMemoryMap.put("Other PV (64-bit)", new MemoryValues(512l, 16*1024l));
+ }
+
+
public static String getXcpGuestOsType(String stdType) {
String guestOS = _xcp100GuestOsMap.get(stdType);
if (guestOS == null) {
@@ -813,6 +1488,36 @@ public class CitrixHelper {
}
return guestOS;
}
+
+ public static long getXenServer56FP1StaticMax(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = _xenServer56FP1GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ /*if ( !bootFromCD ) {
+ s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 FP1 guestOS type, start it as HVM guest");
+ guestOS = "Other install media";
+ } else {
+ String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
+ s_logger.warn(msg);
+ }*/
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMax();
+ }
+
+ public static long getXenServer56FP1StaticMin(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = _xenServer56FP1GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ /*if ( !bootFromCD ) {
+ s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 FP1 guestOS type, start it as HVM guest");
+ guestOS = "Other install media";
+ } else {
+ String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
+ s_logger.warn(msg);
+ }*/
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMin();
+ }
public static String getXenServer56SP2GuestOsType(String stdType, boolean bootFromCD) {
String guestOS = _xenServer56FP2GuestOsMap.get(stdType);
@@ -827,16 +1532,45 @@ public class CitrixHelper {
}
return guestOS;
}
-
-
+
+ public static long getXenServer56SP2StaticMax(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = _xenServer56SP2GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ /*if ( !bootFromCD ) {
+ s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 FP1 guestOS type, start it as HVM guest");
+ guestOS = "Other install media";
+ } else {
+ String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
+ s_logger.warn(msg);
+ }*/
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMax();
+ }
+
+ public static long getXenServer56SP2StaticMin(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = _xenServer56SP2GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ /*if ( !bootFromCD ) {
+ s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 FP1 guestOS type, start it as HVM guest");
+ guestOS = "Other install media";
+ } else {
+ String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
+ s_logger.warn(msg);
+ }*/
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMin();
+ }
+
public static String getXenServer600GuestOsType(String stdType, boolean bootFromCD) {
- String guestOS = _xenServer600GuestOsMap.get(stdType);
+ String guestOS = _xenServer600GuestOsMap.get(stdType);
if (guestOS == null) {
- if ( !bootFromCD ) {
- s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 6.0 guestOS type, start it as HVM guest");
+ if (!bootFromCD) {
+ s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 6.0.2 guestOS type, start it as HVM guest");
guestOS = "Other install media";
} else {
- String msg = "XenServer 6.0 DOES NOT support Guest OS type " + stdType;
+ String msg = "XenServer 6.0.2 DOES NOT support Guest OS type " + stdType;
s_logger.warn(msg);
}
@@ -844,6 +1578,36 @@ public class CitrixHelper {
return guestOS;
}
+ public static long getXenServer600StaticMax(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = _xenServer600GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ /*if ( !bootFromCD ) {
+ s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 FP1 guestOS type, start it as HVM guest");
+ guestOS = "Other install media";
+ } else {
+ String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
+ s_logger.warn(msg);
+ }*/
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMax();
+ }
+
+ public static long getXenServer600StaticMin(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = _xenServer600GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ /*if ( !bootFromCD ) {
+ s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 FP1 guestOS type, start it as HVM guest");
+ guestOS = "Other install media";
+ } else {
+ String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
+ s_logger.warn(msg);
+ }*/
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMin();
+ }
+
public static String getXenServer602GuestOsType(String stdType, boolean bootFromCD) {
String guestOS = _xenServer602GuestOsMap.get(stdType);
if (guestOS == null) {
@@ -859,6 +1623,36 @@ public class CitrixHelper {
return guestOS;
}
+ public static long getXenServer602StaticMax(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = _xenServer602GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ /*if ( !bootFromCD ) {
+ s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 FP1 guestOS type, start it as HVM guest");
+ guestOS = "Other install media";
+ } else {
+ String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
+ s_logger.warn(msg);
+ }*/
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMax();
+ }
+
+ public static long getXenServer602StaticMin(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = _xenServer602GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ /*if ( !bootFromCD ) {
+ s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 FP1 guestOS type, start it as HVM guest");
+ guestOS = "Other install media";
+ } else {
+ String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
+ s_logger.warn(msg);
+ }*/
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMin();
+ }
+
public static String getXenServer610GuestOsType(String stdType, boolean bootFromCD) {
String guestOS = _xenServer610GuestOsMap.get(stdType);
if (guestOS == null) {
@@ -872,4 +1666,34 @@ public class CitrixHelper {
}
return guestOS;
}
+
+ public static long getXenServer610StaticMax(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = _xenServer610GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ /*if ( !bootFromCD ) {
+ s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 FP1 guestOS type, start it as HVM guest");
+ guestOS = "Other install media";
+ } else {
+ String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
+ s_logger.warn(msg);
+ }*/
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMax();
+ }
+
+ public static long getXenServer610StaticMin(String stdType, boolean bootFromCD) {
+ MemoryValues recommendedMaxMinMemory = _xenServer610GuestOsMemoryMap.get(stdType);
+ if (recommendedMaxMinMemory == null) {
+ /*if ( !bootFromCD ) {
+ s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 FP1 guestOS type, start it as HVM guest");
+ guestOS = "Other install media";
+ } else {
+ String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
+ s_logger.warn(msg);
+ }*/
+ return 0l;
+ }
+ return recommendedMaxMinMemory.getMin();
+ }
}
[28/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-3187: cluster.(cpu/memory).allocated.capacity.disablethreshold in not considering overcommit factor. cluster is getting disable based on actual use
Signed-off-by: Abhinandan Prateek <ap...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c0591531
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c0591531
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c0591531
Branch: refs/heads/vmsync
Commit: c0591531d8f29505f2f53c008b6d3fb9d8399b94
Parents: 9385cf0
Author: Harikrishna Patnala <ha...@citrix.com>
Authored: Tue Jun 25 17:34:24 2013 +0530
Committer: Abhinandan Prateek <ap...@apache.org>
Committed: Wed Jun 26 16:02:21 2013 +0530
----------------------------------------------------------------------
.../com/cloud/capacity/dao/CapacityDaoImpl.java | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c0591531/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java b/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
index d14ad87..cecc145 100755
--- a/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
+++ b/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
@@ -119,7 +119,7 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
/* In the below query"LIST_CLUSTERS_CROSSING_THRESHOLD" the threshold value is getting from the cluster_details table if not present then it gets from the global configuration
*
* CASE statement works like
- * if (cluster_details table has thershold value)
+ * if (cluster_details table has threshold value)
* then
* if (value from the cluster_details table is not null)
* then
@@ -132,15 +132,15 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
* */
private static final String LIST_CLUSTERS_CROSSING_THRESHOLD = "SELECT clusterList.cluster_id " +
"FROM ( SELECT cluster.cluster_id cluster_id, ( (sum(cluster.used) + sum(cluster.reserved) + ?)/sum(cluster.total) ) ratio, cluster.configValue value " +
- "FROM ( SELECT capacity.cluster_id cluster_id, capacity.used_capacity used, capacity.reserved_capacity reserved, capacity.total_capacity total, " +
+ "FROM ( SELECT capacity.cluster_id cluster_id, capacity.used_capacity used, capacity.reserved_capacity reserved, capacity.total_capacity * overcommit.value total, " +
"CASE (SELECT count(*) FROM `cloud`.`cluster_details` details WHERE details.cluster_id = capacity.cluster_id AND details.name = ? ) " +
"WHEN 1 THEN ( CASE WHEN (SELECT details.value FROM `cloud`.`cluster_details` details WHERE details.cluster_id = capacity.cluster_id AND details.name = ?) is NULL " +
"THEN (SELECT config.value FROM `cloud`.`configuration` config WHERE config.name = ?)" +
"ELSE (SELECT details.value FROM `cloud`.`cluster_details` details WHERE details.cluster_id = capacity.cluster_id AND details.name = ? ) END )" +
"ELSE ( SELECT config.value FROM `cloud`.`configuration` config WHERE config.name = ?) " +
"END configValue " +
- "FROM `cloud`.`op_host_capacity` capacity " +
- "WHERE capacity.data_center_id = ? AND capacity.capacity_type = ? AND capacity.total_capacity > 0) cluster " +
+ "FROM `cloud`.`op_host_capacity` capacity INNER JOIN `cloud`.`cluster_details` overcommit ON overcommit.cluster_id = capacity.cluster_id " +
+ "WHERE capacity.data_center_id = ? AND capacity.capacity_type = ? AND capacity.total_capacity > 0 AND overcommit.name = ?) cluster " +
"GROUP BY cluster.cluster_id) clusterList " +
"WHERE clusterList.ratio > clusterList.value; ";
@@ -180,14 +180,19 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
// we need to check with disabled thresholds of each cluster if not defined at cluster consider the global value
try {
pstmt = txn.prepareAutoCloseStatement(sql.toString());
- pstmt.setLong(1,compute_requested);
+ pstmt.setLong(1, compute_requested);
pstmt.setString(2, configName);
pstmt.setString(3, configName);
pstmt.setString(4, configName);
pstmt.setString(5, configName);
pstmt.setString(6, configName);
- pstmt.setLong(7,zoneId);
- pstmt.setShort(8,capacityType);
+ pstmt.setLong(7, zoneId);
+ pstmt.setShort(8, capacityType);
+ if (capacityType == 0) {
+ pstmt.setString(9, "memoryOvercommitRatio");
+ } else if(capacityType == 1) {
+ pstmt.setString(9, "cpuOvercommitRatio");
+ }
ResultSet rs = pstmt.executeQuery();
while (rs.next()) {
[19/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-3199 apply acl item to private gateway when added to acl list
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/82958f0d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/82958f0d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/82958f0d
Branch: refs/heads/vmsync
Commit: 82958f0d58304e87d8ddf7613337737f21367b96
Parents: 94254e3
Author: Jayapal <ja...@apache.org>
Authored: Wed Jun 26 12:27:59 2013 +0530
Committer: Jayapal <ja...@apache.org>
Committed: Wed Jun 26 14:31:56 2013 +0530
----------------------------------------------------------------------
.../cloud/network/vpc/NetworkACLManagerImpl.java | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/82958f0d/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java b/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
index 4881b73..eb18eb7 100644
--- a/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
+++ b/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
@@ -88,6 +88,8 @@ public class NetworkACLManagerImpl extends ManagerBase implements NetworkACLMana
@Override
public boolean applyNetworkACL(long aclId) throws ResourceUnavailableException {
boolean handled = true;
+ boolean aclApplyStatus = true;
+
List<NetworkACLItemVO> rules = _networkACLItemDao.listByACL(aclId);
//Find all networks using this ACL and apply the ACL
List<NetworkVO> networks = _networkDao.listByAclId(aclId);
@@ -97,7 +99,18 @@ public class NetworkACLManagerImpl extends ManagerBase implements NetworkACLMana
break;
}
}
- if(handled){
+
+ List<VpcGatewayVO> vpcGateways = _vpcGatewayDao.listByAclIdAndType(aclId, VpcGateway.Type.Private);
+ for (VpcGatewayVO vpcGateway : vpcGateways) {
+ PrivateGateway privateGateway = _vpcMgr.getVpcPrivateGateway(vpcGateway.getId());
+ if (!applyACLToPrivateGw(privateGateway)) {
+ aclApplyStatus = false;
+ s_logger.debug("failed to apply network acl item on private gateway " + privateGateway.getId() + "acl id " + aclId);
+ break;
+ }
+ }
+
+ if(handled && aclApplyStatus){
for (NetworkACLItem rule : rules) {
if (rule.getState() == NetworkACLItem.State.Revoke) {
removeRule(rule);
@@ -108,7 +121,7 @@ public class NetworkACLManagerImpl extends ManagerBase implements NetworkACLMana
}
}
}
- return handled;
+ return handled && aclApplyStatus;
}
@Override
[40/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
Add check for some cli programs
Add check for faketime and vhd-util for xen export.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/29c39e8f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/29c39e8f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/29c39e8f
Branch: refs/heads/vmsync
Commit: 29c39e8f4eae8b6eca61669f4b85429a236a78b0
Parents: de44a77
Author: Hiroaki KAWAI <ka...@stratosphere.co.jp>
Authored: Thu Jun 27 13:04:12 2013 +0900
Committer: Hiroaki KAWAI <ka...@stratosphere.co.jp>
Committed: Thu Jun 27 13:04:12 2013 +0900
----------------------------------------------------------------------
tools/appliance/build.sh | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/29c39e8f/tools/appliance/build.sh
----------------------------------------------------------------------
diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh
index b546c3f..f9a5b59 100644
--- a/tools/appliance/build.sh
+++ b/tools/appliance/build.sh
@@ -63,17 +63,24 @@ vboxmanage modifyhd $hdd_uuid --compact
rm -fr dist *.ova *.vhd *.vdi *.qcow* *.bz2
mkdir dist
+# Export for Xen
+which faketime >/dev/null 2>&1 && which vhd-util >/dev/null 2>&1
+if [ $? == 0 ]; then
+ set -e
+ vboxmanage internalcommands converttoraw -format vdi "$hdd_path" img.raw
+ faketime '2010-01-01' vhd-util convert -s 0 -t 1 -i img.raw -o stagefixed.vhd
+ faketime '2010-01-01' vhd-util convert -s 1 -t 2 -i stagefixed.vhd -o $appliance-$build_date-$branch-xen.vhd
+ rm *.bak
+ bzip2 $appliance-$build_date-$branch-xen.vhd
+ echo "$appliance exported for Xen: dist/$appliance-$build_date-$branch-xen.vhd.bz2"
+else
+ echo "** Skipping $appliance export for Xen: faketime or vhd-util command is missing. **"
+ echo "** faketime source code is available from https://github.com/wolfcw/libfaketime **"
+fi
+
# Exit shell if exporting fails for any format
set -e
-# Export for Xen
-vboxmanage internalcommands converttoraw -format vdi "$hdd_path" img.raw
-faketime '2010-01-01' vhd-util convert -s 0 -t 1 -i img.raw -o stagefixed.vhd
-faketime '2010-01-01' vhd-util convert -s 1 -t 2 -i stagefixed.vhd -o $appliance-$build_date-$branch-xen.vhd
-rm *.bak
-bzip2 $appliance-$build_date-$branch-xen.vhd
-echo "$appliance exported for Xen: dist/$appliance-$build_date-$branch-xen.vhd.bz2"
-
# Export for KVM
vboxmanage internalcommands converttoraw -format vdi "$hdd_path" raw.img
qemu-img convert -f raw -c -O qcow2 raw.img $appliance-$build_date-$branch-kvm.qcow2
[41/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-2254: Tests for Affinity and Anti Affinity rules
TestCreateAffinityGroup
TestListAffinityGroups
TestDeleteAffinityGroups
TestUpdateVMAffinityGroups
TestDeployVMAffinityGroups
TestAffinityGroupsAdminUser
Signed-off-by: Prasanna Santhanam <ts...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/3c0c6cb0
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3c0c6cb0
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3c0c6cb0
Branch: refs/heads/vmsync
Commit: 3c0c6cb0b3c21d08d88763b229c17f4b41c74145
Parents: 29c39e8
Author: Girish Shilamkar <gi...@clogeny.com>
Authored: Tue May 21 13:23:10 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Thu Jun 27 09:51:29 2013 +0530
----------------------------------------------------------------------
.../component/test_affinity_groups.py | 1547 ++++++++++++++++++
tools/marvin/marvin/integration/lib/base.py | 38 +-
2 files changed, 1572 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3c0c6cb0/test/integration/component/test_affinity_groups.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_affinity_groups.py b/test/integration/component/test_affinity_groups.py
new file mode 100644
index 0000000..79e35e0
--- /dev/null
+++ b/test/integration/component/test_affinity_groups.py
@@ -0,0 +1,1547 @@
+#!/usr/bin/env python
+# 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.
+from marvin.cloudstackTestCase import *
+from marvin.cloudstackAPI import *
+from marvin.integration.lib.utils import *
+from marvin.integration.lib.base import *
+from marvin.integration.lib.common import *
+from marvin import remoteSSHClient
+from nose.plugins.attrib import attr
+
+class Services:
+ """Test Account Services
+ """
+
+ def __init__(self):
+ self.services = {
+ "domain": {
+ "name": "Domain",
+ },
+ "account": {
+ "email": "newtest@test.com",
+ "firstname": "Test",
+ "lastname": "User",
+ "username": "test",
+ # Random characters are appended for unique
+ # username
+ "password": "password",
+ },
+ "service_offering": {
+ "name": "Tiny Instance",
+ "displaytext": "Tiny Instance",
+ "cpunumber": 1,
+ "cpuspeed": 100,
+ # in MHz
+ "memory": 64,
+ # In MBs
+ },
+ "ostype": 'CentOS 5.3 (64-bit)',
+ "host_anti_affinity_0": {
+ "name": "TestAffGrp_HA_0",
+ "type": "host anti-affinity",
+ },
+ "host_anti_affinity_1": {
+ "name": "TestAffGrp_HA_1",
+ "type": "host anti-affinity",
+ },
+ "virtual_machine" : {
+ "hypervisor" : "KVM",
+ },
+ "new_domain": {
+ "name": "New Domain",
+ },
+ "new_account": {
+ "email": "domain@test.com",
+ "firstname": "Domain",
+ "lastname": "Admin",
+ "username": "do_admin",
+ # Random characters are appended for unique
+ # username
+ "password": "password",
+ },
+ "new_account1": {
+ "email": "user@test.com",
+ "firstname": "User",
+ "lastname": "User",
+ "username": "user",
+ # Random characters are appended for unique
+ # username
+ "password": "password",
+ },
+
+ }
+
+class TestCreateAffinityGroup(cloudstackTestCase):
+ """
+ Test various scenarios for Create Affinity Group API
+ """
+
+ @classmethod
+ def setUpClass(cls):
+
+ cls.api_client = super(TestCreateAffinityGroup, cls).getClsTestClient().getApiClient()
+ cls.services = Services().services
+ # Get Zone, Domain and templates
+ cls.domain = get_domain(cls.api_client, cls.services)
+ cls.zone = get_zone(cls.api_client, cls.services)
+ cls.template = get_template(
+ cls.api_client,
+ cls.zone.id,
+ cls.services["ostype"]
+ )
+ cls.services["virtual_machine"]["zoneid"] = cls.zone.id
+
+ cls.services["template"] = cls.template.id
+ cls.services["zoneid"] = cls.zone.id
+
+ cls.account = Account.create(
+ cls.api_client,
+ cls.services["account"],
+ domainid=cls.domain.id
+ )
+
+ cls.services["account"] = cls.account.name
+
+ cls.service_offering = ServiceOffering.create(
+ cls.api_client,
+ cls.services["service_offering"]
+ )
+
+ cls._cleanup = [
+ cls.service_offering,
+ cls.account,
+ ]
+ return
+
+ def setUp(self):
+ self.apiclient = self.testClient.getApiClient()
+ self.dbclient = self.testClient.getDbConnection()
+ self.cleanup = []
+
+ def tearDown(self):
+ try:
+ # Clean up, terminate the created instance, volumes and snapshots
+ cleanup_resources(self.apiclient, self.cleanup)
+ except Exception as e:
+ raise Exception("Warning: Exception during cleanup : %s" % e)
+ return
+
+ @classmethod
+ def tearDownClass(cls):
+ try:
+ cls.api_client = super(TestCreateAffinityGroup, cls).getClsTestClient().getApiClient()
+ #Clean up, terminate the created templates
+ cleanup_resources(cls.api_client, cls._cleanup)
+ except Exception as e:
+ raise Exception("Warning: Exception during cleanup : %s" % e)
+
+ def create_aff_grp(self, api_client=None, aff_grp=None,
+ acc=None, domainid=None):
+
+ if api_client == None:
+ api_client = self.api_client
+ if aff_grp == None:
+ self.services["host_anti_affinity_0"]
+ if acc == None:
+ acc = self.account.name
+ if domainid == None:
+ domainid = self.domain.id
+
+ try:
+ self.aff_grp = AffinityGroup.create(api_client, aff_grp, acc, domainid)
+ except Exception as e:
+ raise Exception("Error: Creation of Affinity Group failed : %s" %e)
+
+ @attr(tags=["simulator", "basic", "advanced"])
+ def test_01_admin_create_aff_grp(self):
+
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+ self.debug("Created Affinity Group: %s" %self.aff_grp.name)
+
+ list_aff_grps = AffinityGroup.list(self.api_client)
+ AffinityGroup.delete(self.api_client, list_aff_grps[0].name)
+ self.debug("Deleted Affinity Group: %s" %list_aff_grps[0].name)
+
+ @attr(tags=["simulator", "basic", "advanced"])
+ def test_02_doadmin_create_aff_grp(self):
+
+ self.new_domain = Domain.create(self.api_client, self.services["new_domain"])
+ self.do_admin = Account.create(self.api_client, self.services["new_account"],
+ admin=True, domainid=self.new_domain.id)
+ self.cleanup.append(self.do_admin)
+ self.cleanup.append(self.new_domain)
+
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"],
+ acc=self.do_admin.name, domainid=self.new_domain.id)
+
+ AffinityGroup.delete(self.api_client, name=self.aff_grp.name,
+ account=self.do_admin.name, domainid=self.new_domain.id)
+ self.debug("Deleted Affinity Group: %s" %self.aff_grp.name)
+
+
+ @attr(tags=["simulator", "basic", "advanced"])
+ def test_03_user_create_aff_grp(self):
+
+ self.user = Account.create(self.api_client, self.services["new_account"],
+ domainid=self.domain.id)
+
+ self.cleanup.append(self.user)
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"],
+ acc=self.user.name, domainid=self.domain.id)
+
+ AffinityGroup.delete(self.api_client, name=self.aff_grp.name,
+ account=self.user.name, domainid=self.domain.id)
+ self.debug("Deleted Affinity Group: %s" %self.aff_grp.name)
+
+
+ @attr(tags=["simulator", "basic", "advanced"])
+ def test_04_user_create_aff_grp_existing_name(self):
+
+ self.user = Account.create(self.api_client, self.services["new_account"],
+ domainid=self.domain.id)
+
+ self.cleanup.append(self.user)
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"],
+ acc=self.user.name, domainid=self.domain.id)
+ with self.assertRaises(Exception):
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"],
+ acc=self.user.name, domainid=self.domain.id)
+
+ AffinityGroup.delete(self.api_client, name=self.aff_grp.name,
+ account=self.user.name, domainid=self.domain.id)
+ self.debug("Deleted Affinity Group: %s" %self.aff_grp.name)
+
+ @attr(tags=["simulator", "basic", "advanced"])
+ def test_05_create_aff_grp_same_name_diff_acc(self):
+
+ self.user = Account.create(self.api_client, self.services["new_account"],
+ domainid=self.domain.id)
+
+ self.cleanup.append(self.user)
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"],
+ acc=self.user.name, domainid=self.domain.id)
+
+ try:
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+ except Exception:
+ self.debug("Error: Creating affinity group with same name from different account failed.")
+
+ AffinityGroup.delete(self.api_client, name=self.aff_grp.name,
+ account=self.user.name, domainid=self.domain.id)
+ self.debug("Deleted Affinity Group: %s" %self.aff_grp.name)
+
+ @attr(tags=["simulator", "basic", "advanced"])
+ def test_06_create_aff_grp_nonexisting_type(self):
+
+ self.non_existing_aff_grp = {
+ "name": "TestAffGrp_HA",
+ "type": "Incorrect type",
+ }
+ with self.assertRaises(Exception):
+ self.create_aff_grp(aff_grp=self.non_existing_aff_grp)
+
+class TestListAffinityGroups(cloudstackTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+
+ cls.api_client = super(TestListAffinityGroups, cls).getClsTestClient().getApiClient()
+ cls.services = Services().services
+ # Get Zone, Domain and templates
+ cls.domain = get_domain(cls.api_client, cls.services)
+ cls.zone = get_zone(cls.api_client, cls.services)
+ cls.template = get_template(
+ cls.api_client,
+ cls.zone.id,
+ cls.services["ostype"]
+ )
+ cls.services["virtual_machine"]["zoneid"] = cls.zone.id
+
+ cls.services["template"] = cls.template.id
+ cls.services["zoneid"] = cls.zone.id
+
+ cls.account = Account.create(
+ cls.api_client,
+ cls.services["account"],
+ domainid=cls.domain.id
+ )
+
+ cls.services["account"] = cls.account.name
+
+ cls.service_offering = ServiceOffering.create(
+ cls.api_client,
+ cls.services["service_offering"]
+ )
+
+ cls.__cleanup = [
+ cls.service_offering,
+ cls.account,
+ ]
+
+ # Create multiple Affinity Groups
+ return
+
+ def setUp(self):
+ self.apiclient = self.testClient.getApiClient()
+ self.dbclient = self.testClient.getDbConnection()
+ self.aff_grp = []
+ self.cleanup = []
+
+ def tearDown(self):
+ try:
+ cls.api_client = super(TestListAffinityGroups, cls).getClsTestClient().getApiClient()
+ #Clean up, terminate the created templates
+ cleanup_resources(cls.api_client, cls.cleanup)
+ except Exception as e:
+ raise Exception("Warning: Exception during cleanup : %s" % e)
+
+ @classmethod
+ def tearDownClass(cls):
+
+ try:
+ cls.api_client = super(TestListAffinityGroups, cls).getClsTestClient().getApiClient()
+ #Clean up, terminate the created templates
+ cleanup_resources(cls.api_client, cls.__cleanup)
+ except Exception as e:
+ raise Exception("Warning: Exception during cleanup : %s" % e)
+
+ def create_aff_grp(self, api_client=None, aff_grp=None,
+ acc=None, domainid=None):
+
+ if api_client == None:
+ api_client = self.api_client
+ if aff_grp == None:
+ self.services["host_anti_affinity_0"]
+ #if acc == None:
+ # acc = self.account.name
+ #if domainid == None:
+ # domainid = self.domain.id
+
+ try:
+ self.aff_grp.append(AffinityGroup.create(api_client,
+ aff_grp, acc, domainid))
+ except Exception as e:
+ raise Exception("Error: Creation of Affinity Group failed : %s" %e)
+
+ def create_vm_in_aff_grps(self, ag_list):
+ #try:
+ self.debug('Creating VM in AffinityGroup=%s' % ag_list[0])
+ vm = VirtualMachine.create(
+ self.api_client,
+ self.services["virtual_machine"],
+ templateid=self.template.id,
+ #accountid=self.account.name,
+ #domainid=self.account.domainid,
+ serviceofferingid=self.service_offering.id,
+ affinitygroupnames=ag_list
+ )
+ self.debug('Created VM=%s in Affinity Group=%s' %
+ (vm.id, ag_list[0]))
+ #except Exception:
+ #self.debug('Unable to create VM in a Affinity Group=%s'
+ # % ag_list[0])
+
+ list_vm = list_virtual_machines(self.api_client, id=vm.id)
+
+ self.assertEqual(isinstance(list_vm, list), True,
+ "Check list response returns a valid list")
+ self.assertNotEqual(len(list_vm),0,
+ "Check VM available in List Virtual Machines")
+
+ vm_response = list_vm[0]
+ self.assertEqual(vm_response.state, 'Running',
+ msg="VM is not in Running state")
+
+ return vm, vm_response.hostid
+
+ def test_01_list_aff_grps_for_vm(self):
+ """
+ List affinity group for a vm
+ """
+
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+ list_aff_grps = AffinityGroup.list(self.api_client)
+
+ vm, hostid = self.create_vm_in_aff_grps([self.aff_grp[0].name])
+ list_aff_grps = AffinityGroup.list(self.api_client,
+ virtualmachineid=vm.id)
+
+ self.assertEqual(list_aff_grps[0].name, self.aff_grp[0].name,
+ "Listing Affinity Group by VM id failed")
+
+ vm.delete(self.api_client)
+ #Wait for expunge interval to cleanup VM
+ wait_for_cleanup(self.apiclient, ["expunge.delay", "expunge.interval"])
+
+ AffinityGroup.delete(self.api_client, self.aff_grp[0].name)
+
+ def test_02_list_multiple_aff_grps_for_vm(self):
+ """
+ List multiple affinity groups associated with a vm
+ """
+
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_1"])
+
+ aff_grps_names = [self.aff_grp[0].name, self.aff_grp[1].name]
+ vm, hostid = self.create_vm_in_aff_grps(aff_grps_names)
+ list_aff_grps = AffinityGroup.list(self.api_client,
+ virtualmachineid=vm.id)
+
+ list_aff_grps_names = [list_aff_grps[0].name, list_aff_grps[1].name]
+
+ aff_grps_names.sort()
+ list_aff_grps_names.sort()
+ self.assertEqual(aff_grps_names, list_aff_grps_names,
+ "One of the Affinity Groups is missing %s"
+ %list_aff_grps_names)
+
+ vm.delete(self.api_client)
+ #Wait for expunge interval to cleanup VM
+ wait_for_cleanup(self.apiclient, ["expunge.delay", "expunge.interval"])
+
+ for i in aff_grps_names:
+ AffinityGroup.delete(self.api_client, i)
+
+ def test_03_list_aff_grps_by_id(self):
+ """
+ List affinity groups by id
+ """
+
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+ print self.aff_grp[0].__dict__
+ list_aff_grps = AffinityGroup.list(self.api_client)
+ list_aff_grps = AffinityGroup.list(self.api_client, id=list_aff_grps[0].id)
+ self.assertEqual(list_aff_grps[0].name, self.aff_grp[0].name,
+ "Listing Affinity Group by VM id failed")
+
+ AffinityGroup.delete(self.api_client, self.aff_grp[0].name)
+
+ def test_04_list_aff_grps_by_name(self):
+ """
+ List Affinity Groups by name
+ """
+
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+ list_aff_grps = AffinityGroup.list(self.api_client,
+ name=self.aff_grp[0].name)
+ self.assertEqual(list_aff_grps[0].name, self.aff_grp[0].name,
+ "Listing Affinity Group by name failed")
+
+ AffinityGroup.delete(self.api_client, self.aff_grp[0].name)
+
+ def test_05_list_aff_grps_by_non_existing_id(self):
+ """
+ List Affinity Groups by non-existing id
+ """
+
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+ list_aff_grps = AffinityGroup.list(self.api_client,
+ id=1234)
+ self.assertEqual(list_aff_grps, None,
+ "Listing Affinity Group by non-existing id succeeded.")
+
+ AffinityGroup.delete(self.api_client, self.aff_grp[0].name)
+
+ def test_06_list_aff_grps_by_non_existing_name(self):
+ """
+ List Affinity Groups by non-existing name
+ """
+
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+ list_aff_grps = AffinityGroup.list(self.api_client,
+ name="NonexistingName")
+ self.assertEqual(list_aff_grps, None,
+ "Listing Affinity Group by non-existing name succeeded.")
+
+ AffinityGroup.delete(self.api_client, self.aff_grp[0].name)
+
+class TestDeleteAffinityGroups(cloudstackTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+
+ cls.api_client = super(TestDeleteAffinityGroups, cls).getClsTestClient().getApiClient()
+ cls.services = Services().services
+ # Get Zone, Domain and templates
+ cls.domain = get_domain(cls.api_client, cls.services)
+ cls.zone = get_zone(cls.api_client, cls.services)
+ cls.template = get_template(
+ cls.api_client,
+ cls.zone.id,
+ cls.services["ostype"]
+ )
+ cls.services["virtual_machine"]["zoneid"] = cls.zone.id
+
+ cls.services["template"] = cls.template.id
+ cls.services["zoneid"] = cls.zone.id
+
+ cls.account = Account.create(
+ cls.api_client,
+ cls.services["account"],
+ domainid=cls.domain.id
+ )
+
+ cls.services["account"] = cls.account.name
+
+ cls.service_offering = ServiceOffering.create(
+ cls.api_client,
+ cls.services["service_offering"]
+ )
+
+ cls.__cleanup = [
+ cls.service_offering,
+ cls.account,
+ ]
+
+ # Create multiple Affinity Groups
+ return
+
+ def setUp(self):
+ self.apiclient = self.testClient.getApiClient()
+ self.dbclient = self.testClient.getDbConnection()
+ self.aff_grp = []
+ self.cleanup = []
+
+ def tearDown(self):
+ try:
+ self.api_client = super(TestDeleteAffinityGroups,self).getClsTestClient().getApiClient()
+ #Clean up, terminate the created templates
+ cleanup_resources(self.api_client, self.cleanup)
+ except Exception as e:
+ raise Exception("Warning: Exception during cleanup : %s" % e)
+
+ @classmethod
+ def tearDownClass(cls):
+
+ try:
+ cls.api_client = super(TestDeleteAffinityGroups, cls).getClsTestClient().getApiClient()
+ #Clean up, terminate the created templates
+ cleanup_resources(cls.api_client, cls.__cleanup)
+ except Exception as e:
+ raise Exception("Warning: Exception during cleanup : %s" % e)
+
+ def create_aff_grp(self, api_client=None, aff_grp=None,
+ acc=None, domainid=None):
+
+ if api_client == None:
+ api_client = self.api_client
+ if aff_grp == None:
+ self.services["host_anti_affinity_0"]
+ #if acc == None:
+ # acc = self.account.name
+ #if domainid == None:
+ # domainid = self.domain.id
+
+ try:
+ self.aff_grp.append(AffinityGroup.create(api_client,
+ aff_grp, acc, domainid))
+ except Exception as e:
+ raise Exception("Error: Creation of Affinity Group failed : %s" %e)
+
+ def create_vm_in_aff_grps(self, ag_list):
+ #try:
+ self.debug('Creating VM in AffinityGroup=%s' % ag_list[0])
+ vm = VirtualMachine.create(
+ self.api_client,
+ self.services["virtual_machine"],
+ templateid=self.template.id,
+ #accountid=self.account.name,
+ #domainid=self.account.domainid,
+ serviceofferingid=self.service_offering.id,
+ affinitygroupnames=ag_list
+ )
+ self.debug('Created VM=%s in Affinity Group=%s' %
+ (vm.id, ag_list[0]))
+ #except Exception:
+ #self.debug('Unable to create VM in a Affinity Group=%s'
+ # % ag_list[0])
+
+ list_vm = list_virtual_machines(self.api_client, id=vm.id)
+
+ self.assertEqual(isinstance(list_vm, list), True,
+ "Check list response returns a valid list")
+ self.assertNotEqual(len(list_vm),0,
+ "Check VM available in Delete Virtual Machines")
+
+ vm_response = list_vm[0]
+ self.assertEqual(vm_response.state, 'Running',
+ msg="VM is not in Running state")
+
+ return vm, vm_response.hostid
+
+ def test_01_delete_aff_grp_by_id(self):
+ """
+ Delete Afifnity Group by id.
+ """
+
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_1"])
+
+ list_aff_grps = AffinityGroup.list(self.api_client,
+ name=self.aff_grp[0].name)
+
+ AffinityGroup.delete(self.api_client, id=list_aff_grps[0].id)
+
+ AffinityGroup.delete(self.api_client, name=self.aff_grp[1].name)
+
+ def test_02_delete_aff_grp_for_acc(self):
+ """
+ Delete Afifnity Group for an account.
+ """
+
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"],
+ acc=self.account.name, domainid=self.domain.id)
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_1"],
+ acc=self.account.name, domainid=self.domain.id)
+
+ AffinityGroup.delete(self.api_client, account=self.account.name,
+ domainid=self.domain.id, name=self.aff_grp[0].name)
+
+ with self.assertRaises(Exception):
+ vm, hostid = self.create_vm_in_aff_grps([self.aff_grp[0].name])
+
+ AffinityGroup.delete(self.api_client, account=self.account.name,
+ domainid=self.domain.id, name=self.aff_grp[1].name)
+
+ def test_03_delete_aff_grp_with_vms(self):
+ """
+ Delete Afifnity Group which has vms in it.
+ """
+
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"],
+ acc=self.account.name, domainid=self.domain.id)
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_1"],
+ acc=self.account.name, domainid=self.domain.id)
+
+ vm, hostid = self.create_vm_in_aff_grps([self.aff_grp[0].name,
+ self.aff_grp[1].name])
+
+ AffinityGroup.delete(self.api_client, account=self.account.name,
+ domainid=self.domain.id, name=self.aff_grp[0].name)
+
+ vm_list = list_virtual_machines(self.apiclient,
+ id=self.virtual_machine.id)
+
+
+ vm.delete(self.api_client)
+ #Wait for expunge interval to cleanup VM
+ wait_for_cleanup(self.apiclient, ["expunge.delay", "expunge.interval"])
+
+ AffinityGroup.delete(self.api_client, account=self.account.name,
+ domainid=self.domain.id, name=self.aff_grp[0].name)
+ AffinityGroup.delete(self.api_client, account=self.account.name,
+ domainid=self.domain.id, name=self.aff_grp[1].name)
+
+ def test_04_delete_aff_grp_with_vms(self):
+ """
+ Delete Affinity Group which has after updating affinity group for
+ vms in it.
+ """
+
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+
+ vm1, hostid1 = self.create_vm_in_aff_grps([self.aff_grp[0].name])
+ vm2, hostid2 = self.create_vm_in_aff_grps([self.aff_grp[0].name])
+
+ with self.assertRaises(Exception):
+ AffinityGroup.delete(self.api_client, name=self.aff_grp[0].name)
+
+ vm1.update_affinity_group(self.api_client, affinitygroupnames=[])
+
+ with self.assertRaises(Exception):
+ AffinityGroup.delete(self.api_client, name=self.aff_grp[0].name)
+
+ vm2.update_affinity_group(self.api_client, affinitygroupnames=[])
+
+ AffinityGroup.delete(self.api_client, name=self.aff_grp[0].name)
+
+ vm1.delete(self.api_client)
+ vm2.delete(self.api_client)
+ #Wait for expunge interval to cleanup VM
+ wait_for_cleanup(self.apiclient, ["expunge.delay", "expunge.interval"])
+
+ AffinityGroup.delete(self.api_client, name=self.aff_grp[1].name)
+
+ def test_05_delete_aff_grp_id(self):
+ """
+ Delete Affinity Group with id which does not belong to this user
+ """
+
+ self.user1 = Account.create(self.api_client,
+ self.services["new_account"])
+
+ self.cleanup.append(self.user1)
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"],
+ acc=self.user1.name,
+ domainid=self.domain.id)
+
+ self.user2 = Account.create(self.apiclient, self.services["new_account1"])
+ self.cleanup.append(self.user2)
+
+ userapiclient = self.testClient.createUserApiClient(
+ UserName=self.user2.name,
+ DomainName=self.user2.domain,
+ acctType=0)
+
+ self.create_aff_grp(api_client=userapiclient,
+ aff_grp=self.services["host_anti_affinity_1"])
+
+ list_aff_grps = AffinityGroup.list(self.api_client,
+ name=self.aff_grp[0].name)
+
+ # Delete Affinity group belonging to different user by id
+ with self.assertRaises(Exception):
+ AffinityGroup.delete(userapiclient, name=list_aff_grps.id)
+
+ #Cleanup
+ AffinityGroup.delete(self.api_client, name=self.aff_grp[0].name)
+ AffinityGroup.delete(userapiclient, name=self.aff_grp[1].name)
+
+ def test_06_delete_aff_grp_name(self):
+ """
+ Delete Affinity Group by name which does not belong to this user
+ """
+
+ self.user1 = Account.create(self.api_client,
+ self.services["new_account"])
+
+ self.cleanup.append(self.user1)
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"],
+ acc=self.user1.name,
+ domainid=self.domain.id)
+
+ self.user2 = Account.create(self.apiclient, self.services["new_account1"])
+ self.cleanup.append(self.user2)
+
+ userapiclient = self.testClient.createUserApiClient(
+ UserName=self.user2.name,
+ DomainName=self.user2.domain,
+ acctType=0)
+
+ self.create_aff_grp(api_client=userapiclient,
+ aff_grp=self.services["host_anti_affinity_1"])
+
+ # Delete Affinity group belonging to different user by name
+ with self.assertRaises(Exception):
+ AffinityGroup.delete(userapiclient, name=self.aff_grp[0].name)
+
+ #Cleanup
+ AffinityGroup.delete(self.api_client, name=self.aff_grp[0].name)
+ AffinityGroup.delete(userapiclient, name=self.aff_grp[1].name)
+
+class TestUpdateVMAffinityGroups(cloudstackTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+
+ cls.api_client = super(TestUpdateVMAffinityGroups, cls).getClsTestClient().getApiClient()
+ cls.services = Services().services
+ # Get Zone, Domain and templates
+ cls.domain = get_domain(cls.api_client, cls.services)
+ cls.zone = get_zone(cls.api_client, cls.services)
+ cls.template = get_template(
+ cls.api_client,
+ cls.zone.id,
+ cls.services["ostype"]
+ )
+ cls.services["virtual_machine"]["zoneid"] = cls.zone.id
+
+ cls.services["template"] = cls.template.id
+ cls.services["zoneid"] = cls.zone.id
+
+ cls.account = Account.create(
+ cls.api_client,
+ cls.services["account"],
+ domainid=cls.domain.id
+ )
+
+ cls.services["account"] = cls.account.name
+
+ cls.service_offering = ServiceOffering.create(
+ cls.api_client,
+ cls.services["service_offering"]
+ )
+
+ cls.__cleanup = [
+ cls.service_offering,
+ cls.account,
+ ]
+
+ # Create multiple Affinity Groups
+ return
+
+ def setUp(self):
+ self.apiclient = self.testClient.getApiClient()
+ self.dbclient = self.testClient.getDbConnection()
+ self.aff_grp = []
+ self.cleanup = []
+
+ def tearDown(self):
+ try:
+ self.api_client = super(TestUpdateVMAffinityGroups,self).getClsTestClient().getApiClient()
+ #Clean up, terminate the created templates
+ cleanup_resources(self.api_client, self.cleanup)
+ except Exception as e:
+ raise Exception("Warning: Exception during cleanup : %s" % e)
+
+ @classmethod
+ def tearDownClass(cls):
+
+ try:
+ cls.api_client = super(TestUpdateVMAffinityGroups, cls).getClsTestClient().getApiClient()
+ #Clean up, terminate the created templates
+ cleanup_resources(cls.api_client, cls.__cleanup)
+ except Exception as e:
+ raise Exception("Warning: Exception during cleanup : %s" % e)
+
+ def create_aff_grp(self, api_client=None, aff_grp=None,
+ acc=None, domainid=None):
+
+ if api_client == None:
+ api_client = self.api_client
+ if aff_grp == None:
+ self.services["host_anti_affinity_0"]
+ #if acc == None:
+ # acc = self.account.name
+ #if domainid == None:
+ # domainid = self.domain.id
+
+ try:
+ self.aff_grp.append(AffinityGroup.create(api_client,
+ aff_grp, acc, domainid))
+ except Exception as e:
+ raise Exception("Error: Creation of Affinity Group failed : %s" %e)
+
+ def create_vm_in_aff_grps(self, ag_list):
+ #try:
+ self.debug('Creating VM in AffinityGroup=%s' % ag_list[0])
+ vm = VirtualMachine.create(
+ self.api_client,
+ self.services["virtual_machine"],
+ templateid=self.template.id,
+ #accountid=self.account.name,
+ #domainid=self.account.domainid,
+ serviceofferingid=self.service_offering.id,
+ affinitygroupnames=ag_list
+ )
+ self.debug('Created VM=%s in Affinity Group=%s' %
+ (vm.id, ag_list[0]))
+ #except Exception:
+ #self.debug('Unable to create VM in a Affinity Group=%s'
+ # % ag_list[0])
+
+ list_vm = list_virtual_machines(self.api_client, id=vm.id)
+
+ self.assertEqual(isinstance(list_vm, list), True,
+ "Check list response returns a valid list")
+ self.assertNotEqual(len(list_vm),0,
+ "Check VM available in Delete Virtual Machines")
+
+ vm_response = list_vm[0]
+ self.assertEqual(vm_response.state, 'Running',
+ msg="VM is not in Running state")
+
+ return vm, vm_response.hostid
+
+ def test_01_update_aff_grp_by_ids(self):
+ """
+ Update the list of affinityGroups by using affinity groupids
+
+ """
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_1"])
+
+ vm1, hostid1 = self.create_vm_in_aff_grps([self.aff_grp[0].name])
+ vm2, hostid2 = self.create_vm_in_aff_grps([self.aff_grp[0].name])
+
+ vm1.stop(self.api_client)
+
+ list_aff_grps = AffinityGroup.list(self.api_client)
+
+ self.assertEqual(len(list_aff_grps), 2 , "2 affinity groups should be present")
+
+ vm1.update_affinity_group(self.api_client,
+ affinitygroupids=[list_aff_grps[0].id,
+ list_aff_grps[1].id])
+
+ list_aff_grps = AffinityGroup.list(self.api_client,
+ virtualmachineid=vm1.id)
+
+ list_aff_grps_names = [list_aff_grps[0].name, list_aff_grps[1].name]
+
+ aff_grps_names = [self.aff_grp[0].name, self.aff_grp[1].name]
+ aff_grps_names.sort()
+ list_aff_grps_names.sort()
+ self.assertEqual(aff_grps_names, list_aff_grps_names,
+ "One of the Affinity Groups is missing %s"
+ %list_aff_grps_names)
+
+ vm1.start(self.api_client)
+
+ vm_status = VirtualMachine.list(self.api_client, id=vm1.id)
+ self.assertNotEqual(vm_status[0].hostid, hostid2, "The virtual machine "
+ "started on host %s violating the host anti-affinity"
+ "rule" %vm_status[0].hostid)
+
+ vm1.delete(self.api_client)
+ vm2.delete(self.api_client)
+ #Wait for expunge interval to cleanup VM
+ wait_for_cleanup(self.apiclient, ["expunge.delay", "expunge.interval"])
+ for i in aff_grps_names:
+ AffinityGroup.delete(self.api_client, i)
+
+ def test_02_update_aff_grp_by_names(self):
+ """
+ Update the list of affinityGroups by using affinity groupnames
+
+ """
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_1"])
+ vm1, hostid1 = self.create_vm_in_aff_grps([self.aff_grp[0].name])
+ vm2, hostid2 = self.create_vm_in_aff_grps([self.aff_grp[0].name])
+
+ vm1.stop(self.api_client)
+
+ vm1.update_affinity_group(self.api_client,
+ affinitygroupnames=[self.aff_grp[0].name,
+ self.aff_grp[1].name])
+
+ list_aff_grps = AffinityGroup.list(self.api_client,
+ virtualmachineid=vm1.id)
+
+ list_aff_grps_names = [list_aff_grps[0].name, list_aff_grps[1].name]
+
+ aff_grps_names = [self.aff_grp[0].name, self.aff_grp[1].name]
+ aff_grps_names.sort()
+ list_aff_grps_names.sort()
+ self.assertEqual(aff_grps_names, list_aff_grps_names,
+ "One of the Affinity Groups is missing %s"
+ %list_aff_grps_names)
+
+ vm1.start(self.api_client)
+
+ vm_status = VirtualMachine.list(self.api_client, id=vm1.id)
+ self.assertNotEqual(vm_status[0].hostid, hostid2, "The virtual machine "
+ "started on host %s violating the host anti-affinity"
+ "rule" %vm_status[0].hostid)
+
+ vm1.delete(self.api_client)
+ vm2.delete(self.api_client)
+ #Wait for expunge interval to cleanup VM
+ wait_for_cleanup(self.apiclient, ["expunge.delay", "expunge.interval"])
+ for i in aff_grps_names:
+ AffinityGroup.delete(self.api_client, i)
+
+ def test_03_update_aff_grp_for_vm_with_no_aff_grp(self):
+ """
+ Update the list of affinityGroups for vm which is not associated
+ with any affinity groups.
+
+ """
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_1"])
+ vm1, hostid1 = self.create_vm_in_aff_grps([])
+ vm2, hostid2 = self.create_vm_in_aff_grps([self.aff_grp[0].name])
+
+ vm1.stop(self.api_client)
+
+ vm1.update_affinity_group(self.api_client,
+ affinitygroupnames=[self.aff_grp[0].name])
+
+ vm1.start(self.api_client)
+
+ vm_status = VirtualMachine.list(self.api_client, id=vm1.id)
+ self.assertNotEqual(vm_status[0].hostid, hostid2, "The virtual machine "
+ "started on host %s violating the host anti-affinity"
+ "rule" %vm_status[0].hostid)
+
+ vm1.delete(self.api_client)
+ vm2.delete(self.api_client)
+ #Wait for expunge interval to cleanup VM
+ wait_for_cleanup(self.apiclient, ["expunge.delay", "expunge.interval"])
+ aff_grps_names = [self.aff_grp[0].name, self.aff_grp[1].name]
+ for i in aff_grps_names:
+ AffinityGroup.delete(self.api_client, i)
+
+ def test_04_update_aff_grp_remove_all(self):
+ """
+ Update the list of Affinity Groups to empty list
+ """
+
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_1"])
+ vm1, hostid1 = self.create_vm_in_aff_grps([self.aff_grp[0].name])
+
+ aff_grps_names = [self.aff_grp[0].name, self.aff_grp[1].name]
+ vm1.stop(self.api_client)
+
+ vm1.update_affinity_group(self.api_client,
+ affinitygroupnames=[])
+
+ vm1.start(self.api_client)
+ list_aff_grps = AffinityGroup.list(self.api_client,
+ virtualmachineid=vm.id)
+ self.assertEqual(list_aff_grps, [], "The affinity groups list is not empyty")
+
+ vm1.delete(self.api_client)
+ #Wait for expunge interval to cleanup VM
+ wait_for_cleanup(self.apiclient, ["expunge.delay", "expunge.interval"])
+ for i in aff_grps_names:
+ AffinityGroup.delete(self.api_client, i)
+
+ def test_05_update_aff_grp_on_running_vm(self):
+ """
+ Update the list of Affinity Groups on running vm
+ """
+
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_1"])
+ vm1, hostid1 = self.create_vm_in_aff_grps([self.aff_grp[0].name])
+
+ aff_grps_names = [self.aff_grp[0].name, self.aff_grp[1].name]
+ with self.assertRaises(Exception):
+ vm1.update_affinity_group(self.api_client, affinitygroupnames=[])
+
+ vm1.delete(self.api_client)
+ #Wait for expunge interval to cleanup VM
+ wait_for_cleanup(self.apiclient, ["expunge.delay", "expunge.interval"])
+ for i in aff_grps_names:
+ AffinityGroup.delete(self.api_client, i)
+
+class TestDeployVMAffinityGroups(cloudstackTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+
+ cls.api_client = super(TestDeployVMAffinityGroups, cls).getClsTestClient().getApiClient()
+ cls.services = Services().services
+ # Get Zone, Domain and templates
+ cls.domain = get_domain(cls.api_client, cls.services)
+ cls.zone = get_zone(cls.api_client, cls.services)
+ cls.template = get_template(
+ cls.api_client,
+ cls.zone.id,
+ cls.services["ostype"]
+ )
+ cls.services["virtual_machine"]["zoneid"] = cls.zone.id
+
+ cls.services["template"] = cls.template.id
+ cls.services["zoneid"] = cls.zone.id
+
+ cls.account = Account.create(
+ cls.api_client,
+ cls.services["account"],
+ domainid=cls.domain.id
+ )
+
+ cls.services["account"] = cls.account.name
+
+ cls.service_offering = ServiceOffering.create(
+ cls.api_client,
+ cls.services["service_offering"]
+ )
+
+ cls.__cleanup = [
+ cls.service_offering,
+ cls.account,
+ ]
+
+ # Create multiple Affinity Groups
+ return
+
+ def setUp(self):
+ self.apiclient = self.testClient.getApiClient()
+ self.dbclient = self.testClient.getDbConnection()
+ self.aff_grp = []
+ self.cleanup = []
+
+ def tearDown(self):
+ try:
+ self.api_client = super(TestDeployVMAffinityGroups,self).getClsTestClient().getApiClient()
+ #Clean up, terminate the created templates
+ cleanup_resources(self.api_client, self.cleanup)
+ except Exception as e:
+ raise Exception("Warning: Exception during cleanup : %s" % e)
+
+ @classmethod
+ def tearDownClass(cls):
+
+ try:
+ cls.api_client = super(TestDeployVMAffinityGroups, cls).getClsTestClient().getApiClient()
+ #Clean up, terminate the created templates
+ cleanup_resources(cls.api_client, cls.__cleanup)
+ except Exception as e:
+ raise Exception("Warning: Exception during cleanup : %s" % e)
+
+ def create_aff_grp(self, api_client=None, aff_grp=None,
+ acc=None, domainid=None):
+
+ if api_client == None:
+ api_client = self.api_client
+ if aff_grp == None:
+ self.services["host_anti_affinity_0"]
+ #if acc == None:
+ # acc = self.account.name
+ #if domainid == None:
+ # domainid = self.domain.id
+
+ try:
+ self.aff_grp.append(AffinityGroup.create(api_client,
+ aff_grp, acc, domainid))
+ except Exception as e:
+ raise Exception("Error: Creation of Affinity Group failed : %s" %e)
+
+ def create_vm_in_aff_grps(self, api_client=None, ag_list=None, ag_ids=None):
+
+ if api_client == None:
+ api_client = self.api_client
+ self.debug('Creating VM in AffinityGroup=%s' % ag_list)
+ vm = VirtualMachine.create(
+ api_client,
+ self.services["virtual_machine"],
+ templateid=self.template.id,
+ #accountid=self.account.name,
+ #domainid=self.account.domainid,
+ serviceofferingid=self.service_offering.id,
+ affinitygroupnames=ag_list,
+ affinitygroupids=ag_ids
+ )
+ self.debug('Created VM=%s in Affinity Group=%s' %
+ (vm.id, ag_list))
+
+ list_vm = list_virtual_machines(self.api_client, id=vm.id)
+
+ self.assertEqual(isinstance(list_vm, list), True,
+ "Check list response returns a valid list")
+ self.assertNotEqual(len(list_vm),0,
+ "Check VM available in Delete Virtual Machines")
+
+ vm_response = list_vm[0]
+ self.assertEqual(vm_response.state, 'Running',
+ msg="VM is not in Running state")
+
+ return vm, vm_response.hostid
+
+ @attr(tags=["simulator", "basic", "advanced", "multihost"])
+ def test_01_deploy_vm_without_aff_grp(self):
+ """
+ Deploy VM without affinity group
+ """
+
+ vm1, hostid1 = self.create_vm_in_aff_grps()
+
+ vm1.delete(self.api_client)
+ #Wait for expunge interval to cleanup VM
+ wait_for_cleanup(self.apiclient, ["expunge.delay", "expunge.interval"])
+
+ @attr(tags=["simulator", "basic", "advanced", "multihost"])
+ def test_02_deploy_vm_by_aff_grp_name(self):
+ """
+ Deploy VM by aff grp name
+ """
+
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+ vm1, hostid1 = self.create_vm_in_aff_grps([self.aff_grp[0].name])
+
+ vm1.delete(self.api_client)
+ wait_for_cleanup(self.apiclient, ["expunge.delay", "expunge.interval"])
+ AffinityGroup.delete(self.api_client, self.aff_grp[0].name)
+
+ @attr(tags=["simulator", "basic", "advanced", "multihost"])
+ def test_03_deploy_vm_by_aff_grp_id(self):
+ """
+ Deploy VM by aff grp id
+ """
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+
+ list_aff_grps = AffinityGroup.list(self.api_client,
+ name=self.aff_grp[0].name)
+
+ vm1, hostid1 = self.create_vm_in_aff_grps(ag_ids=[list_aff_grps[0].id])
+
+ vm1.delete(self.api_client)
+ wait_for_cleanup(self.apiclient, ["expunge.delay", "expunge.interval"])
+ AffinityGroup.delete(self.api_client, self.aff_grp[0].name)
+
+ @attr(tags=["simulator", "basic", "advanced", "multihost"])
+ def test_04_deploy_vm_anti_affinity_group(self):
+ """
+ test DeployVM in anti-affinity groups
+
+ deploy VM1 and VM2 in the same host-anti-affinity groups
+ Verify that the vms are deployed on separate hosts
+ """
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+ vm1, hostid1 = self.create_vm_in_aff_grps(ag_list=[self.aff_grp[0].name])
+ vm2, hostid2 = self.create_vm_in_aff_grps(ag_list=[self.aff_grp[0].name])
+
+ self.assertNotEqual(hostid1, hostid2,
+ msg="Both VMs of affinity group %s are on the same host"
+ % self.aff_grp[0].name)
+
+ vm1.delete(self.api_client)
+ vm2.delete(self.api_client)
+ wait_for_cleanup(self.apiclient, ["expunge.delay", "expunge.interval"])
+ AffinityGroup.delete(self.api_client, self.aff_grp[0].name)
+
+ @attr(tags=["simulator", "basic", "advanced", "multihost"])
+ def test_05_deploy_vm_by_id(self):
+ """
+ Deploy vms by affinity group id
+ """
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+
+ list_aff_grps = AffinityGroup.list(self.api_client,
+ name=self.aff_grp[0].name)
+
+ vm1, hostid1 = self.create_vm_in_aff_grps(ag_ids=[list_aff_grps[0].id])
+ vm2, hostid2 = self.create_vm_in_aff_grps(ag_ids=[list_aff_grps[0].id])
+
+ self.assertNotEqual(hostid1, hostid2,
+ msg="Both VMs of affinity group %s are on the same host"
+ % self.aff_grp[0].name)
+
+ vm1.delete(self.api_client)
+ vm2.delete(self.api_client)
+ wait_for_cleanup(self.apiclient, ["expunge.delay", "expunge.interval"])
+ AffinityGroup.delete(self.api_client, self.aff_grp[0].name)
+
+ @attr(tags=["simulator", "basic", "advanced", "multihost"])
+ def test_06_deploy_vm_aff_grp_of_other_user_by_name(self):
+ """
+ Deploy vm in affinity group of another user by name
+ """
+
+ self.user1 = Account.create(self.api_client,
+ self.services["new_account"])
+
+ self.cleanup.append(self.user1)
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"],
+ acc=self.user1.name,
+ domainid=self.domain.id)
+
+ self.user2 = Account.create(self.apiclient, self.services["new_account1"])
+ self.cleanup.append(self.user2)
+
+ userapiclient = self.testClient.createUserApiClient(
+ UserName=self.user2.name,
+ DomainName=self.user2.domain,
+ acctType=0)
+
+ self.create_aff_grp(api_client=userapiclient,
+ aff_grp=self.services["host_anti_affinity_1"])
+
+ with self.assertRaises(Exception):
+ vm1, hostid1 = self.create_vm_in_aff_grps(api_client=userapiclient,
+ ag_list=[self.aff_grp[0].name])
+
+
+ AffinityGroup.delete(self.api_client, self.aff_grp[0].name)
+ AffinityGroup.delete(userapiclient, self.aff_grp[1].name)
+
+ @attr(tags=["simulator", "basic", "advanced", "multihost"])
+ def test_07_deploy_vm_aff_grp_of_other_user_by_id(self):
+ """
+ Deploy vm in affinity group of another user by id
+ """
+
+ self.user1 = Account.create(self.api_client,
+ self.services["new_account"])
+
+ self.cleanup.append(self.user1)
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"],
+ acc=self.user1.name,
+ domainid=self.domain.id)
+
+ self.user2 = Account.create(self.apiclient, self.services["new_account1"])
+ self.cleanup.append(self.user2)
+
+ userapiclient = self.testClient.createUserApiClient(
+ UserName=self.user2.name,
+ DomainName=self.user2.domain,
+ acctType=0)
+
+ self.create_aff_grp(api_client=userapiclient,
+ aff_grp=self.services["host_anti_affinity_1"])
+
+ list_aff_grps = AffinityGroup.list(self.api_client,
+ name=self.aff_grp[0].name)
+
+ # Deploy VM in Affinity group belonging to different user by id
+ with self.assertRaises(Exception):
+ vm1, hostid1 = self.create_vm_in_aff_grps(api_client=userapiclient,
+ ag_ids=[list_aff_grps[0].id])
+
+ AffinityGroup.delete(self.api_client, self.aff_grp[0].name)
+ AffinityGroup.delete(userapiclient, self.aff_grp[1].name)
+
+ @attr(tags=["simulator", "basic", "advanced", "multihost"])
+ def test_08_deploy_vm_multiple_aff_grps(self):
+ """
+ Deploy vm in multiple affinity groups
+ """
+
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_1"])
+ vm1, hostid1 = self.create_vm_in_aff_grps(ag_list=[self.aff_grp[0].name,
+ self.aff_grp[1].name])
+
+ list_aff_grps = AffinityGroup.list(self.api_client,
+ virtualmachineid=vm1.id)
+
+ aff_grps_names = [self.aff_grp[0].name, self.aff_grp[1].name]
+ list_aff_grps_names = [list_aff_grps[0].name, list_aff_grps[1].name]
+
+ aff_grps_names.sort()
+ list_aff_grps_names.sort()
+ self.assertEqual(aff_grps_names, list_aff_grps_names,
+ "One of the Affinity Groups is missing %s"
+ %list_aff_grps_names)
+
+ vm1.delete(self.api_client)
+ wait_for_cleanup(self.apiclient, ["expunge.delay", "expunge.interval"])
+ AffinityGroup.delete(self.api_client, self.aff_grp[0].name)
+ AffinityGroup.delete(self.api_client, self.aff_grp[1].name)
+
+ @attr(tags=["simulator", "basic", "advanced", "multihost"])
+ def test_09_deploy_vm_multiple_aff_grps(self):
+ """
+ Deploy multiple vms in multiple affinity groups
+ """
+
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_1"])
+ vm1, hostid1 = self.create_vm_in_aff_grps(ag_list=[self.aff_grp[0].name,
+ self.aff_grp[1].name])
+ vm2, hostid2 = self.create_vm_in_aff_grps(ag_list=[self.aff_grp[0].name,
+ self.aff_grp[1].name])
+
+ aff_grps_names = [self.aff_grp[0].name, self.aff_grp[1].name]
+ aff_grps_names.sort()
+
+ for vm in [vm1, vm2]:
+ list_aff_grps = AffinityGroup.list(self.api_client,
+ virtualmachineid=vm.id)
+
+ list_aff_grps_names = [list_aff_grps[0].name, list_aff_grps[1].name]
+
+ list_aff_grps_names.sort()
+ self.assertEqual(aff_grps_names, list_aff_grps_names,
+ "One of the Affinity Groups is missing %s"
+ %list_aff_grps_names)
+
+ vm1.delete(self.api_client)
+ vm2.delete(self.api_client)
+ wait_for_cleanup(self.apiclient, ["expunge.delay", "expunge.interval"])
+
+ AffinityGroup.delete(self.api_client, self.aff_grp[0].name)
+ AffinityGroup.delete(self.api_client, self.aff_grp[1].name)
+
+ @attr(tags=["simulator", "basic", "advanced", "multihost"])
+ def test_10_deploy_vm_by_aff_grp_name_and_id(self):
+ """
+ Deploy VM by aff grp name and id
+ """
+
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"])
+ list_aff_grps = AffinityGroup.list(self.api_client,
+ name=self.aff_grp[0].name)
+
+ with self.assertRaises(Exception):
+ vm1, hostid1 = self.create_vm_in_aff_grps(ag_list=[self.aff_grp[0].name],
+ ag_ids=[list_aff_grps[0].id])
+
+ AffinityGroup.delete(self.api_client, self.aff_grp[0].name)
+
+class TestAffinityGroupsAdminUser(cloudstackTestCase):
+
+ @classmethod
+ def setUpClass(cls):
+
+ cls.api_client = super(TestAffinityGroupsAdminUser, cls).getClsTestClient().getApiClient()
+ cls.services = Services().services
+ # Get Zone, Domain and templates
+ cls.domain = get_domain(cls.api_client, cls.services)
+ cls.zone = get_zone(cls.api_client, cls.services)
+ cls.template = get_template(
+ cls.api_client,
+ cls.zone.id,
+ cls.services["ostype"]
+ )
+ cls.services["virtual_machine"]["zoneid"] = cls.zone.id
+
+ cls.services["template"] = cls.template.id
+ cls.services["zoneid"] = cls.zone.id
+
+ cls.account = Account.create(
+ cls.api_client,
+ cls.services["account"],
+ domainid=cls.domain.id
+ )
+
+ cls.services["account"] = cls.account.name
+
+ cls.service_offering = ServiceOffering.create(
+ cls.api_client,
+ cls.services["service_offering"]
+ )
+
+ cls.__cleanup = [
+ cls.service_offering,
+ cls.account,
+ ]
+
+ # Create multiple Affinity Groups
+ return
+
+ def setUp(self):
+ self.apiclient = self.testClient.getApiClient()
+ self.dbclient = self.testClient.getDbConnection()
+ self.aff_grp = []
+ self.cleanup = []
+
+ def tearDown(self):
+ try:
+ self.api_client = super(TestAffinityGroupsAdminUser,self).getClsTestClient().getApiClient()
+ #Clean up, terminate the created templates
+ cleanup_resources(self.api_client, self.cleanup)
+ except Exception as e:
+ raise Exception("Warning: Exception during cleanup : %s" % e)
+
+ @classmethod
+ def tearDownClass(cls):
+
+ try:
+ cls.api_client = super(TestAffinityGroupsAdminUser, cls).getClsTestClient().getApiClient()
+ #Clean up, terminate the created templates
+ cleanup_resources(cls.api_client, cls.__cleanup)
+ except Exception as e:
+ raise Exception("Warning: Exception during cleanup : %s" % e)
+
+ def create_aff_grp(self, api_client=None, aff_grp=None,
+ acc=None, domainid=None):
+
+ if api_client == None:
+ api_client = self.api_client
+ if aff_grp == None:
+ self.services["host_anti_affinity_0"]
+ #if acc == None:
+ # acc = self.account.name
+ #if domainid == None:
+ # domainid = self.domain.id
+
+ try:
+ self.aff_grp.append(AffinityGroup.create(api_client,
+ aff_grp, acc, domainid))
+ except Exception as e:
+ raise Exception("Error: Creation of Affinity Group failed : %s" %e)
+
+ def create_vm_in_aff_grps(self, api_client=None, ag_list=None, ag_ids=None):
+
+ if api_client == None:
+ api_client = self.api_client
+ self.debug('Creating VM in AffinityGroup=%s' % ag_list)
+ vm = VirtualMachine.create(
+ api_client,
+ self.services["virtual_machine"],
+ templateid=self.template.id,
+ #accountid=self.account.name,
+ #domainid=self.account.domainid,
+ serviceofferingid=self.service_offering.id,
+ affinitygroupnames=ag_list,
+ affinitygroupids=ag_ids
+ )
+ self.debug('Created VM=%s in Affinity Group=%s' %
+ (vm.id, ag_list))
+
+ list_vm = list_virtual_machines(self.api_client, id=vm.id)
+
+ self.assertEqual(isinstance(list_vm, list), True,
+ "Check list response returns a valid list")
+ self.assertNotEqual(len(list_vm),0,
+ "Check VM available in Delete Virtual Machines")
+
+ vm_response = list_vm[0]
+ self.assertEqual(vm_response.state, 'Running',
+ msg="VM is not in Running state")
+
+ return vm, vm_response.hostid
+
+ @attr(tags=["simulator", "basic", "advanced", "multihost"])
+ def test_01_deploy_vm_another_user(self):
+ """
+ Deploy vm in Affinity Group belonging to regular user
+ """
+ self.user1 = Account.create(self.api_client,
+ self.services["new_account"])
+
+ self.cleanup.append(self.user1)
+ userapiclient = self.testClient.createUserApiClient(
+ UserName=self.user1.name,
+ DomainName=self.user1.domain,
+ acctType=0)
+
+ self.create_aff_grp(api_client=userapiclient,
+ aff_grp=self.services["host_anti_affinity_0"])
+
+ with self.assertRaises(Exception):
+ vm1, hostid1 = self.create_vm_in_aff_grps(ag_list=[self.aff_grp[0].name])
+
+ AffinityGroup.delete(userapiclient, self.aff_grp[0].name)
+
+ @attr(tags=["simulator", "basic", "advanced", "multihost"])
+ def test_02_create_aff_grp_user(self):
+ """
+ Create Affinity Group forregular user
+ """
+
+ self.user = Account.create(self.api_client, self.services["new_account"],
+ domainid=self.domain.id)
+
+ self.cleanup.append(self.user)
+ self.create_aff_grp(aff_grp=self.services["host_anti_affinity_0"],
+ acc=self.user.name, domainid=self.domain.id)
+
+ AffinityGroup.delete(self.api_client, name=self.aff_grp[0].name,
+ account=self.user.name, domainid=self.domain.id)
+ self.debug("Deleted Affinity Group: %s" %self.aff_grp[0].name)
+
+ @attr(tags=["simulator", "basic", "advanced", "multihost"])
+ def test_03_list_aff_grp_all_users(self):
+ """
+ List Affinity Groups for all the users
+ """
+
+ self.user1 = Account.create(self.api_client,
+ self.services["new_account"])
+
+ self.cleanup.append(self.user1)
+ userapiclient = self.testClient.createUserApiClient(
+ UserName=self.user1.name,
+ DomainName=self.user1.domain,
+ acctType=0)
+
+ self.create_aff_grp(api_client=userapiclient,
+ aff_grp=self.services["host_anti_affinity_0"])
+
+ list_aff_grps = AffinityGroup.list(self.api_client)
+ print list_aff_grps
+ self.assertNotEqual(list_aff_grps, [], "Admin not able to list Affinity "
+ "Groups of users")
+ AffinityGroup.delete(userapiclient, self.aff_grp[0].name)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3c0c6cb0/tools/marvin/marvin/integration/lib/base.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base.py b/tools/marvin/marvin/integration/lib/base.py
index 503ed64..710d9a9 100755
--- a/tools/marvin/marvin/integration/lib/base.py
+++ b/tools/marvin/marvin/integration/lib/base.py
@@ -2965,28 +2965,40 @@ class AffinityGroup:
self.__dict__.update(items)
@classmethod
- def create(cls, apiclient, services, account=None, domainid=None):
- agCmd = createAffinityGroup.createAffinityGroupCmd()
- agCmd.name = services['name']
- agCmd.displayText = services['displaytext'] if 'displaytext' in services else services['name']
- agCmd.type = services['type']
- agCmd.account = services['account'] if 'account' in services else account
- agCmd.domainid = services['domainid'] if 'domainid' in services else domainid
- return AffinityGroup(apiclient.createAffinityGroup(agCmd).__dict__)
+ def create(cls, apiclient, aff_grp, account=None, domainid=None):
+ cmd = createAffinityGroup.createAffinityGroupCmd()
+ cmd.name = aff_grp['name']
+ cmd.displayText = aff_grp['name']
+ cmd.type = aff_grp['type']
+ #if account is not None:
+ # cmd.account = account
+ #if domainid is not None:
+ # cmd.domainid = domainid
+ return AffinityGroup(apiclient.createAffinityGroup(cmd).__dict__)
def update(self, apiclient):
pass
- def delete(self, apiclient):
+ @classmethod
+ def delete(cls, apiclient, name=None, id=None, account=None,
+ domainid=None):
cmd = deleteAffinityGroup.deleteAffinityGroupCmd()
- cmd.id = self.id
- return apiclient.deleteVPC(cmd)
+ if id is not None:
+ cmd.id = id
+ if name is not None:
+ cmd.name = name
+ if account is not None:
+ cmd.account = account
+ if domainid is not None:
+ cmd.domaindid = domainid
+
+ return apiclient.deleteAffinityGroup(cmd)
@classmethod
def list(cls, apiclient, **kwargs):
cmd = listAffinityGroups.listAffinityGroupsCmd()
[setattr(cmd, k, v) for k, v in kwargs.items()]
- return(apiclient.listVPCs(cmd))
+ return apiclient.listAffinityGroups(cmd)
class StaticRoute:
"""Manage static route lifecycle"""
@@ -3373,4 +3385,4 @@ class ApplicationLoadBalancer:
"""List all appln load balancers"""
cmd = listLoadBalancers.listLoadBalancersCmd()
[setattr(cmd, k, v) for k, v in kwargs.items()]
- return(apiclient.listLoadBalancerRules(cmd))
\ No newline at end of file
+ return(apiclient.listLoadBalancerRules(cmd))
[42/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-3231: Update service offering Id of allocated Vm usage whem service offering changes for a Vm
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f96442a4
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f96442a4
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f96442a4
Branch: refs/heads/vmsync
Commit: f96442a45b98c4bdc5cfec8535dbde06b0f4b799
Parents: 3c0c6cb
Author: Kishan Kavala <ki...@cloud.com>
Authored: Thu Jun 27 16:01:09 2013 +0530
Committer: Kishan Kavala <ki...@cloud.com>
Committed: Thu Jun 27 16:01:39 2013 +0530
----------------------------------------------------------------------
.../src/com/cloud/usage/UsageVMInstanceVO.java | 12 ++++++++++--
usage/src/com/cloud/usage/UsageManagerImpl.java | 15 ++++++++++++++-
2 files changed, 24 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f96442a4/engine/schema/src/com/cloud/usage/UsageVMInstanceVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/usage/UsageVMInstanceVO.java b/engine/schema/src/com/cloud/usage/UsageVMInstanceVO.java
index 6f40471..2fe346e 100644
--- a/engine/schema/src/com/cloud/usage/UsageVMInstanceVO.java
+++ b/engine/schema/src/com/cloud/usage/UsageVMInstanceVO.java
@@ -47,7 +47,7 @@ public class UsageVMInstanceVO {
@Column(name="template_id")
private long templateId;
-
+
@Column(name="hypervisor_type")
private String hypervisorType;
@@ -104,6 +104,10 @@ public class UsageVMInstanceVO {
return templateId;
}
+ public void setServiceOfferingId(long serviceOfferingId) {
+ this.serviceOfferingId = serviceOfferingId;
+ }
+
public String getHypervisorType() {
return hypervisorType;
}
@@ -112,7 +116,11 @@ public class UsageVMInstanceVO {
return startDate;
}
- public Date getEndDate() {
+ public void setStartDate(Date startDate) {
+ this.startDate = startDate;
+ }
+
+ public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f96442a4/usage/src/com/cloud/usage/UsageManagerImpl.java
----------------------------------------------------------------------
diff --git a/usage/src/com/cloud/usage/UsageManagerImpl.java b/usage/src/com/cloud/usage/UsageManagerImpl.java
index 65f354c..4901dd9 100644
--- a/usage/src/com/cloud/usage/UsageManagerImpl.java
+++ b/usage/src/com/cloud/usage/UsageManagerImpl.java
@@ -988,8 +988,21 @@ public class UsageManagerImpl extends ManagerBase implements UsageManager, Runna
usageInstances = m_usageInstanceDao.search(sc, null);
if (usageInstances == null || (usageInstances.size() == 0)) {
s_logger.error("Cannot find allocated vm entry for a vm running with id: " + vmId);
+ } else if (usageInstances.size() == 1) {
+ UsageVMInstanceVO usageInstance = usageInstances.get(0);
+ if(usageInstance.getSerivceOfferingId() != soId){
+ //Service Offering changed after Vm creation
+ //End current Allocated usage and create new Allocated Vm entry with new soId
+ usageInstance.setEndDate(event.getCreateDate());
+ m_usageInstanceDao.update(usageInstance);
+ usageInstance.setServiceOfferingId(soId);
+ usageInstance.setStartDate(event.getCreateDate());
+ usageInstance.setEndDate(null);
+ m_usageInstanceDao.persist(usageInstance);
+ }
}
-
+
+
Long templateId = event.getTemplateId();
String hypervisorType = event.getResourceType();
[02/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
Dedication of pod/cluster
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/49ab93cd
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/49ab93cd
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/49ab93cd
Branch: refs/heads/vmsync
Commit: 49ab93cd233f8045dae51562c860f331278026db
Parents: 1fc7aea
Author: Pranav Saxena <ps...@gmail.com>
Authored: Tue Jun 25 18:19:45 2013 +0530
Committer: Pranav Saxena <ps...@gmail.com>
Committed: Tue Jun 25 18:19:45 2013 +0530
----------------------------------------------------------------------
ui/scripts/system.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/49ab93cd/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index ae6924e..92faf5e 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -10263,7 +10263,7 @@
if(args.$form.find('.form-item[rel=isDedicated]').find('input[type=checkbox]').is(':Checked')== true){
if(args.data.accountId != "")
array2.push("&account=" +todb(args.data.accountId));
- }
+
if(clusterId != null){
$.ajax({
@@ -10289,6 +10289,7 @@
}
});
}
+ }
},
error: function(XMLHttpResponse) {
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
@@ -11364,7 +11365,7 @@
if(args.$form.find('.form-item[rel=isDedicated]').find('input[type=checkbox]').is(':Checked')== true){
if(args.data.accountId != "")
array2.push("&account=" +todb(args.data.accountId));
- }
+
if(hostId != null){
$.ajax({
@@ -11391,6 +11392,7 @@
}
});
}
+ }
},
error: function(XMLHttpResponse) {
[15/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
Add missing ASL decl.
ssp mock api is also available under ASL2.0
Signed-off-by: Hiroaki KAWAI <ka...@stratosphere.co.jp>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/4b3c0128
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4b3c0128
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4b3c0128
Branch: refs/heads/vmsync
Commit: 4b3c0128b40dd3bf8b5d664d999dfefcf3bfc284
Parents: 39ef924
Author: Hiroaki KAWAI <ka...@stratosphere.co.jp>
Authored: Wed Jun 26 13:19:15 2013 +0900
Committer: Hiroaki KAWAI <ka...@stratosphere.co.jp>
Committed: Wed Jun 26 13:19:54 2013 +0900
----------------------------------------------------------------------
.../stratosphere-ssp/sspmock/sspmock.py | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4b3c0128/plugins/network-elements/stratosphere-ssp/sspmock/sspmock.py
----------------------------------------------------------------------
diff --git a/plugins/network-elements/stratosphere-ssp/sspmock/sspmock.py b/plugins/network-elements/stratosphere-ssp/sspmock/sspmock.py
index c764d25..5e7e610 100644
--- a/plugins/network-elements/stratosphere-ssp/sspmock/sspmock.py
+++ b/plugins/network-elements/stratosphere-ssp/sspmock/sspmock.py
@@ -1,3 +1,20 @@
+# 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.
+
import json
import uuid
from flask import Flask
[44/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
delete extra file on portable ip
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8745316f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8745316f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8745316f
Branch: refs/heads/vmsync
Commit: 8745316f2fc419aade495c41e14c556b7235255d
Parents: 7d8a9e9
Author: Radhika PC <ra...@citrix.com>
Authored: Thu Jun 27 17:02:10 2013 +0530
Committer: Radhika PC <ra...@citrix.com>
Committed: Thu Jun 27 17:02:10 2013 +0530
----------------------------------------------------------------------
docs/en-US/portable-ip | 109 --------------------------------------------
1 file changed, 109 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8745316f/docs/en-US/portable-ip
----------------------------------------------------------------------
diff --git a/docs/en-US/portable-ip b/docs/en-US/portable-ip
deleted file mode 100644
index 6dfb526..0000000
--- a/docs/en-US/portable-ip
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version='1.0' encoding='utf-8' ?>
-<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
-%BOOK_ENTITIES;
-]>
-<!-- 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.
--->
-<section id="portable-ip">
- <title>Portable IPs</title>
- <section id="about-pip">
- <title>About Portable IP</title>
- <para>Portable IPs in &PRODUCT; are nothing but elastic IPs that can be transferred across
- geographically separated zones. As an administrator, you can provision a pool of portable IPs
- at region level and are available for user consumption. The users can acquire portable IPs if
- admin has provisioned portable public IPs at the region level they are part of. These IPs can
- be use for any service within an advanced zone. You can also use portable IPs for EIP service
- in basic zones. Additionally, a portable IP can be transferred from one network to another
- network.</para>
- </section>
- <section id="config-pip">
- <title>Configuring Portable IPs</title>
- <orderedlist>
- <listitem>
- <para>Log in to the &PRODUCT; UI as an administrator or end user.</para>
- </listitem>
- <listitem>
- <para>In the left navigation, click Regions.</para>
- </listitem>
- <listitem>
- <para>Choose the Regions that you want to work with.</para>
- </listitem>
- <listitem>
- <para>Click View Portable IP.</para>
- </listitem>
- <listitem>
- <para>Click Portable IP Range.</para>
- <para>The Add Portable IP Range window is displayed.</para>
- </listitem>
- <listitem>
- <para>Specify the following:</para>
- <itemizedlist>
- <listitem>
- <para><emphasis role="bold">Start IP/ End IP</emphasis>: A range of IP addresses that
- are accessible from the Internet and will be allocated to guest VMs. Enter the first
- and last IP addresses that define a range that &PRODUCT; can assign to guest
- VMs.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">Gateway</emphasis>: The gateway in use for the Portable IP
- addresses you are configuring.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">Netmask</emphasis>: The netmask associated with the Portable
- IP range.</para>
- </listitem>
- <listitem>
- <para><emphasis role="bold">VLAN</emphasis>: The VLAN that will be used for public
- traffic.</para>
- </listitem>
- </itemizedlist>
- </listitem>
- <listitem>
- <para>Click OK.</para>
- </listitem>
- </orderedlist>
- </section>
- <section id="acquire-pip">
- <title>Acquiring a Portable IP</title>
- <orderedlist>
- <listitem>
- <para>Log in to the &PRODUCT; UI as an administrator or end user. </para>
- </listitem>
- <listitem>
- <para>In the left navigation, choose Network.</para>
- </listitem>
- <listitem>
- <para>Click the name of the network where you want to work with.</para>
- </listitem>
- <listitem>
- <para>Click View IP Addresses.</para>
- </listitem>
- <listitem>
- <para>Click Acquire New IP.</para>
- <para>The Acquire New IP window is displayed.</para>
- </listitem>
- <listitem>
- <para>Specify whether you want cross-zone IP or not.</para>
- </listitem>
- <listitem>
- <para>Click Yes in the confirmation dialog.</para>
- <para>Within a few moments, the new IP address should appear with the state Allocated. You
- can now use the IP address in port forwarding or static NAT rules.</para>
- </listitem>
- </orderedlist>
- </section>
-</section>
[32/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
Add jetty stop function to cloudstack client
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c214b477
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c214b477
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c214b477
Branch: refs/heads/vmsync
Commit: c214b47764be02d773d1f4ace8ea7c8600e371a7
Parents: 4bc6294
Author: Ian Duffy <ia...@ianduffy.ie>
Authored: Wed Jun 26 11:35:57 2013 +0100
Committer: Sebastien Goasguen <ru...@gmail.com>
Committed: Wed Jun 26 11:13:15 2013 -0400
----------------------------------------------------------------------
client/pom.xml | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c214b477/client/pom.xml
----------------------------------------------------------------------
diff --git a/client/pom.xml b/client/pom.xml
index ffa5ec7..b8182c2 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -307,6 +307,8 @@
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
<configuration>
+ <stopPort>9966</stopPort>
+ <stopKey>stop-jetty</stopKey>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
[33/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-3185: Fix height of detail view table when in edit mode
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/aeab881e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/aeab881e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/aeab881e
Branch: refs/heads/vmsync
Commit: aeab881e0034dbc1edb23a9c2804f966d5f7c71a
Parents: c214b47
Author: Brian Federle <br...@citrix.com>
Authored: Wed Jun 26 10:21:21 2013 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Wed Jun 26 10:21:29 2013 -0700
----------------------------------------------------------------------
ui/css/cloudstack3.css | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/aeab881e/ui/css/cloudstack3.css
----------------------------------------------------------------------
diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css
index a89e0c3..b994c8a 100644
--- a/ui/css/cloudstack3.css
+++ b/ui/css/cloudstack3.css
@@ -1715,6 +1715,10 @@ div.list-view td.state.off span {
margin-right: 12px;
}
+.detail-view.edit-mode .main-groups {
+ max-height: 360px;
+}
+
.detail-group table {
width: 96%;
font-size: 12px;
[45/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-1192: Disk I/O Statistics (vm stats) support KVM and XenServer only util 2013/06/25
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/181567ba
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/181567ba
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/181567ba
Branch: refs/heads/vmsync
Commit: 181567ba746b5a0a5528a87f06a6dfc734fffd82
Parents: 8745316
Author: Wei Zhou <w....@leaseweb.com>
Authored: Thu Jun 27 14:25:54 2013 +0200
Committer: Wei Zhou <w....@leaseweb.com>
Committed: Thu Jun 27 14:25:54 2013 +0200
----------------------------------------------------------------------
.../cloud/api/query/dao/UserVmJoinDaoImpl.java | 21 ++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/181567ba/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
index 0280834..241c073 100644
--- a/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/UserVmJoinDaoImpl.java
@@ -38,6 +38,7 @@ import com.cloud.api.ApiDBUtils;
import com.cloud.api.query.vo.ResourceTagJoinVO;
import com.cloud.api.query.vo.UserVmJoinVO;
import com.cloud.configuration.dao.ConfigurationDao;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.user.Account;
import com.cloud.uservm.UserVm;
import com.cloud.utils.db.GenericDaoBase;
@@ -180,17 +181,21 @@ public class UserVmJoinDaoImpl extends GenericDaoBase<UserVmJoinVO, Long> implem
Double networkKbWrite = Double.valueOf(vmStats.getNetworkWriteKBs());
userVmResponse.setNetworkKbsWrite(networkKbWrite.longValue());
- Double diskKbsRead = Double.valueOf(vmStats.getDiskReadKBs());
- userVmResponse.setDiskKbsRead(diskKbsRead.longValue());
+ if ((userVm.getHypervisorType() != null)
+ && (userVm.getHypervisorType().equals(HypervisorType.KVM)
+ || userVm.getHypervisorType().equals(HypervisorType.XenServer))) { // support KVM and XenServer only util 2013.06.25
+ Double diskKbsRead = Double.valueOf(vmStats.getDiskReadKBs());
+ userVmResponse.setDiskKbsRead(diskKbsRead.longValue());
- Double diskKbsWrite = Double.valueOf(vmStats.getDiskWriteKBs());
- userVmResponse.setDiskKbsWrite(diskKbsWrite.longValue());
+ Double diskKbsWrite = Double.valueOf(vmStats.getDiskWriteKBs());
+ userVmResponse.setDiskKbsWrite(diskKbsWrite.longValue());
- Double diskIORead = Double.valueOf(vmStats.getDiskReadIOs());
- userVmResponse.setDiskIORead(diskIORead.longValue());
+ Double diskIORead = Double.valueOf(vmStats.getDiskReadIOs());
+ userVmResponse.setDiskIORead(diskIORead.longValue());
- Double diskIOWrite = Double.valueOf(vmStats.getDiskWriteIOs());
- userVmResponse.setDiskIOWrite(diskIOWrite.longValue());
+ Double diskIOWrite = Double.valueOf(vmStats.getDiskWriteIOs());
+ userVmResponse.setDiskIOWrite(diskIOWrite.longValue());
+ }
}
}
[17/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
Add notes about systemvm build script
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c484d8aa
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c484d8aa
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c484d8aa
Branch: refs/heads/vmsync
Commit: c484d8aaba803734fa9792c7254bd384955e96c4
Parents: 8a1fefc
Author: Hiroaki KAWAI <ka...@stratosphere.co.jp>
Authored: Wed Jun 26 15:16:29 2013 +0900
Committer: Hiroaki KAWAI <ka...@stratosphere.co.jp>
Committed: Wed Jun 26 15:16:29 2013 +0900
----------------------------------------------------------------------
patches/systemvm/debian/README | 5 +++++
patches/systemvm/debian/buildsystemvm.sh | 6 +++++-
tools/appliance/README.md | 18 ++++++++++++++++++
3 files changed, 28 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c484d8aa/patches/systemvm/debian/README
----------------------------------------------------------------------
diff --git a/patches/systemvm/debian/README b/patches/systemvm/debian/README
index 6021db6..5d79c35 100644
--- a/patches/systemvm/debian/README
+++ b/patches/systemvm/debian/README
@@ -1,3 +1,8 @@
+####################################################
+ Note there is a new systemvm build script based on
+ Veewee(Vagrant) under tools/appliance.
+####################################################
+
1. The buildsystemvm.sh script builds a 32-bit system vm disk based on the Debian Squeeze distro. This system vm can boot on any hypervisor thanks to the pvops support in the kernel. It is fully automated
2. The files under config/ are the specific tweaks to the default Debian configuration that are required for CloudStack operation.
3. The variables at the top of the buildsystemvm.sh script can be customized:
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c484d8aa/patches/systemvm/debian/buildsystemvm.sh
----------------------------------------------------------------------
diff --git a/patches/systemvm/debian/buildsystemvm.sh b/patches/systemvm/debian/buildsystemvm.sh
index c2fe344..3c99123 100755
--- a/patches/systemvm/debian/buildsystemvm.sh
+++ b/patches/systemvm/debian/buildsystemvm.sh
@@ -16,7 +16,11 @@
# specific language governing permissions and limitations
# under the License.
-
+echo "####################################################"
+echo " Note there is a new systemvm build script based on "
+echo " Veewee(Vagrant) under tools/appliance."
+echo "####################################################"
+
set -e
set -x
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c484d8aa/tools/appliance/README.md
----------------------------------------------------------------------
diff --git a/tools/appliance/README.md b/tools/appliance/README.md
index bb28829..a7c51c8 100644
--- a/tools/appliance/README.md
+++ b/tools/appliance/README.md
@@ -26,6 +26,8 @@ under the License.
export PATH=~/.rvm/bin:$PATH
- Install Ruby 1.9.3, if it installed some other version:
rvm install 1.9.3
+ - Set rvm to use that 1.9.3
+ rvm use ruby-1.9.3
- Install bundler: (if you get any openssl issue see https://rvm.io/packages/openssl)
gem install bundler
@@ -65,3 +67,19 @@ Halt the box:
veewee vbox halt 'systemvmtemplate'
Now VirtualBox can be used to export appliance.
+
+
+Trobuleshooting
+===============
+If you see following line in the screen, then veewee is failing
+extracting vboxmanage version.
+
+ Downloading vbox guest additions iso v - http://download.virtualbox.org/vi
+
+You would be able to check it manually by typing:
+
+ vboxmanage --version
+
+If you're using Fedora for example, you'll need to install `kernel-devel`
+package and run `/etc/init.d/vboxdrv setup` to get veewee working.
+
[49/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
Another merge from master to bring over fixes to bugs that broke the bvt
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/262352a1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/262352a1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/262352a1
Branch: refs/heads/vmsync
Commit: 262352a1c60ef39cca9607fabd8a3d8b5ff186b5
Parents: cbca4bb 6ea38bf
Author: Alex Huang <al...@gmail.com>
Authored: Thu Jun 27 11:16:32 2013 -0700
Committer: Alex Huang <al...@gmail.com>
Committed: Thu Jun 27 11:16:32 2013 -0700
----------------------------------------------------------------------
api/src/com/cloud/network/PhysicalNetwork.java | 3 +-
api/src/com/cloud/storage/Storage.java | 1 +
api/src/com/cloud/vm/VmDiskStats.java | 8 +-
.../org/apache/cloudstack/api/ApiConstants.java | 1 +
.../api/BaseUpdateTemplateOrIsoCmd.java | 7 +
.../user/address/AssociateIPAddrCmd.java | 14 +
.../user/template/RegisterTemplateCmd.java | 7 +
.../user/template/UpdateTemplateCmd.java | 1 +
.../command/user/volume/CreateVolumeCmd.java | 13 +-
.../classes/resources/messages_ja.properties | 48 +-
.../classes/resources/messages_zh_CN.properties | 4 +
client/pom.xml | 9 +-
client/tomcatconf/componentContext.xml.in | 15 +
.../com/cloud/agent/api/VmDiskStatsEntry.java | 26 +-
docs/en-US/acquire-new-ip-address.xml | 38 +-
docs/en-US/management-server-install-client.xml | 2 +-
docs/en-US/portable-ip.xml | 94 +-
.../com/cloud/capacity/dao/CapacityDaoImpl.java | 19 +-
engine/schema/src/com/cloud/dc/VlanVO.java | 4 +
.../src/com/cloud/network/dao/IPAddressVO.java | 4 +
.../cloud/storage/dao/VMTemplateDaoImpl.java | 19 +-
.../com/cloud/upgrade/dao/Upgrade410to420.java | 22 +-
.../src/com/cloud/usage/UsageVMInstanceVO.java | 12 +-
.../storage/image/store/TemplateObject.java | 51 +-
.../datastore/DataObjectManagerImpl.java | 62 +-
.../datastore/ObjectInDataStoreManager.java | 3 +-
.../datastore/ObjectInDataStoreManagerImpl.java | 34 +-
.../storage/volume/VolumeServiceImpl.java | 2 +-
patches/systemvm/debian/README | 5 +
patches/systemvm/debian/buildsystemvm.sh | 6 +-
.../kvm/resource/LibvirtComputingResource.java | 8 +-
.../vmware/manager/VmwareManagerImpl.java | 16 +-
.../vmware/resource/VmwareResource.java | 191 ++-
.../com/cloud/network/VmwareTrafficLabel.java | 5 +-
.../hypervisor/xen/resource/CitrixHelper.java | 772 ++++++++-
.../xen/resource/XenServer56FP1Resource.java | 33 +-
.../xen/resource/XenServer56SP2Resource.java | 29 +
.../xen/resource/XenServer600Resource.java | 29 +
.../xen/resource/XenServer602Resource.java | 28 +
.../xen/resource/XenServer610Resource.java | 30 +
.../xen/resource/XenServerConnectionPool.java | 2 +-
.../network-elements/stratosphere-ssp/pom.xml | 31 +
.../src/com/cloud/api/commands/AddSspCmd.java | 138 ++
.../com/cloud/api/commands/DeleteSspCmd.java | 74 +
.../src/com/cloud/api/response/SspResponse.java | 77 +
.../com/cloud/network/dao/SspCredentialDao.java | 33 +
.../cloud/network/dao/SspCredentialDaoImpl.java | 42 +
.../com/cloud/network/dao/SspCredentialVO.java | 67 +
.../src/com/cloud/network/dao/SspTenantDao.java | 34 +
.../com/cloud/network/dao/SspTenantDaoImpl.java | 48 +
.../src/com/cloud/network/dao/SspTenantVO.java | 55 +
.../src/com/cloud/network/dao/SspUuidDao.java | 36 +
.../com/cloud/network/dao/SspUuidDaoImpl.java | 116 ++
.../src/com/cloud/network/dao/SspUuidVO.java | 73 +
.../com/cloud/network/element/SspClient.java | 272 +++
.../com/cloud/network/element/SspElement.java | 617 +++++++
.../com/cloud/network/element/SspManager.java | 71 +
.../com/cloud/network/element/SspService.java | 46 +
.../cloud/network/guru/SspGuestNetworkGuru.java | 171 ++
.../stratosphere-ssp/sspmock/sspmock.py | 85 +
.../cloud/network/element/SspClientTest.java | 92 ++
.../cloud/network/element/SspElementTest.java | 152 ++
plugins/pom.xml | 5 +-
.../cloud/agent/manager/AgentManagerImpl.java | 23 +-
.../cloud/api/query/dao/UserVmJoinDaoImpl.java | 21 +-
server/src/com/cloud/configuration/Config.java | 1 -
.../configuration/ConfigurationManagerImpl.java | 17 +-
.../com/cloud/network/NetworkManagerImpl.java | 25 +-
.../src/com/cloud/network/NetworkModelImpl.java | 3 +
.../cloud/network/rules/RulesManagerImpl.java | 3 +
.../network/vpc/NetworkACLManagerImpl.java | 17 +-
.../com/cloud/network/vpc/VpcManagerImpl.java | 4 +
.../com/cloud/server/ManagementServerImpl.java | 20 +-
server/src/com/cloud/server/StatsCollector.java | 2 +
.../src/com/cloud/storage/TemplateProfile.java | 12 +-
.../src/com/cloud/template/TemplateAdapter.java | 4 +-
.../com/cloud/template/TemplateAdapterBase.java | 15 +-
.../com/cloud/template/TemplateManagerImpl.java | 9 +-
server/src/com/cloud/vm/UserVmManagerImpl.java | 5 +-
.../src/com/cloud/vm/UserVmStateListener.java | 2 +-
setup/db/db/schema-410to420.sql | 23 +
.../component/test_affinity_groups.py | 1547 ++++++++++++++++++
test/integration/smoke/test_routers.py | 80 +-
test/integration/smoke/test_vm_life_cycle.py | 2 +-
tools/appliance/README.md | 18 +
tools/appliance/build.sh | 23 +-
tools/marvin/marvin/integration/lib/base.py | 38 +-
ui/css/cloudstack3.css | 4 +
ui/scripts/network.js | 12 +-
ui/scripts/sharedFunctions.js | 4 +
ui/scripts/system.js | 12 +-
ui/scripts/ui-custom/zoneWizard.js | 15 +-
ui/scripts/ui/widgets/detailView.js | 3 +-
ui/scripts/ui/widgets/tagger.js | 2 +
ui/scripts/vpc.js | 95 +-
usage/src/com/cloud/usage/UsageManagerImpl.java | 15 +-
utils/pom.xml | 1 +
vmware-base/pom.xml | 5 +
.../vmware/mo/HypervisorHostHelper.java | 1133 +++++++------
99 files changed, 6257 insertions(+), 970 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/api/src/com/cloud/network/PhysicalNetwork.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
index 4dc1c44,c97a5e4..8c1f27d
--- a/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
@@@ -50,7 -49,9 +51,8 @@@ import com.cloud.exception.ResourceUnav
import com.cloud.network.IpAddress;
import com.cloud.network.Network;
import com.cloud.network.vpc.Vpc;
+ import com.cloud.projects.Project;
import com.cloud.user.Account;
-import com.cloud.user.UserContext;
@APICommand(name = "associateIpAddress", description="Acquires and associates a public IP to an account.", responseObject=IPAddressResponse.class)
public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
@@@ -195,7 -196,19 +197,19 @@@
if (accountName != null && domainId != null) {
Account account = _accountService.finalizeOwner(caller, accountName, domainId, projectId);
return account.getId();
+ } else if (projectId != null) {
+ Project project = _projectService.getProject(projectId);
+ if (project != null) {
+ if (project.getState() == Project.State.Active) {
+ return project.getProjectAccountId();
+ } else {
+ throw new PermissionDeniedException("Can't add resources to the project with specified projectId in state="
+ + project.getState() + " as it's no longer active");
+ }
+ } else {
+ throw new InvalidParameterValueException("Unable to find project by id");
+ }
- } else if (networkId != null){
+ } else if (networkId != null){
Network network = _networkService.getNetwork(networkId);
return network.getAccountId();
} else if (vpcId != null) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/api/src/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplateCmd.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
----------------------------------------------------------------------
diff --cc api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
index f8f70a9,6f0bf3a..eff874c
--- a/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
@@@ -133,8 -132,9 +133,9 @@@ public class CreateVolumeCmd extends Ba
return "volume";
}
+ @Override
- public AsyncJob.Type getInstanceType() {
- return AsyncJob.Type.Volume;
+ public ApiCommandJobType getInstanceType() {
+ return ApiCommandJobType.Volume;
}
@Override
@@@ -160,10 -160,10 +161,10 @@@
@Override
public void create() throws ResourceAllocationException{
-- Volume volume = this._volumeService.allocVolume(this);
++ Volume volume = _volumeService.allocVolume(this);
if (volume != null) {
-- this.setEntityId(volume.getId());
-- this.setEntityUuid(volume.getUuid());
++ setEntityId(volume.getId());
++ setEntityUuid(volume.getUuid());
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create volume");
}
@@@ -189,7 -189,7 +190,7 @@@
}
}
response.setResponseName(getCommandName());
-- this.setResponseObject(response);
++ setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create a volume");
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
----------------------------------------------------------------------
diff --cc engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
index 95ca968,e9316ff..3f6c4be
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
@@@ -331,11 -328,11 +331,11 @@@ public class VolumeServiceImpl implemen
dataStore, template, future, templateOnPrimaryStoreObj);
AsyncCallbackDispatcher<VolumeServiceImpl, CopyCommandResult> caller = AsyncCallbackDispatcher.create(this);
caller.setCallback(caller.getTarget().copyBaseImageCallback(null, null)).setContext(context);
-
+
try {
- templateOnPrimaryStoreObj.processEvent(Event.CreateOnlyRequested);
+ templateOnPrimaryStoreObj.processEvent(Event.CreateOnlyRequested);
} catch (Exception e) {
- s_logger.info("Got exception in case of multi-thread");
+ s_logger.info("Multiple threads are trying to copy template to primary storage, current thread should just wait");
try {
templateOnPrimaryStoreObj = waitForTemplateDownloaded(dataStore, template);
} catch (Exception e1) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
----------------------------------------------------------------------
diff --cc plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index a5548c5,b1bc99d..d5cbe97
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@@ -3451,17 -3446,17 +3451,17 @@@ ServerResource
}
+ if (data instanceof VolumeObjectTO) {
- VolumeObjectTO volumeObjectTO = (VolumeObjectTO)data;
- if ((volumeObjectTO.getBytesReadRate() != null) && (volumeObjectTO.getBytesReadRate() > 0))
- disk.setBytesReadRate(volumeObjectTO.getBytesReadRate());
- if ((volumeObjectTO.getBytesWriteRate() != null) && (volumeObjectTO.getBytesWriteRate() > 0))
- disk.setBytesWriteRate(volumeObjectTO.getBytesWriteRate());
- if ((volumeObjectTO.getIopsReadRate() != null) && (volumeObjectTO.getIopsReadRate() > 0))
- disk.setIopsReadRate(volumeObjectTO.getIopsReadRate());
- if ((volumeObjectTO.getIopsWriteRate() != null) && (volumeObjectTO.getIopsWriteRate() > 0))
- disk.setIopsWriteRate(volumeObjectTO.getIopsWriteRate());
+ VolumeObjectTO volumeObjectTO = (VolumeObjectTO)data;
-
+ if ((volumeObjectTO.getBytesReadRate() != null) && (volumeObjectTO.getBytesReadRate() > 0))
+ disk.setBytesReadRate(volumeObjectTO.getBytesReadRate());
+ if ((volumeObjectTO.getBytesWriteRate() != null) && (volumeObjectTO.getBytesWriteRate() > 0))
+ disk.setBytesWriteRate(volumeObjectTO.getBytesWriteRate());
+ if ((volumeObjectTO.getIopsReadRate() != null) && (volumeObjectTO.getIopsReadRate() > 0))
+ disk.setIopsReadRate(volumeObjectTO.getIopsReadRate());
+ if ((volumeObjectTO.getIopsWriteRate() != null) && (volumeObjectTO.getIopsWriteRate() > 0))
+ disk.setIopsWriteRate(volumeObjectTO.getIopsWriteRate());
-
+ }
vm.getDevices().addDevice(disk);
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --cc plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index 4620aca,5c51585..7fa9c5d
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@@ -43,51 -40,6 +43,49 @@@ import java.util.UUID
import javax.inject.Inject;
import javax.naming.ConfigurationException;
+import org.apache.log4j.Logger;
+import org.apache.log4j.NDC;
+
+import com.google.gson.Gson;
+import com.vmware.vim25.AboutInfo;
+import com.vmware.vim25.ClusterDasConfigInfo;
+import com.vmware.vim25.ComputeResourceSummary;
+import com.vmware.vim25.DatastoreSummary;
+import com.vmware.vim25.DynamicProperty;
+import com.vmware.vim25.GuestInfo;
+import com.vmware.vim25.HostCapability;
+import com.vmware.vim25.HostFirewallInfo;
+import com.vmware.vim25.HostFirewallRuleset;
- import com.vmware.vim25.HostNetworkTrafficShapingPolicy;
- import com.vmware.vim25.HostPortGroupSpec;
+import com.vmware.vim25.ManagedObjectReference;
+import com.vmware.vim25.ObjectContent;
+import com.vmware.vim25.OptionValue;
+import com.vmware.vim25.PerfCounterInfo;
+import com.vmware.vim25.PerfEntityMetric;
+import com.vmware.vim25.PerfEntityMetricBase;
+import com.vmware.vim25.PerfMetricId;
+import com.vmware.vim25.PerfMetricIntSeries;
+import com.vmware.vim25.PerfMetricSeries;
+import com.vmware.vim25.PerfQuerySpec;
+import com.vmware.vim25.PerfSampleInfo;
+import com.vmware.vim25.RuntimeFaultFaultMsg;
+import com.vmware.vim25.ToolsUnavailableFaultMsg;
+import com.vmware.vim25.VimPortType;
+import com.vmware.vim25.VirtualDevice;
+import com.vmware.vim25.VirtualDeviceConfigSpec;
+import com.vmware.vim25.VirtualDeviceConfigSpecOperation;
+import com.vmware.vim25.VirtualDisk;
+import com.vmware.vim25.VirtualEthernetCard;
+import com.vmware.vim25.VirtualEthernetCardNetworkBackingInfo;
+import com.vmware.vim25.VirtualLsiLogicController;
+import com.vmware.vim25.VirtualMachineConfigSpec;
+import com.vmware.vim25.VirtualMachineFileInfo;
+import com.vmware.vim25.VirtualMachineGuestOsIdentifier;
+import com.vmware.vim25.VirtualMachinePowerState;
+import com.vmware.vim25.VirtualMachineRelocateSpec;
+import com.vmware.vim25.VirtualMachineRelocateSpecDiskLocator;
+import com.vmware.vim25.VirtualMachineRuntimeInfo;
+import com.vmware.vim25.VirtualSCSISharing;
+
import org.apache.cloudstack.storage.command.DeleteCommand;
import org.apache.cloudstack.storage.command.StorageSubSystemCommand;
import org.apache.cloudstack.storage.to.PrimaryDataStoreTO;
@@@ -2698,22 -2750,44 +2749,44 @@@ public class VmwareResource implements
// pass boot arguments through machine.id & perform customized options to VMX
- Map<String, String> vmDetailOptions = validateVmDetails(vmSpec.getDetails());
- OptionValue[] extraOptions = new OptionValue[2 + vmDetailOptions.size()];
- extraOptions[0] = new OptionValue();
- extraOptions[0].setKey("machine.id");
- extraOptions[0].setValue(vmSpec.getBootArgs());
-
- extraOptions[1] = new OptionValue();
- extraOptions[1].setKey("devices.hotplug");
- extraOptions[1].setValue("true");
+ ArrayList<OptionValue> extraOptions = new ArrayList<OptionValue>();
+ OptionValue newVal = new OptionValue();
+ newVal.setKey("machine.id");
+ newVal.setValue(vmSpec.getBootArgs());
+ extraOptions.add(newVal);
+
+ newVal = new OptionValue();
+ newVal.setKey("devices.hotplug");
+ newVal.setValue("true");
+ extraOptions.add(newVal);
-
++
+ /**
+ * Extra Config : nvp.vm-uuid = uuid
+ * - Required for Nicira NVP integration
+ */
+ newVal = new OptionValue();
+ newVal.setKey("nvp.vm-uuid");
+ newVal.setValue(vmSpec.getUuid());
+ extraOptions.add(newVal);
+
+ /**
+ * Extra Config : nvp.iface-id<num> = uuid
+ * - Required for Nicira NVP integration
+ */
+ int nicNum = 0;
+ for (NicTO nicTo : sortNicsByDeviceId(nics)) {
+ newVal = new OptionValue();
+ newVal.setKey("nvp.iface-id" + nicNum);
+ newVal.setValue(nicTo.getUuid());
+ extraOptions.add(newVal);
+ nicNum++;
+ }
-
+
- int j = 2;
- for(Map.Entry<String, String> entry : vmDetailOptions.entrySet()) {
- extraOptions[j] = new OptionValue();
- extraOptions[j].setKey(entry.getKey());
- extraOptions[j].setValue(entry.getValue());
- j++;
+ for(Map.Entry<String, String> entry : validateVmDetails(vmSpec.getDetails()).entrySet()) {
+ newVal = new OptionValue();
+ newVal.setKey(entry.getKey());
+ newVal.setValue(entry.getValue());
+ extraOptions.add(newVal);
}
String keyboardLayout = null;
@@@ -2919,7 -2993,8 +2992,8 @@@
svlanId = getPvlanInfo(nicTo);
}
networkInfo = HypervisorHostHelper.prepareNetwork(switchName.first(), namePrefix, hostMo, vlanId, svlanId,
- nicTo.getNetworkRateMbps(), nicTo.getNetworkRateMulticastMbps(), _ops_timeout, switchType, _portsPerDvPortGroup, nicTo.getGateway(), configureVServiceInNexus);
- nicTo.getNetworkRateMbps(), nicTo.getNetworkRateMulticastMbps(), _ops_timeout, switchType,
++ nicTo.getNetworkRateMbps(), nicTo.getNetworkRateMulticastMbps(), _ops_timeout, switchType,
+ _portsPerDvPortGroup, nicTo.getGateway(), configureVServiceInNexus, nicTo.getBroadcastType());
}
return networkInfo;
@@@ -5282,74 -5356,7 +5360,7 @@@
return VirtualMachineGuestOsIdentifier.OTHER_GUEST;
}
- private void prepareNetworkForVmTargetHost(HostMO hostMo, VirtualMachineMO vmMo) throws Exception {
- assert (vmMo != null);
- assert (hostMo != null);
-
- String[] networks = vmMo.getNetworks();
- for (String networkName : networks) {
- HostPortGroupSpec portGroupSpec = hostMo.getHostPortGroupSpec(networkName);
- HostNetworkTrafficShapingPolicy shapingPolicy = null;
- if (portGroupSpec != null) {
- shapingPolicy = portGroupSpec.getPolicy().getShapingPolicy();
- }
-
- if (networkName.startsWith("cloud.private")) {
- String[] tokens = networkName.split("\\.");
- if (tokens.length == 3) {
- Integer networkRateMbps = null;
- if (shapingPolicy != null && shapingPolicy.isEnabled() != null && shapingPolicy.isEnabled().booleanValue()) {
- networkRateMbps = (int) (shapingPolicy.getPeakBandwidth().longValue() / (1024 * 1024));
- }
- String vlanId = null;
- if(!"untagged".equalsIgnoreCase(tokens[2]))
- vlanId = tokens[2];
-
- HypervisorHostHelper.prepareNetwork(_privateNetworkVSwitchName, "cloud.private",
- hostMo, vlanId, networkRateMbps, null, _ops_timeout, false);
- } else {
- s_logger.info("Skip suspecious cloud network " + networkName);
- }
- } else if (networkName.startsWith("cloud.public")) {
- String[] tokens = networkName.split("\\.");
- if (tokens.length == 3) {
- Integer networkRateMbps = null;
- if (shapingPolicy != null && shapingPolicy.isEnabled() != null && shapingPolicy.isEnabled().booleanValue()) {
- networkRateMbps = (int) (shapingPolicy.getPeakBandwidth().longValue() / (1024 * 1024));
- }
- String vlanId = null;
- if(!"untagged".equalsIgnoreCase(tokens[2]))
- vlanId = tokens[2];
-
- HypervisorHostHelper.prepareNetwork(_publicTrafficInfo.getVirtualSwitchName(), "cloud.public",
- hostMo, vlanId, networkRateMbps, null, _ops_timeout, false);
- } else {
- s_logger.info("Skip suspecious cloud network " + networkName);
- }
- } else if (networkName.startsWith("cloud.guest")) {
- String[] tokens = networkName.split("\\.");
- if (tokens.length >= 3) {
- Integer networkRateMbps = null;
- if (shapingPolicy != null && shapingPolicy.isEnabled() != null && shapingPolicy.isEnabled().booleanValue()) {
- networkRateMbps = (int) (shapingPolicy.getPeakBandwidth().longValue() / (1024 * 1024));
- }
-
- String vlanId = null;
- if(!"untagged".equalsIgnoreCase(tokens[2]))
- vlanId = tokens[2];
-
- HypervisorHostHelper.prepareNetwork(_guestTrafficInfo.getVirtualSwitchName(), "cloud.guest",
- hostMo, vlanId, networkRateMbps, null, _ops_timeout, false);
- } else {
- s_logger.info("Skip suspecious cloud network " + networkName);
- }
- } else {
- s_logger.info("Skip non-cloud network " + networkName + " when preparing target host");
- }
- }
- }
-
- private HashMap<String, State> getVmStates() throws Exception {
+ private HashMap<String, PowerState> getVmStates() throws Exception {
VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext());
ObjectContent[] ocs = hyperHost.getVmPropertiesOnHyperHost(new String[] { "name", "runtime.powerState", "config.template" });
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/server/src/com/cloud/agent/manager/AgentManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/agent/manager/AgentManagerImpl.java
index ccf3761,b24a238..90558a9
--- a/server/src/com/cloud/agent/manager/AgentManagerImpl.java
+++ b/server/src/com/cloud/agent/manager/AgentManagerImpl.java
@@@ -129,19 -126,22 +129,22 @@@ import edu.emory.mathcs.backport.java.u
/**
* Implementation of the Agent Manager. This class controls the connection to the agents.
*
- * @config {@table || Param Name | Description | Values | Default || || port | port to listen on for agent connection. | Integer
- * | 8250 || || workers | # of worker threads | Integer | 5 || || router.template.id | default id for template | Integer
- * | 1 || || router.ram.size | default ram for router vm in mb | Integer | 128 || || router.ip.address | ip address for
- * the router | ip | 10.1.1.1 || || wait | Time to wait for control commands to return | seconds | 1800 || || domain |
- * domain for domain routers| String | foo.com || || alert.wait | time to wait before alerting on a disconnected agent |
- * seconds | 1800 || || update.wait | time to wait before alerting on a updating agent | seconds | 600 || ||
- * ping.interval | ping interval in seconds | seconds | 60 || || instance.name | Name of the deployment String |
- * required || || start.retry | Number of times to retry start | Number | 2 || || ping.timeout | multiplier to
- * ping.interval before announcing an agent has timed out | float | 2.0x || || router.stats.interval | interval to
- * report router statistics | seconds | 300s || * }
+ * @config {@table || Param Name | Description | Values | Default ||
+ * || port | port to listen on for agent connection. | Integer | 8250 ||
+ * || workers | # of worker threads | Integer | 5 || || router.ram.size | default ram for router vm in mb | Integer | 128 ||
+ * || router.ip.address | ip address for the router | ip | 10.1.1.1 ||
+ * || wait | Time to wait for control commands to return | seconds | 1800 ||
+ * || domain | domain for domain routers| String | foo.com ||
+ * || alert.wait | time to wait before alerting on a disconnected agent | seconds | 1800 ||
+ * || update.wait | time to wait before alerting on a updating agent | seconds | 600 ||
+ * || ping.interval | ping interval in seconds | seconds | 60 ||
+ * || instance.name | Name of the deployment String | required ||
+ * || start.retry | Number of times to retry start | Number | 2 ||
+ * || ping.timeout | multiplier to ping.interval before announcing an agent has timed out | float | 2.0x ||
+ * || router.stats.interval | interval to report router statistics | seconds | 300s || }
**/
@Local(value = { AgentManager.class })
-public class AgentManagerImpl extends ManagerBase implements AgentManager, HandlerFactory {
+public class AgentManagerImpl extends ManagerBase implements AgentManager, HandlerFactory, AttacheHandler {
private static final Logger s_logger = Logger.getLogger(AgentManagerImpl.class);
private static final Logger status_logger = Logger.getLogger(Status.class);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/server/src/com/cloud/configuration/Config.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 560a673,041f29a..a27c103
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@@ -3507,13 -3504,14 +3510,14 @@@ public class ConfigurationManagerImpl e
// A Public IP range can only be dedicated to one account at a time
if (_accountVlanMapDao.remove(acctVln.get(0).getId())) {
- // generate usage events to remove dedication for every ip in the
- // range
+ // generate usage events to remove dedication for every ip in the range that has been disassociated
for (IPAddressVO ip : ips) {
+ if (!ipsInUse.contains(ip)) {
- UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NET_IP_RELEASE, acctVln.get(0).getAccountId(), ip
- .getDataCenterId(), ip.getId(), ip.getAddress().toString(), ip.isSourceNat(), vlan
- .getVlanType().toString(), ip.getSystem(), ip.getClass().getName(), ip.getUuid());
- }
+ UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NET_IP_RELEASE, acctVln.get(0).getAccountId(), ip
+ .getDataCenterId(), ip.getId(), ip.getAddress().toString(), ip.isSourceNat(), vlan
+ .getVlanType().toString(), ip.getSystem(), ip.getClass().getName(), ip.getUuid());
+ }
+ }
// decrement resource count for dedicated public ip's
_resourceLimitMgr.decrementResourceCount(acctVln.get(0).getAccountId(), ResourceType.public_ip, new Long(
ips.size()));
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/server/src/com/cloud/network/rules/RulesManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/network/rules/RulesManagerImpl.java
index 41b9e09,0f733fb..ba1a443
--- a/server/src/com/cloud/network/rules/RulesManagerImpl.java
+++ b/server/src/com/cloud/network/rules/RulesManagerImpl.java
@@@ -160,8 -159,11 +160,11 @@@ public class RulesManagerImpl extends M
// validate that userVM is in the same availability zone as the IP address
if (ipAddress.getDataCenterId() != userVm.getDataCenterId()) {
+ //make an exception for portable IP
+ if (!ipAddress.isPortable()) {
- throw new InvalidParameterValueException("Unable to create ip forwarding rule, IP address " + ipAddress + " is not in the same availability zone as virtual machine " + userVm.toString());
- }
+ throw new InvalidParameterValueException("Unable to create ip forwarding rule, IP address " + ipAddress + " is not in the same availability zone as virtual machine " + userVm.toString());
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/server/src/com/cloud/network/vpc/VpcManagerImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/server/ManagementServerImpl.java
index fd0122c,40bc437..173973f
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@@ -515,8 -484,9 +515,9 @@@ import com.cloud.storage.GuestOSCategor
import com.cloud.storage.GuestOSVO;
import com.cloud.storage.GuestOsCategory;
import com.cloud.storage.Storage.ImageFormat;
++import com.cloud.storage.Storage.TemplateType;
import com.cloud.storage.StorageManager;
import com.cloud.storage.StoragePool;
-import com.cloud.storage.Storage.TemplateType;
import com.cloud.storage.VMTemplateVO;
import com.cloud.storage.Volume;
import com.cloud.storage.VolumeManager;
@@@ -1768,7 -1736,8 +1772,8 @@@ public class ManagementServerImpl exten
Boolean bootable = cmd.isBootable();
Integer sortKey = cmd.getSortKey();
Boolean isDynamicallyScalable = cmd.isDynamicallyScalable();
+ Boolean isRoutingTemplate = cmd.isRoutingType();
- Account account = UserContext.current().getCaller();
+ Account account = CallContext.current().getCallingAccount();
// verify that template exists
VMTemplateVO template = _templateDao.findById(id);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/server/src/com/cloud/template/TemplateAdapterBase.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/template/TemplateAdapterBase.java
index 8e01063,7835680..25b2984
--- a/server/src/com/cloud/template/TemplateAdapterBase.java
+++ b/server/src/com/cloud/template/TemplateAdapterBase.java
@@@ -106,18 -106,18 +106,18 @@@ public abstract class TemplateAdapterBa
Boolean isExtractable, String format, Long guestOSId, Long zoneId, HypervisorType hypervisorType,
String accountName, Long domainId, String chksum, Boolean bootable, Map details) throws ResourceAllocationException {
return prepare(isIso, userId, name, displayText, bits, passwordEnabled, requiresHVM, url, isPublic, featured, isExtractable, format, guestOSId, zoneId, hypervisorType,
- chksum, bootable, null, null, details, false, null, false);
+ chksum, bootable, null, null, details, false, null, false, TemplateType.USER);
}
-
+
@Override
- public TemplateProfile prepare(boolean isIso, long userId, String name, String displayText, Integer bits,
+ public TemplateProfile prepare(boolean isIso, long userId, String name, String displayText, Integer bits,
Boolean passwordEnabled, Boolean requiresHVM, String url, Boolean isPublic, Boolean featured,
Boolean isExtractable, String format, Long guestOSId, Long zoneId, HypervisorType hypervisorType,
String chksum, Boolean bootable, String templateTag, Account templateOwner, Map details, Boolean sshkeyEnabled,
- String imageStoreUuid, Boolean isDynamicallyScalable) throws ResourceAllocationException {
+ String imageStoreUuid, Boolean isDynamicallyScalable, TemplateType templateType) throws ResourceAllocationException {
//Long accountId = null;
// parameters verification
-
+
if (isPublic == null) {
isPublic = Boolean.FALSE;
}
@@@ -211,48 -211,51 +211,51 @@@
throw new IllegalArgumentException("Cannot use reserved names for templates");
}
}
-
+
Long id = _tmpltDao.getNextInSequence(Long.class, "id");
- UserContext.current().setEventDetails("Id: " +id+ " name: " + name);
- return new TemplateProfile(id, userId, name, displayText, bits, passwordEnabled, requiresHVM, url, isPublic,
+ CallContext.current().setEventDetails("Id: " +id+ " name: " + name);
+ return new TemplateProfile(id, userId, name, displayText, bits, passwordEnabled, requiresHVM, url, isPublic,
- featured, isExtractable, imgfmt, guestOSId, zoneId, hypervisorType, templateOwner.getAccountName(), templateOwner.getDomainId(), templateOwner.getAccountId(), chksum, bootable, templateTag, details, sshkeyEnabled, null, isDynamicallyScalable);
+ featured, isExtractable, imgfmt, guestOSId, zoneId, hypervisorType, templateOwner.getAccountName(), templateOwner.getDomainId(),
+ templateOwner.getAccountId(), chksum, bootable, templateTag, details, sshkeyEnabled, null, isDynamicallyScalable, templateType);
}
-
+
@Override
public TemplateProfile prepare(RegisterTemplateCmd cmd) throws ResourceAllocationException {
//check if the caller can operate with the template owner
- Account caller = UserContext.current().getCaller();
+ Account caller = CallContext.current().getCallingAccount();
Account owner = _accountMgr.getAccount(cmd.getEntityOwnerId());
_accountMgr.checkAccess(caller, null, true, owner);
+
-
-
- return prepare(false, UserContext.current().getCallerUserId(), cmd.getTemplateName(), cmd.getDisplayText(),
- cmd.getBits(), cmd.isPasswordEnabled(), cmd.getRequiresHvm(), cmd.getUrl(), cmd.isPublic(), cmd.isFeatured(),
- cmd.isExtractable(), cmd.getFormat(), cmd.getOsTypeId(), cmd.getZoneId(), HypervisorType.getType(cmd.getHypervisor()),
+
+ return prepare(false, CallContext.current().getCallingUserId(), cmd.getTemplateName(), cmd.getDisplayText(),
+ cmd.getBits(), cmd.isPasswordEnabled(), cmd.getRequiresHvm(), cmd.getUrl(), cmd.isPublic(), cmd.isFeatured(),
+ cmd.isExtractable(), cmd.getFormat(), cmd.getOsTypeId(), cmd.getZoneId(), HypervisorType.getType(cmd.getHypervisor()),
- cmd.getChecksum(), true, cmd.getTemplateTag(), owner, cmd.getDetails(), cmd.isSshKeyEnabled(), null, cmd.isDynamicallyScalable());
+ cmd.getChecksum(), true, cmd.getTemplateTag(), owner, cmd.getDetails(), cmd.isSshKeyEnabled(), null, cmd.isDynamicallyScalable(),
+ cmd.isRoutingType() ? TemplateType.ROUTING : TemplateType.USER);
}
@Override
- public TemplateProfile prepare(RegisterIsoCmd cmd) throws ResourceAllocationException {
+ public TemplateProfile prepare(RegisterIsoCmd cmd) throws ResourceAllocationException {
//check if the caller can operate with the template owner
- Account caller = UserContext.current().getCaller();
+ Account caller = CallContext.current().getCallingAccount();
Account owner = _accountMgr.getAccount(cmd.getEntityOwnerId());
_accountMgr.checkAccess(caller, null, true, owner);
-
- return prepare(true, UserContext.current().getCallerUserId(), cmd.getIsoName(), cmd.getDisplayText(), 64, false,
- true, cmd.getUrl(), cmd.isPublic(), cmd.isFeatured(), cmd.isExtractable(), ImageFormat.ISO.toString(), cmd.getOsTypeId(),
+
+ return prepare(true, CallContext.current().getCallingUserId(), cmd.getIsoName(), cmd.getDisplayText(), 64, false,
+ true, cmd.getUrl(), cmd.isPublic(), cmd.isFeatured(), cmd.isExtractable(), ImageFormat.ISO.toString(), cmd.getOsTypeId(),
- cmd.getZoneId(), HypervisorType.None, cmd.getChecksum(), cmd.isBootable(), null, owner, null, false, cmd.getImageStoreUuid(), cmd.isDynamicallyScalable());
+ cmd.getZoneId(), HypervisorType.None, cmd.getChecksum(), cmd.isBootable(), null, owner, null, false, cmd.getImageStoreUuid(), cmd.isDynamicallyScalable(),
+ TemplateType.USER);
}
-
+
protected VMTemplateVO persistTemplate(TemplateProfile profile) {
Long zoneId = profile.getZoneId();
VMTemplateVO template = new VMTemplateVO(profile.getTemplateId(), profile.getName(), profile.getFormat(), profile.getIsPublic(),
- profile.getFeatured(), profile.getIsExtractable(), TemplateType.USER, profile.getUrl(), profile.getRequiresHVM(),
+ profile.getFeatured(), profile.getIsExtractable(), profile.getTemplateType(), profile.getUrl(), profile.getRequiresHVM(),
profile.getBits(), profile.getAccountId(), profile.getCheckSum(), profile.getDisplayText(),
- profile.getPasswordEnabled(), profile.getGuestOsId(), profile.getBootable(), profile.getHypervisorType(), profile.getTemplateTag(),
+ profile.getPasswordEnabled(), profile.getGuestOsId(), profile.getBootable(), profile.getHypervisorType(), profile.getTemplateTag(),
profile.getDetails(), profile.getSshKeyEnabled());
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/server/src/com/cloud/template/TemplateManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/template/TemplateManagerImpl.java
index 2528b54,f70d44d..6f8f992
--- a/server/src/com/cloud/template/TemplateManagerImpl.java
+++ b/server/src/com/cloud/template/TemplateManagerImpl.java
@@@ -334,24 -347,29 +333,29 @@@ public class TemplateManagerImpl extend
@Override
@ActionEvent(eventType = EventTypes.EVENT_TEMPLATE_CREATE, eventDescription = "creating template")
public VirtualMachineTemplate registerTemplate(RegisterTemplateCmd cmd) throws URISyntaxException, ResourceAllocationException {
- Account account = UserContext.current().getCaller();
++ Account account = CallContext.current().getCallingAccount();
if (cmd.getTemplateTag() != null) {
- Account account = CallContext.current().getCallingAccount();
if (!_accountService.isRootAdmin(account.getType())) {
throw new PermissionDeniedException("Parameter templatetag can only be specified by a Root Admin, permission denied");
}
}
+ if(cmd.isRoutingType() != null){
+ if(!_accountService.isRootAdmin(account.getType())){
+ throw new PermissionDeniedException("Parameter isrouting can only be specified by a Root Admin, permission denied");
+ }
+ }
-
- TemplateAdapter adapter = getAdapter(HypervisorType.getType(cmd.getHypervisor()));
- TemplateProfile profile = adapter.prepare(cmd);
- VMTemplateVO template = adapter.create(profile);
-
+
+ TemplateAdapter adapter = getAdapter(HypervisorType.getType(cmd.getHypervisor()));
+ TemplateProfile profile = adapter.prepare(cmd);
+ VMTemplateVO template = adapter.create(profile);
+
if (template != null) {
- return template;
+ return template;
} else {
- throw new CloudRuntimeException("Failed to create a template");
+ throw new CloudRuntimeException("Failed to create a template");
}
}
-
+
@Override
public DataStore getImageStore(String storeUuid, Long zoneId) {
DataStore imageStore = null;
@@@ -803,9 -821,8 +807,8 @@@
@Override
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-
+
final Map<String, String> configs = _configDao.getConfiguration("AgentManager", params);
- _routerTemplateId = NumbersUtil.parseInt(configs.get("router.template.id"), 1);
String value = _configDao.getValue(Config.PrimaryStorageDownloadWait.toString());
_primaryStorageDownloadWait = NumbersUtil.parseInt(value, Integer.parseInt(Config.PrimaryStorageDownloadWait.getDefaultValue()));
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/vm/UserVmManagerImpl.java
index ae96297,3cef182..c9bd37c
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@@ -3374,10 -3388,9 +3374,9 @@@ public class UserVmManagerImpl extends
@Override
public void collectVmDiskStatistics (UserVmVO userVm) {
- // support KVM and XenServer only
- if (!userVm.getHypervisorType().equals(HypervisorType.XenServer)
- && !userVm.getHypervisorType().equals(HypervisorType.KVM))
+ // support KVM only util 2013.06.25
+ if (!userVm.getHypervisorType().equals(HypervisorType.KVM))
- return;
+ return;
// Collect vm disk statistics from host before stopping Vm
long hostId = userVm.getHostId();
List<String> vmNames = new ArrayList<String>();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/262352a1/utils/pom.xml
----------------------------------------------------------------------
[27/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-2835: VR Deployement from admin registered template is failing because registered template type is user. Additional parameter "isrouter" in register/update template API for the root admin. True if registered template is of type ROUTING.
Signed-off-by: Abhinandan Prateek <ap...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9385cf04
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9385cf04
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9385cf04
Branch: refs/heads/vmsync
Commit: 9385cf045359c9dd844548bdc701f4f614f37c68
Parents: 0d1f512
Author: Harikrishna Patnala <ha...@citrix.com>
Authored: Mon Jun 24 16:31:33 2013 +0530
Committer: Abhinandan Prateek <ap...@apache.org>
Committed: Wed Jun 26 16:00:12 2013 +0530
----------------------------------------------------------------------
api/src/com/cloud/storage/Storage.java | 1 +
.../org/apache/cloudstack/api/ApiConstants.java | 1 +
.../api/BaseUpdateTemplateOrIsoCmd.java | 7 +++++
.../user/template/RegisterTemplateCmd.java | 7 +++++
.../user/template/UpdateTemplateCmd.java | 1 +
.../cloud/storage/dao/VMTemplateDaoImpl.java | 19 ++++++++++++--
.../com/cloud/upgrade/dao/Upgrade410to420.java | 24 +++++++++++++++--
.../com/cloud/server/ManagementServerImpl.java | 20 ++++++++++++++-
.../src/com/cloud/storage/TemplateProfile.java | 12 ++++++++-
.../src/com/cloud/template/TemplateAdapter.java | 4 ++-
.../com/cloud/template/TemplateAdapterBase.java | 27 +++++++++++---------
.../com/cloud/template/TemplateManagerImpl.java | 7 ++++-
12 files changed, 110 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9385cf04/api/src/com/cloud/storage/Storage.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/Storage.java b/api/src/com/cloud/storage/Storage.java
index 16ef019..9a50ffa 100755
--- a/api/src/com/cloud/storage/Storage.java
+++ b/api/src/com/cloud/storage/Storage.java
@@ -85,6 +85,7 @@ public class Storage {
}
public static enum TemplateType {
+ ROUTING, // Router template
SYSTEM, /* routing, system vm template */
BUILTIN, /* buildin template */
PERHOST, /* every host has this template, don't need to install it in secondary storage */
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9385cf04/api/src/org/apache/cloudstack/api/ApiConstants.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java
index 8ac7c3f..809e023 100755
--- a/api/src/org/apache/cloudstack/api/ApiConstants.java
+++ b/api/src/org/apache/cloudstack/api/ApiConstants.java
@@ -511,6 +511,7 @@ public class ApiConstants {
public static final String ACL_ID = "aclid";
public static final String NUMBER = "number";
public static final String IS_DYNAMICALLY_SCALABLE = "isdynamicallyscalable";
+ public static final String ROUTING = "isrouting";
public enum HostDetails {
all, capacity, events, stats, min;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9385cf04/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java b/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
index b01c8d0..a4c5bfa 100644
--- a/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
@@ -57,6 +57,9 @@ public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd {
@Parameter(name = ApiConstants.IS_DYNAMICALLY_SCALABLE, type = CommandType.BOOLEAN, description = "true if template/ISO contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory")
private Boolean isDynamicallyScalable;
+ @Parameter(name = ApiConstants.ROUTING, type = CommandType.BOOLEAN, description = "true if the template type is routing i.e., if template is used to deploy router")
+ protected Boolean isRoutingType;
+
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -96,4 +99,8 @@ public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd {
public Boolean isDynamicallyScalable() {
return isDynamicallyScalable;
}
+
+ public Boolean isRoutingType() {
+ return isRoutingType;
+ }
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9385cf04/api/src/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java
index 6a8e555..13bd5da 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java
@@ -117,6 +117,9 @@ public class RegisterTemplateCmd extends BaseCmd {
@Parameter(name = ApiConstants.IS_DYNAMICALLY_SCALABLE, type = CommandType.BOOLEAN, description = "true if template contains XS/VMWare tools inorder to support dynamic scaling of VM cpu/memory")
protected Boolean isDynamicallyScalable;
+ @Parameter(name = ApiConstants.ROUTING, type = CommandType.BOOLEAN, description = "true if the template type is routing i.e., if template is used to deploy router")
+ protected Boolean isRoutingType;
+
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -208,6 +211,10 @@ public class RegisterTemplateCmd extends BaseCmd {
return isDynamicallyScalable == null ? false : isDynamicallyScalable;
}
+ public Boolean isRoutingType() {
+ return isRoutingType == null ? false : isRoutingType;
+ }
+
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9385cf04/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplateCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplateCmd.java
index 9f55f9d..b4149c0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplateCmd.java
@@ -70,6 +70,7 @@ public class UpdateTemplateCmd extends BaseUpdateTemplateOrIsoCmd {
if (result != null) {
TemplateResponse response = _responseGenerator.createTemplateUpdateResponse(result);
response.setObjectName("template");
+ response.setTemplateType(result.getTemplateType().toString());//Template can be either USER or ROUTING type
response.setResponseName(getCommandName());
this.setResponseObject(response);
} else {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9385cf04/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
index e7b85f8..ad33e7a 100755
--- a/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
@@ -790,7 +790,7 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implem
@Override
public VMTemplateVO findRoutingTemplate(HypervisorType hType, String templateName) {
SearchCriteria<VMTemplateVO> sc = tmpltTypeHyperSearch2.create();
- sc.setParameters("templateType", Storage.TemplateType.SYSTEM);
+ sc.setParameters("templateType", TemplateType.ROUTING);
sc.setParameters("hypervisorType", hType);
if (templateName != null) {
sc.setParameters("templateName", templateName);
@@ -803,7 +803,22 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implem
if (tmplts.size() > 0) {
return tmplts.get(0);
} else {
- return null;
+ sc = tmpltTypeHyperSearch2.create();
+ sc.setParameters("templateType", TemplateType.SYSTEM);
+ sc.setParameters("hypervisorType", hType);
+ if (templateName != null) {
+ sc.setParameters("templateName", templateName);
+ }
+
+ // order by descending order of id and select the first (this is going
+ // to be the latest)
+ tmplts = listBy(sc, new Filter(VMTemplateVO.class, "id", false, null, 1l));
+
+ if (tmplts.size() > 0) {
+ return tmplts.get(0);
+ } else {
+ return null;
+ }
}
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9385cf04/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
index 8f63a6c..c67a971 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
@@ -163,7 +163,7 @@ public class Upgrade410to420 implements DbUpgrade {
s_logger.debug("Updating XenSever System Vms");
//XenServer
try {
- //Get 4.2.0 xenserer system Vm template Id
+ //Get 4.2.0 XenServer system Vm template Id
pstmt = conn.prepareStatement("select id from `cloud`.`vm_template` where name like 'systemvm-xenserver-4.2' and removed is null order by id desc limit 1");
rs = pstmt.executeQuery();
if(rs.next()){
@@ -180,6 +180,10 @@ public class Upgrade410to420 implements DbUpgrade {
pstmt.setLong(1, templateId);
pstmt.executeUpdate();
pstmt.close();
+ // Change value of global configuration parameter router.template.xen
+ pstmt = conn.prepareStatement("INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'router.template.xen', 'systemvm-xenserver-4.2', 'Name of the default router template on Xenserver')");
+ pstmt.execute();
+ pstmt.close();
} else {
if (xenserver){
throw new CloudRuntimeException("4.2.0 XenServer SystemVm template not found. Cannot upgrade system Vms");
@@ -209,7 +213,11 @@ public class Upgrade410to420 implements DbUpgrade {
// update templete ID of system Vms
pstmt = conn.prepareStatement("update `cloud`.`vm_instance` set vm_template_id = ? where type <> 'User' and hypervisor_type = 'KVM'");
pstmt.setLong(1, templateId);
- pstmt.executeUpdate();
+ pstmt.execute();
+ pstmt.close();
+ // Change value of global configuration parameter router.template.kvm
+ pstmt = conn.prepareStatement("INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'router.template.kvm', 'systemvm-kvm-4.2', 'Name of the default router template on KVM')");
+ pstmt.execute();
pstmt.close();
} else {
if (kvm){
@@ -242,6 +250,10 @@ public class Upgrade410to420 implements DbUpgrade {
pstmt.setLong(1, templateId);
pstmt.executeUpdate();
pstmt.close();
+ // Change value of global configuration parameter router.template.vmware
+ pstmt = conn.prepareStatement("INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'router.template.vmware', 'systemvm-vmware-4.2', 'Name of the default router template on Vmware')");
+ pstmt.execute();
+ pstmt.close();
} else {
if (VMware){
throw new CloudRuntimeException("4.2.0 VMware SystemVm template not found. Cannot upgrade system Vms");
@@ -273,6 +285,10 @@ public class Upgrade410to420 implements DbUpgrade {
pstmt.setLong(1, templateId);
pstmt.executeUpdate();
pstmt.close();
+ // Change value of global configuration parameter router.template.hyperv
+ pstmt = conn.prepareStatement("INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'router.template.hyperv', 'systemvm-hyperv-4.2', 'Name of the default router template on Hyperv')");
+ pstmt.execute();
+ pstmt.close();
} else {
if (Hyperv){
throw new CloudRuntimeException("4.2.0 HyperV SystemVm template not found. Cannot upgrade system Vms");
@@ -304,6 +320,10 @@ public class Upgrade410to420 implements DbUpgrade {
pstmt.setLong(1, templateId);
pstmt.executeUpdate();
pstmt.close();
+ // Change value of global configuration parameter router.template.lxc
+ pstmt = conn.prepareStatement("INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'router.template.lxc', 'systemvm-lxc-4.2', 'Name of the default router template on LXC')");
+ pstmt.execute();
+ pstmt.close();
} else {
if (LXC){
throw new CloudRuntimeException("4.2.0 LXC SystemVm template not found. Cannot upgrade system Vms");
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9385cf04/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index 97bac1b..40bc437 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -486,6 +486,7 @@ import com.cloud.storage.GuestOsCategory;
import com.cloud.storage.Storage.ImageFormat;
import com.cloud.storage.StorageManager;
import com.cloud.storage.StoragePool;
+import com.cloud.storage.Storage.TemplateType;
import com.cloud.storage.VMTemplateVO;
import com.cloud.storage.Volume;
import com.cloud.storage.VolumeManager;
@@ -506,6 +507,7 @@ import com.cloud.tags.dao.ResourceTagDao;
import com.cloud.template.TemplateManager;
import com.cloud.user.Account;
import com.cloud.user.AccountManager;
+import com.cloud.user.AccountService;
import com.cloud.user.SSHKeyPair;
import com.cloud.user.SSHKeyPairVO;
import com.cloud.user.User;
@@ -679,6 +681,8 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
UserVmManager _userVmMgr;
@Inject
VolumeDataFactory _volFactory;
+ @Inject
+ AccountService _accountService;
private final ScheduledExecutorService _eventExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("EventChecker"));
private final ScheduledExecutorService _alertExecutor = Executors.newScheduledThreadPool(1, new NamedThreadFactory("AlertChecker"));
@@ -1732,6 +1736,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
Boolean bootable = cmd.isBootable();
Integer sortKey = cmd.getSortKey();
Boolean isDynamicallyScalable = cmd.isDynamicallyScalable();
+ Boolean isRoutingTemplate = cmd.isRoutingType();
Account account = UserContext.current().getCaller();
// verify that template exists
@@ -1752,8 +1757,13 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
// do a permission check
_accountMgr.checkAccess(account, AccessType.ModifyEntry, true, template);
+ if(cmd.isRoutingType() != null){
+ if(!_accountService.isRootAdmin(account.getType())){
+ throw new PermissionDeniedException("Parameter isrouting can only be specified by a Root Admin, permission denied");
+ }
+ }
boolean updateNeeded = !(name == null && displayText == null && format == null && guestOSId == null && passwordEnabled == null
- && bootable == null && sortKey == null && isDynamicallyScalable == null);
+ && bootable == null && sortKey == null && isDynamicallyScalable == null && isRoutingTemplate == null);
if (!updateNeeded) {
return template;
}
@@ -1806,6 +1816,14 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
template.setDynamicallyScalable(isDynamicallyScalable);
}
+ if (isRoutingTemplate != null) {
+ if (isRoutingTemplate) {
+ template.setTemplateType(TemplateType.ROUTING);
+ } else {
+ template.setTemplateType(TemplateType.USER);
+ }
+ }
+
_templateDao.update(id, template);
return _templateDao.findById(id);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9385cf04/server/src/com/cloud/storage/TemplateProfile.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/TemplateProfile.java b/server/src/com/cloud/storage/TemplateProfile.java
index 00aab4d..e87a805 100755
--- a/server/src/com/cloud/storage/TemplateProfile.java
+++ b/server/src/com/cloud/storage/TemplateProfile.java
@@ -20,6 +20,7 @@ import java.util.Map;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.storage.Storage.ImageFormat;
+import com.cloud.storage.Storage.TemplateType;
public class TemplateProfile {
Long userId;
@@ -47,6 +48,7 @@ public class TemplateProfile {
String templateTag;
Map details;
Boolean isDynamicallyScalable;
+ TemplateType templateType;
public TemplateProfile(Long templateId, Long userId, String name, String displayText, Integer bits, Boolean passwordEnabled, Boolean requiresHvm,
@@ -86,11 +88,12 @@ public class TemplateProfile {
String url, Boolean isPublic, Boolean featured, Boolean isExtractable, ImageFormat format, Long guestOsId, Long zoneId,
HypervisorType hypervisorType, String accountName, Long domainId, Long accountId, String chksum, Boolean bootable, String templateTag, Map details, Boolean sshKeyEnabled,
- Long imageStoreId, Boolean isDynamicallyScalable) {
+ Long imageStoreId, Boolean isDynamicallyScalable, TemplateType templateType) {
this(templateId, userId, name, displayText, bits, passwordEnabled, requiresHvm, url, isPublic, featured, isExtractable, format, guestOsId, zoneId,
hypervisorType, accountName, domainId, accountId, chksum, bootable, details, sshKeyEnabled);
this.templateTag = templateTag;
this.isDynamicallyScalable = isDynamicallyScalable;
+ this.templateType = templateType;
}
public Long getTemplateId() {
@@ -265,4 +268,11 @@ public class TemplateProfile {
this.isDynamicallyScalable = isDynamicallyScalabe;
}
+ public TemplateType getTemplateType() {
+ return templateType;
+ }
+
+ public void setTemplateType(TemplateType templateType) {
+ this.templateType = templateType;
+ }
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9385cf04/server/src/com/cloud/template/TemplateAdapter.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateAdapter.java b/server/src/com/cloud/template/TemplateAdapter.java
index d50d45b..17c6347 100755
--- a/server/src/com/cloud/template/TemplateAdapter.java
+++ b/server/src/com/cloud/template/TemplateAdapter.java
@@ -28,6 +28,7 @@ import com.cloud.exception.ResourceAllocationException;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.storage.TemplateProfile;
import com.cloud.storage.VMTemplateVO;
+import com.cloud.storage.Storage.TemplateType;
import com.cloud.user.Account;
import com.cloud.utils.component.Adapter;
@@ -69,6 +70,7 @@ public interface TemplateAdapter extends Adapter {
public TemplateProfile prepare(boolean isIso, long userId, String name, String displayText, Integer bits,
Boolean passwordEnabled, Boolean requiresHVM, String url, Boolean isPublic, Boolean featured,
Boolean isExtractable, String format, Long guestOSId, Long zoneId, HypervisorType hypervisorType,
- String chksum, Boolean bootable, String templateTag, Account templateOwner, Map details, Boolean sshKeyEnabled, String imageStoreUuid, Boolean isDynamicallyScalable) throws ResourceAllocationException;
+ String chksum, Boolean bootable, String templateTag, Account templateOwner, Map details, Boolean sshKeyEnabled,
+ String imageStoreUuid, Boolean isDynamicallyScalable, TemplateType templateType) throws ResourceAllocationException;
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9385cf04/server/src/com/cloud/template/TemplateAdapterBase.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateAdapterBase.java b/server/src/com/cloud/template/TemplateAdapterBase.java
index c1f0604..7835680 100755
--- a/server/src/com/cloud/template/TemplateAdapterBase.java
+++ b/server/src/com/cloud/template/TemplateAdapterBase.java
@@ -106,7 +106,7 @@ public abstract class TemplateAdapterBase extends AdapterBase implements Templat
Boolean isExtractable, String format, Long guestOSId, Long zoneId, HypervisorType hypervisorType,
String accountName, Long domainId, String chksum, Boolean bootable, Map details) throws ResourceAllocationException {
return prepare(isIso, userId, name, displayText, bits, passwordEnabled, requiresHVM, url, isPublic, featured, isExtractable, format, guestOSId, zoneId, hypervisorType,
- chksum, bootable, null, null, details, false, null, false);
+ chksum, bootable, null, null, details, false, null, false, TemplateType.USER);
}
@Override
@@ -114,7 +114,7 @@ public abstract class TemplateAdapterBase extends AdapterBase implements Templat
Boolean passwordEnabled, Boolean requiresHVM, String url, Boolean isPublic, Boolean featured,
Boolean isExtractable, String format, Long guestOSId, Long zoneId, HypervisorType hypervisorType,
String chksum, Boolean bootable, String templateTag, Account templateOwner, Map details, Boolean sshkeyEnabled,
- String imageStoreUuid, Boolean isDynamicallyScalable) throws ResourceAllocationException {
+ String imageStoreUuid, Boolean isDynamicallyScalable, TemplateType templateType) throws ResourceAllocationException {
//Long accountId = null;
// parameters verification
@@ -214,8 +214,9 @@ public abstract class TemplateAdapterBase extends AdapterBase implements Templat
Long id = _tmpltDao.getNextInSequence(Long.class, "id");
UserContext.current().setEventDetails("Id: " +id+ " name: " + name);
- return new TemplateProfile(id, userId, name, displayText, bits, passwordEnabled, requiresHVM, url, isPublic,
- featured, isExtractable, imgfmt, guestOSId, zoneId, hypervisorType, templateOwner.getAccountName(), templateOwner.getDomainId(), templateOwner.getAccountId(), chksum, bootable, templateTag, details, sshkeyEnabled, null, isDynamicallyScalable);
+ return new TemplateProfile(id, userId, name, displayText, bits, passwordEnabled, requiresHVM, url, isPublic,
+ featured, isExtractable, imgfmt, guestOSId, zoneId, hypervisorType, templateOwner.getAccountName(), templateOwner.getDomainId(),
+ templateOwner.getAccountId(), chksum, bootable, templateTag, details, sshkeyEnabled, null, isDynamicallyScalable, templateType);
}
@@ -228,10 +229,11 @@ public abstract class TemplateAdapterBase extends AdapterBase implements Templat
- return prepare(false, UserContext.current().getCallerUserId(), cmd.getTemplateName(), cmd.getDisplayText(),
- cmd.getBits(), cmd.isPasswordEnabled(), cmd.getRequiresHvm(), cmd.getUrl(), cmd.isPublic(), cmd.isFeatured(),
- cmd.isExtractable(), cmd.getFormat(), cmd.getOsTypeId(), cmd.getZoneId(), HypervisorType.getType(cmd.getHypervisor()),
- cmd.getChecksum(), true, cmd.getTemplateTag(), owner, cmd.getDetails(), cmd.isSshKeyEnabled(), null, cmd.isDynamicallyScalable());
+ return prepare(false, UserContext.current().getCallerUserId(), cmd.getTemplateName(), cmd.getDisplayText(),
+ cmd.getBits(), cmd.isPasswordEnabled(), cmd.getRequiresHvm(), cmd.getUrl(), cmd.isPublic(), cmd.isFeatured(),
+ cmd.isExtractable(), cmd.getFormat(), cmd.getOsTypeId(), cmd.getZoneId(), HypervisorType.getType(cmd.getHypervisor()),
+ cmd.getChecksum(), true, cmd.getTemplateTag(), owner, cmd.getDetails(), cmd.isSshKeyEnabled(), null, cmd.isDynamicallyScalable(),
+ cmd.isRoutingType() ? TemplateType.ROUTING : TemplateType.USER);
}
@@ -242,15 +244,16 @@ public abstract class TemplateAdapterBase extends AdapterBase implements Templat
Account owner = _accountMgr.getAccount(cmd.getEntityOwnerId());
_accountMgr.checkAccess(caller, null, true, owner);
- return prepare(true, UserContext.current().getCallerUserId(), cmd.getIsoName(), cmd.getDisplayText(), 64, false,
- true, cmd.getUrl(), cmd.isPublic(), cmd.isFeatured(), cmd.isExtractable(), ImageFormat.ISO.toString(), cmd.getOsTypeId(),
- cmd.getZoneId(), HypervisorType.None, cmd.getChecksum(), cmd.isBootable(), null, owner, null, false, cmd.getImageStoreUuid(), cmd.isDynamicallyScalable());
+ return prepare(true, UserContext.current().getCallerUserId(), cmd.getIsoName(), cmd.getDisplayText(), 64, false,
+ true, cmd.getUrl(), cmd.isPublic(), cmd.isFeatured(), cmd.isExtractable(), ImageFormat.ISO.toString(), cmd.getOsTypeId(),
+ cmd.getZoneId(), HypervisorType.None, cmd.getChecksum(), cmd.isBootable(), null, owner, null, false, cmd.getImageStoreUuid(), cmd.isDynamicallyScalable(),
+ TemplateType.USER);
}
protected VMTemplateVO persistTemplate(TemplateProfile profile) {
Long zoneId = profile.getZoneId();
VMTemplateVO template = new VMTemplateVO(profile.getTemplateId(), profile.getName(), profile.getFormat(), profile.getIsPublic(),
- profile.getFeatured(), profile.getIsExtractable(), TemplateType.USER, profile.getUrl(), profile.getRequiresHVM(),
+ profile.getFeatured(), profile.getIsExtractable(), profile.getTemplateType(), profile.getUrl(), profile.getRequiresHVM(),
profile.getBits(), profile.getAccountId(), profile.getCheckSum(), profile.getDisplayText(),
profile.getPasswordEnabled(), profile.getGuestOsId(), profile.getBootable(), profile.getHypervisorType(), profile.getTemplateTag(),
profile.getDetails(), profile.getSshKeyEnabled());
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9385cf04/server/src/com/cloud/template/TemplateManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java
index cbf70fa..f70d44d 100755
--- a/server/src/com/cloud/template/TemplateManagerImpl.java
+++ b/server/src/com/cloud/template/TemplateManagerImpl.java
@@ -347,12 +347,17 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
@Override
@ActionEvent(eventType = EventTypes.EVENT_TEMPLATE_CREATE, eventDescription = "creating template")
public VirtualMachineTemplate registerTemplate(RegisterTemplateCmd cmd) throws URISyntaxException, ResourceAllocationException {
+ Account account = UserContext.current().getCaller();
if (cmd.getTemplateTag() != null) {
- Account account = UserContext.current().getCaller();
if (!_accountService.isRootAdmin(account.getType())) {
throw new PermissionDeniedException("Parameter templatetag can only be specified by a Root Admin, permission denied");
}
}
+ if(cmd.isRoutingType() != null){
+ if(!_accountService.isRootAdmin(account.getType())){
+ throw new PermissionDeniedException("Parameter isrouting can only be specified by a Root Admin, permission denied");
+ }
+ }
TemplateAdapter adapter = getAdapter(HypervisorType.getType(cmd.getHypervisor()));
TemplateProfile profile = adapter.prepare(cmd);
[14/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-3194 fix stratosphere ssp plugin packaging
stratosphere-ssp plugin maven pom.xml has some bad settings
and client pom.xml requred dependency for it.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/39ef9240
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/39ef9240
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/39ef9240
Branch: refs/heads/vmsync
Commit: 39ef9240e87234afc2d4ddb37beaa63fe3240e4a
Parents: 6fdd0ee
Author: Hiroaki KAWAI <ka...@stratosphere.co.jp>
Authored: Wed Jun 26 12:36:01 2013 +0900
Committer: Hiroaki KAWAI <ka...@stratosphere.co.jp>
Committed: Wed Jun 26 12:36:01 2013 +0900
----------------------------------------------------------------------
client/pom.xml | 7 ++++++-
plugins/network-elements/stratosphere-ssp/pom.xml | 2 --
2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/39ef9240/client/pom.xml
----------------------------------------------------------------------
diff --git a/client/pom.xml b/client/pom.xml
index 24f51fb..ffa5ec7 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -90,7 +90,12 @@
<artifactId>cloud-plugin-network-midonet</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
+ <dependency>
+ <groupId>org.apache.cloudstack</groupId>
+ <artifactId>cloud-plugin-network-ssp</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-network-internallb</artifactId>
<version>${project.version}</version>
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/39ef9240/plugins/network-elements/stratosphere-ssp/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/network-elements/stratosphere-ssp/pom.xml b/plugins/network-elements/stratosphere-ssp/pom.xml
index a8d7ce5..cec1ff8 100644
--- a/plugins/network-elements/stratosphere-ssp/pom.xml
+++ b/plugins/network-elements/stratosphere-ssp/pom.xml
@@ -19,9 +19,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>jp.co.stratosphere.cloudstack</groupId>
<artifactId>cloud-plugin-network-ssp</artifactId>
- <packaging>jar</packaging>
<name>Apache Cloudstack Plugin - Stratosphere SSP</name>
<url>http://www.stratosphere.co.jp/</url>
<parent>
[25/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-2794: Global parameter "router.template.id" should be removed The parameter was not in use. We use zone/global coonfigutaion parameters router.template.xenserver/vmware/hyperv/kvm/lxc to deploy router
Signed-off-by: Abhinandan Prateek <ap...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ec2bf092
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ec2bf092
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ec2bf092
Branch: refs/heads/vmsync
Commit: ec2bf092847a12f0f29c26a01ecfc6add90fedb2
Parents: ea7b446
Author: Harikrishna Patnala <ha...@citrix.com>
Authored: Tue Jun 25 12:43:31 2013 +0530
Committer: Abhinandan Prateek <ap...@apache.org>
Committed: Wed Jun 26 15:56:40 2013 +0530
----------------------------------------------------------------------
.../cloud/agent/manager/AgentManagerImpl.java | 23 +++++++++++---------
server/src/com/cloud/configuration/Config.java | 1 -
.../com/cloud/template/TemplateManagerImpl.java | 2 --
setup/db/db/schema-410to420.sql | 1 +
4 files changed, 14 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec2bf092/server/src/com/cloud/agent/manager/AgentManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/agent/manager/AgentManagerImpl.java b/server/src/com/cloud/agent/manager/AgentManagerImpl.java
index fb857a7..b24a238 100755
--- a/server/src/com/cloud/agent/manager/AgentManagerImpl.java
+++ b/server/src/com/cloud/agent/manager/AgentManagerImpl.java
@@ -126,16 +126,19 @@ import edu.emory.mathcs.backport.java.util.Collections;
/**
* Implementation of the Agent Manager. This class controls the connection to the agents.
*
- * @config {@table || Param Name | Description | Values | Default || || port | port to listen on for agent connection. | Integer
- * | 8250 || || workers | # of worker threads | Integer | 5 || || router.template.id | default id for template | Integer
- * | 1 || || router.ram.size | default ram for router vm in mb | Integer | 128 || || router.ip.address | ip address for
- * the router | ip | 10.1.1.1 || || wait | Time to wait for control commands to return | seconds | 1800 || || domain |
- * domain for domain routers| String | foo.com || || alert.wait | time to wait before alerting on a disconnected agent |
- * seconds | 1800 || || update.wait | time to wait before alerting on a updating agent | seconds | 600 || ||
- * ping.interval | ping interval in seconds | seconds | 60 || || instance.name | Name of the deployment String |
- * required || || start.retry | Number of times to retry start | Number | 2 || || ping.timeout | multiplier to
- * ping.interval before announcing an agent has timed out | float | 2.0x || || router.stats.interval | interval to
- * report router statistics | seconds | 300s || * }
+ * @config {@table || Param Name | Description | Values | Default ||
+ * || port | port to listen on for agent connection. | Integer | 8250 ||
+ * || workers | # of worker threads | Integer | 5 || || router.ram.size | default ram for router vm in mb | Integer | 128 ||
+ * || router.ip.address | ip address for the router | ip | 10.1.1.1 ||
+ * || wait | Time to wait for control commands to return | seconds | 1800 ||
+ * || domain | domain for domain routers| String | foo.com ||
+ * || alert.wait | time to wait before alerting on a disconnected agent | seconds | 1800 ||
+ * || update.wait | time to wait before alerting on a updating agent | seconds | 600 ||
+ * || ping.interval | ping interval in seconds | seconds | 60 ||
+ * || instance.name | Name of the deployment String | required ||
+ * || start.retry | Number of times to retry start | Number | 2 ||
+ * || ping.timeout | multiplier to ping.interval before announcing an agent has timed out | float | 2.0x ||
+ * || router.stats.interval | interval to report router statistics | seconds | 300s || }
**/
@Local(value = { AgentManager.class })
public class AgentManagerImpl extends ManagerBase implements AgentManager, HandlerFactory {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec2bf092/server/src/com/cloud/configuration/Config.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java
index 3a6d3aa..ba50849 100755
--- a/server/src/com/cloud/configuration/Config.java
+++ b/server/src/com/cloud/configuration/Config.java
@@ -175,7 +175,6 @@ public enum Config {
ExternalNetworkStatsInterval("Advanced", NetworkManager.class, Integer.class, "external.network.stats.interval", "300", "Interval (in seconds) to report external network statistics.", null),
RouterCheckInterval("Advanced", NetworkManager.class, Integer.class, "router.check.interval", "30", "Interval (in seconds) to report redundant router status.", null),
RouterCheckPoolSize("Advanced", NetworkManager.class, Integer.class, "router.check.poolsize", "10", "Numbers of threads using to check redundant router status.", null),
- RouterTemplateId("Advanced", NetworkManager.class, Long.class, "router.template.id", "1", "Default ID for template.", null),
RouterTemplateXen("Advanced", NetworkManager.class, String.class, "router.template.xen", "SystemVM Template (XenServer)", "Name of the default router template on Xenserver.", null, ConfigurationParameterScope.zone.toString()),
RouterTemplateKVM("Advanced", NetworkManager.class, String.class, "router.template.kvm", "SystemVM Template (KVM)", "Name of the default router template on KVM.", null, ConfigurationParameterScope.zone.toString()),
RouterTemplateVmware("Advanced", NetworkManager.class, String.class, "router.template.vmware", "SystemVM Template (vSphere)", "Name of the default router template on Vmware.", null, ConfigurationParameterScope.zone.toString()),
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec2bf092/server/src/com/cloud/template/TemplateManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java
index 273614c..cbf70fa 100755
--- a/server/src/com/cloud/template/TemplateManagerImpl.java
+++ b/server/src/com/cloud/template/TemplateManagerImpl.java
@@ -257,7 +257,6 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
UploadDao _uploadDao;
@Inject
protected GuestOSDao _guestOSDao;
- long _routerTemplateId = -1;
@Inject
StorageManager _storageMgr;
@Inject
@@ -819,7 +818,6 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
final Map<String, String> configs = _configDao.getConfiguration("AgentManager", params);
- _routerTemplateId = NumbersUtil.parseInt(configs.get("router.template.id"), 1);
String value = _configDao.getValue(Config.PrimaryStorageDownloadWait.toString());
_primaryStorageDownloadWait = NumbersUtil.parseInt(value, Integer.parseInt(Config.PrimaryStorageDownloadWait.getDefaultValue()));
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ec2bf092/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index d2add32..2d0f8de 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -30,6 +30,7 @@ INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(uuid, hypervisor_type, hype
UPDATE `cloud`.`hypervisor_capabilities` SET `storage_motion_supported`=true WHERE id=16;
UPDATE `cloud`.`hypervisor_capabilities` SET `storage_motion_supported`=true WHERE id=11;
DELETE FROM `cloud`.`configuration` where name='vmware.percluster.host.max';
+DELETE FROM `cloud`.`configuration` where name='router.template.id';
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'AgentManager', 'xen.nics.max', '7', 'Maximum allowed nics for Vms created on Xen');
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'midonet.apiserver.address', 'http://localhost:8081', 'Specify the address at which the Midonet API server can be contacted (if using Midonet)');
INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'midonet.providerrouter.id', 'd7c5e6a3-e2f4-426b-b728-b7ce6a0448e5', 'Specifies the UUID of the Midonet provider router (if using Midonet)');
[03/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-3003 Fixed static route issue in vpc vmware
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1ab87ef4
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1ab87ef4
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1ab87ef4
Branch: refs/heads/vmsync
Commit: 1ab87ef4bed8ba53eb2dd5f7aa422b2bf0c8e13c
Parents: 49ab93c
Author: Jayapal <ja...@apache.org>
Authored: Tue Jun 25 18:37:40 2013 +0530
Committer: Jayapal <ja...@apache.org>
Committed: Tue Jun 25 18:43:00 2013 +0530
----------------------------------------------------------------------
.../vmware/resource/VmwareResource.java | 50 ++++++++++++++++++++
1 file changed, 50 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1ab87ef4/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index 5040443..32e28d1 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -165,6 +165,8 @@ import com.cloud.agent.api.routing.SetSourceNatAnswer;
import com.cloud.agent.api.routing.SetSourceNatCommand;
import com.cloud.agent.api.routing.SetStaticNatRulesAnswer;
import com.cloud.agent.api.routing.SetStaticNatRulesCommand;
+import com.cloud.agent.api.routing.SetStaticRouteAnswer;
+import com.cloud.agent.api.routing.SetStaticRouteCommand;
import com.cloud.agent.api.routing.Site2SiteVpnCfgCommand;
import com.cloud.agent.api.routing.VmDataCommand;
import com.cloud.agent.api.routing.VpnUsersCfgCommand;
@@ -541,6 +543,8 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
return execute((ScaleVmCommand) cmd);
} else if (clz == PvlanSetupCommand.class) {
return execute((PvlanSetupCommand) cmd);
+ } else if (clz == SetStaticRouteCommand.class) {
+ answer = execute((SetStaticRouteCommand) cmd);
} else {
answer = Answer.createUnsupportedCommandAnswer(cmd);
}
@@ -656,6 +660,52 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
return answer;
}
+ private SetStaticRouteAnswer execute(SetStaticRouteCommand cmd) {
+ if (s_logger.isInfoEnabled()) {
+ s_logger.info("Executing resource SetStaticRouteCommand: " + _gson.toJson(cmd));
+ }
+
+ boolean endResult = true;
+
+ String controlIp = getRouterSshControlIp(cmd);
+ String args = "";
+ String[] results = new String[cmd.getStaticRoutes().length];
+ int i = 0;
+
+ // Extract and build the arguments for the command to be sent to the VR.
+ String [][] rules = cmd.generateSRouteRules();
+ StringBuilder sb = new StringBuilder();
+ String[] srRules = rules[0];
+ for (int j = 0; j < srRules.length; j++) {
+ sb.append(srRules[j]).append(',');
+ }
+ args += " -a " + sb.toString();
+
+ // Send over the command for execution, via ssh, to the VR.
+ try {
+ VmwareManager mgr = getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME);
+ Pair<Boolean, String> result = SshHelper.sshExecute(controlIp, DEFAULT_DOMR_SSHPORT, "root", mgr.getSystemVMKeyFile(), null,
+ "/opt/cloud/bin/vpc_staticroute.sh " + args);
+
+ if (s_logger.isDebugEnabled())
+ s_logger.debug("Executing script on domain router " + controlIp + ": /opt/cloud/bin/vpc_staticroute.sh " + args);
+
+ if (!result.first()) {
+ s_logger.error("SetStaticRouteCommand failure on setting one rule. args: " + args);
+ results[i++] = "Failed";
+ endResult = false;
+ } else {
+ results[i++] = null;
+ }
+ } catch (Throwable e) {
+ s_logger.error("SetStaticRouteCommand(args: " + args + ") failed on setting one rule due to " + VmwareHelper.getExceptionMessage(e), e);
+ results[i++] = "Failed";
+ endResult = false;
+ }
+ return new SetStaticRouteAnswer(cmd, endResult, results);
+
+ }
+
protected NetworkUsageAnswer VPCNetworkUsage(NetworkUsageCommand cmd) {
String privateIp = cmd.getPrivateIP();
String option = cmd.getOption();
[31/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-3213: ResourceStateEvents for user VM are generated with
entity type as Network
changing entity type to be VirtualMachine from Network for the events
generated by user vm state transitions
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/4bc62947
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4bc62947
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4bc62947
Branch: refs/heads/vmsync
Commit: 4bc62947464c9a062c9513e5cff3a9a96416e0a0
Parents: ff16713
Author: Murali Reddy <mu...@gmail.com>
Authored: Wed Jun 26 19:33:24 2013 +0530
Committer: Murali Reddy <mu...@gmail.com>
Committed: Wed Jun 26 19:33:24 2013 +0530
----------------------------------------------------------------------
server/src/com/cloud/vm/UserVmStateListener.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4bc62947/server/src/com/cloud/vm/UserVmStateListener.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmStateListener.java b/server/src/com/cloud/vm/UserVmStateListener.java
index 3feecbb..d270e60 100644
--- a/server/src/com/cloud/vm/UserVmStateListener.java
+++ b/server/src/com/cloud/vm/UserVmStateListener.java
@@ -104,7 +104,7 @@ public class UserVmStateListener implements StateListener<State, VirtualMachine.
return; // no provider is configured to provide events bus, so just return
}
- String resourceName = getEntityFromClassName(Network.class.getName());
+ String resourceName = getEntityFromClassName(VirtualMachine.class.getName());
org.apache.cloudstack.framework.events.Event eventMsg = new org.apache.cloudstack.framework.events.Event(
ManagementServer.Name,
EventCategory.RESOURCE_STATE_CHANGE_EVENT.getName(),
[04/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-1766 VmWare DVS vmware.ports.per.dvportgroup setting not used
Read the global configuration setting while configuring VmwareManager.
Also enabling autoExpand feature for supported distributed virtual switch versions.
Signed-off-by: Sateesh Chodapuneedi <sa...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b3927ffe
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b3927ffe
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b3927ffe
Branch: refs/heads/vmsync
Commit: b3927ffe966a278dd70777ddf13fa08859f5916b
Parents: 1ab87ef
Author: Sateesh Chodapuneedi <sa...@apache.org>
Authored: Tue Jun 25 19:15:24 2013 +0530
Committer: Sateesh Chodapuneedi <sa...@apache.org>
Committed: Tue Jun 25 19:15:24 2013 +0530
----------------------------------------------------------------------
.../vmware/manager/VmwareManagerImpl.java | 3 ++-
.../vmware/mo/HypervisorHostHelper.java | 26 ++++++++++++++++----
2 files changed, 23 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3927ffe/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
index 68acd9e..77a95a4 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
@@ -115,7 +115,7 @@ import com.cloud.vm.DomainRouterVO;
import com.google.gson.Gson;
import com.vmware.vim25.AboutInfo;
import com.vmware.vim25.HostConnectSpec;
-import com.vmware.vim25.ManagedObjectReference;;
+import com.vmware.vim25.ManagedObjectReference;
@Local(value = {VmwareManager.class, VmwareDatacenterService.class})
@@ -227,6 +227,7 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw
} else {
_fullCloneFlag = Boolean.parseBoolean(value);
}
+ _portsPerDvPortGroup = NumbersUtil.parseInt(_configDao.getValue(Config.VmwarePortsPerDVPortGroup.key()), _portsPerDvPortGroup);
_serviceConsoleName = _configDao.getValue(Config.VmwareServiceConsole.key());
if(_serviceConsoleName == null) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b3927ffe/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
index 157c7a6..3739058 100755
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
@@ -438,6 +438,9 @@ public class HypervisorHostHelper {
String dvSwitchName = null;
boolean bWaitPortGroupReady = false;
boolean createGCTag = false;
+ String vcApiVersion;
+ String minVcApiVersionSupportingAutoExpand;
+ boolean autoExpandSupported;
String networkName;
Integer vid = null;
Integer spvlanid = null; // secondary pvlan id
@@ -462,6 +465,9 @@ public class HypervisorHostHelper {
DVPortgroupConfigSpec dvPortGroupSpec;
DVPortgroupConfigInfo dvPortgroupInfo;
//DVSConfigInfo dvsInfo;
+ vcApiVersion = getVcenterApiVersion(context);
+ minVcApiVersionSupportingAutoExpand = "5.0";
+ autoExpandSupported = isFeatureSupportedInVcenterApiVersion(vcApiVersion, minVcApiVersionSupportingAutoExpand);
dvSwitchName = physicalNetwork;
// TODO(sateesh): Remove this after ensuring proper default value for vSwitchName throughout traffic types
@@ -571,7 +577,7 @@ public class HypervisorHostHelper {
dvsPortSetting = createVmwareDVPortSettingSpec(shapingPolicy, secPolicy, vlanSpec);
}
- dvPortGroupSpec = createDvPortGroupSpec(networkName, dvsPortSetting, numPorts);
+ dvPortGroupSpec = createDvPortGroupSpec(networkName, dvsPortSetting, numPorts, autoExpandSupported);
if (!dataCenterMo.hasDvPortGroup(networkName)) {
s_logger.info("Distributed Virtual Port group " + networkName + " not found.");
@@ -656,6 +662,18 @@ public class HypervisorHostHelper {
return new Pair<ManagedObjectReference, String>(morNetwork, networkName);
}
+ public static String getVcenterApiVersion(VmwareContext serviceContext) throws Exception {
+ String vcApiVersion = null;
+ if (serviceContext != null) {
+ vcApiVersion = serviceContext.getServiceContent().getAbout().getApiVersion();
+ }
+ return vcApiVersion;
+ }
+
+ public static boolean isFeatureSupportedInVcenterApiVersion(String vCenterApiVersion, String minVcenterApiVersionForFeature) {
+ return vCenterApiVersion.compareTo(minVcenterApiVersionForFeature) >= 0 ? true : false;
+ }
+
public static ManagedObjectReference waitForDvPortGroupReady(
DatacenterMO dataCenterMo, String dvPortGroupName, long timeOutMs) throws Exception {
ManagedObjectReference morDvPortGroup = null;
@@ -710,16 +728,14 @@ public class HypervisorHostHelper {
return true;
}
- public static DVPortgroupConfigSpec createDvPortGroupSpec(String dvPortGroupName, DVPortSetting portSetting, int numPorts) {
+ public static DVPortgroupConfigSpec createDvPortGroupSpec(String dvPortGroupName, DVPortSetting portSetting, int numPorts, boolean autoExpandSupported) {
DVPortgroupConfigSpec spec = new DVPortgroupConfigSpec();
spec.setName(dvPortGroupName);
spec.setDefaultPortConfig(portSetting);
spec.setPortNameFormat("vnic<portIndex>");
spec.setType("earlyBinding");
spec.setNumPorts(numPorts);
- // TODO(sateesh): Get vSphere API version and
- // if >= 5.0 set autoExpand property of dvPortGroup config spec to true.
- // spec.setAutoExpand(true);
+ spec.setAutoExpand(autoExpandSupported);
return spec;
}
[09/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
Setting the required version of libvirt to 10.0 for the openvswitch
support. This version actually supports setting the vlan tag on an
interface.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f74e6352
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f74e6352
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f74e6352
Branch: refs/heads/vmsync
Commit: f74e635225c1241054985c8911be59233b747f60
Parents: 881a6e1
Author: Hugo Trippaers <ht...@schubergphilis.com>
Authored: Thu Jun 20 08:11:05 2013 -0700
Committer: Hugo Trippaers <ht...@schubergphilis.com>
Committed: Tue Jun 25 12:21:25 2013 -0700
----------------------------------------------------------------------
.../cloud/hypervisor/kvm/resource/LibvirtComputingResource.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f74e6352/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
----------------------------------------------------------------------
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 60cde8c..b1bc99d 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
@@ -722,8 +722,8 @@ ServerResource {
conn = LibvirtConnection.getConnection();
if (_bridgeType == BridgeType.OPENVSWITCH) {
- if (conn.getLibVirVersion() < (9 * 1000 + 11)) {
- throw new ConfigurationException("LibVirt version 0.9.11 required for openvswitch support, but version "
+ if (conn.getLibVirVersion() < (10 * 1000 + 0)) {
+ throw new ConfigurationException("LibVirt version 0.10.0 required for openvswitch support, but version "
+ conn.getLibVirVersion() + " detected");
}
}
[12/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-3130: UI > VPC section - Enable Static NAT - Select VM for static NAT- show no VMs when no tier is selected.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/774141a9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/774141a9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/774141a9
Branch: refs/heads/vmsync
Commit: 774141a9dcdec7af7fde7114d4a78404d20f416f
Parents: fc93b68
Author: Jessica Wang <je...@apache.org>
Authored: Tue Jun 25 16:36:42 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Tue Jun 25 16:36:42 2013 -0700
----------------------------------------------------------------------
ui/scripts/network.js | 12 +++++---
ui/scripts/vpc.js | 68 +---------------------------------------------
2 files changed, 9 insertions(+), 71 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/774141a9/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index fbd8b01..c52b85a 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -2155,11 +2155,15 @@
return;
}
- if('vpc' in args.context) {
- if($tierSelect.size() && $tierSelect.val() != '-1' ){
- data.networkid = $tierSelect.val();
- }
+ // if no tier is selected
+ if($tierSelect.val() == '-1'){
+ args.response.success({ data: null });
+ return;
+ }
+
+ if('vpc' in args.context) {
$.extend(data, {
+ networkid: $tierSelect.val(),
vpcid: args.context.vpc[0].id
});
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/774141a9/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index ca02c77..f610889 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -471,73 +471,7 @@
detailView: {
isMaximized: true,
name: 'Internal LB details',
- actions: {
- /*
- assignVm: {
- label: 'Assign VMs to Internal LB',
- messages: {
- notification: function(args) { return 'Assign VMs to Internal LB'; }
- },
- listView: $.extend(true, {}, cloudStack.sections.instances.listView, {
- type: 'checkbox',
- filters: false,
- dataProvider: function(args) {
- $.ajax({
- url: createURL('listVirtualMachines'),
- data: {
- networkid: args.context.networks[0].id,
- listAll: true
- },
- success: function(json) {
- var instances = json.listvirtualmachinesresponse.virtualmachine;
-
- // Pre-select existing instances in LB rule
- $(instances).map(function(index, instance) {
- instance._isSelected = $.grep(
- args.context.internalLoadBalancers[0].loadbalancerinstance,
-
- function(lbInstance) {
- return lbInstance.id == instance.id;
- }
- ).length ? true : false;
- });
-
- args.response.success({
- data: instances
- });
- }
- });
- }
- }),
- action: function(args) {
- var vms = args.context.instances;
- var array1 = [];
- for(var i = 0; i < vms.length; i++) {
- array1.push(vms[i].id);
- }
- var virtualmachineids = array1.join(',');
-
- $.ajax({
- url: createURL('assignToLoadBalancerRule'),
- data: {
- id: args.context.internalLoadBalancers[0].id,
- virtualmachineids: virtualmachineids
- },
- dataType: 'json',
- async: true,
- success: function(data) {
- var jid = data.assigntoloadbalancerruleresponse.jobid;
- args.response.success({
- _custom: { jobId: jid }
- });
- }
- });
- },
- notification: {
- poll: pollAsyncJobResult
- }
- },
- */
+ actions: {
remove: {
label: 'Delete Internal LB',
messages: {
[35/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CreateVPC: validate that the zone exists before checking its attributes
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/079f9204
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/079f9204
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/079f9204
Branch: refs/heads/vmsync
Commit: 079f9204941594505bb1ae4dffac2b5e68f13540
Parents: 7e96bf5
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Wed Jun 26 15:25:53 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Wed Jun 26 15:26:20 2013 -0700
----------------------------------------------------------------------
server/src/com/cloud/network/vpc/VpcManagerImpl.java | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/079f9204/server/src/com/cloud/network/vpc/VpcManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
index 93413b4..b2cb333 100644
--- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java
+++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
@@ -595,6 +595,10 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
//Validate zone
DataCenter zone = _configMgr.getZone(zoneId);
+ if (zone == null) {
+ throw new InvalidParameterValueException("Can't find zone by id specified");
+ }
+
if (Grouping.AllocationState.Disabled == zone.getAllocationState() && !_accountMgr.isRootAdmin(caller.getType())) {
// See DataCenterVO.java
PermissionDeniedException ex = new PermissionDeniedException("Cannot perform this operation since specified Zone is currently disabled");
[16/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-3192. When a dedicated public ip range is released, don't generate usage event EVENT_NET_IP_RELEASE
for ips in the range that are in use becauase these ips are not disassociated from the account.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8a1fefc7
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8a1fefc7
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8a1fefc7
Branch: refs/heads/vmsync
Commit: 8a1fefc7aa9290c654859b58f85682126eb7c36a
Parents: 4b3c012
Author: Likitha Shetty <li...@citrix.com>
Authored: Thu Jun 20 15:49:44 2013 +0530
Committer: Likitha Shetty <li...@citrix.com>
Committed: Wed Jun 26 10:51:39 2013 +0530
----------------------------------------------------------------------
.../cloud/configuration/ConfigurationManagerImpl.java | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8a1fefc7/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 704162e..48728f7 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -3471,6 +3471,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
long allocIpCount = _publicIpAddressDao.countIPs(vlan.getDataCenterId(), vlanDbId, true);
List<IPAddressVO> ips = _publicIpAddressDao.listByVlanId(vlanDbId);
boolean success = true;
+ List<IPAddressVO> ipsInUse = new ArrayList<IPAddressVO>();
if (allocIpCount > 0) {
try {
vlan = _vlanDao.acquireInLockTable(vlanDbId, 30);
@@ -3488,6 +3489,8 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
+ " as part of Public IP" + " range release to the system pool");
}
success = success && _networkMgr.disassociatePublicIpAddress(ip.getId(), userId, caller);
+ } else {
+ ipsInUse.add(ip);
}
}
if (!success) {
@@ -3501,12 +3504,13 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
// A Public IP range can only be dedicated to one account at a time
if (_accountVlanMapDao.remove(acctVln.get(0).getId())) {
- // generate usage events to remove dedication for every ip in the
- // range
+ // generate usage events to remove dedication for every ip in the range that has been disassociated
for (IPAddressVO ip : ips) {
- UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NET_IP_RELEASE, acctVln.get(0).getAccountId(), ip
- .getDataCenterId(), ip.getId(), ip.getAddress().toString(), ip.isSourceNat(), vlan
- .getVlanType().toString(), ip.getSystem(), ip.getClass().getName(), ip.getUuid());
+ if (!ipsInUse.contains(ip)) {
+ UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NET_IP_RELEASE, acctVln.get(0).getAccountId(), ip
+ .getDataCenterId(), ip.getId(), ip.getAddress().toString(), ip.isSourceNat(), vlan
+ .getVlanType().toString(), ip.getSystem(), ip.getClass().getName(), ip.getUuid());
+ }
}
// decrement resource count for dedicated public ip's
_resourceLimitMgr.decrementResourceCount(acctVln.get(0).getAccountId(), ResourceType.public_ip, new Long(
[46/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
Fix reviewboard messup of python indentation
Signed-off-by: Prasanna Santhanam <ts...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8dc99d92
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8dc99d92
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8dc99d92
Branch: refs/heads/vmsync
Commit: 8dc99d92b6f82e435610dfcc01d3458a99503119
Parents: 2af6db2
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Wed Jun 26 17:12:54 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Thu Jun 27 20:30:36 2013 +0530
----------------------------------------------------------------------
test/integration/smoke/test_routers.py | 64 ++++++++++++++---------------
1 file changed, 32 insertions(+), 32 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8dc99d92/test/integration/smoke/test_routers.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_routers.py b/test/integration/smoke/test_routers.py
index 2e4553b..6fa08e0 100644
--- a/test/integration/smoke/test_routers.py
+++ b/test/integration/smoke/test_routers.py
@@ -171,7 +171,7 @@ class TestRouterServices(cloudstackTestCase):
"Check list host returns a valid list"
)
host = hosts[0]
-
+
self.debug("Router ID: %s, state: %s" % (router.id, router.state))
self.assertEqual(
@@ -180,32 +180,32 @@ class TestRouterServices(cloudstackTestCase):
"Check list router response for router state"
)
- if self.apiclient.hypervisor.lower() == 'vmware':
- result = get_process_status(
- self.apiclient.connection.mgtSvr,
- 22,
- self.apiclient.connection.user,
- self.apiclient.connection.passwd,
- router.linklocalip,
- "service dnsmasq status",
- hypervisor=self.apiclient.hypervisor
- )
- else:
- result = get_process_status(
- host.ipaddress,
- self.services['virtual_machine']["publicport"],
- self.vm_1.username,
- self.vm_1.password,
- router.linklocalip,
- "service dnsmasq status"
- )
- res = str(result)
- self.debug("Dnsmasq process status: %s" % res)
+ if self.apiclient.hypervisor.lower() == 'vmware':
+ result = get_process_status(
+ self.apiclient.connection.mgtSvr,
+ 22,
+ self.apiclient.connection.user,
+ self.apiclient.connection.passwd,
+ router.linklocalip,
+ "service dnsmasq status",
+ hypervisor=self.apiclient.hypervisor
+ )
+ else:
+ result = get_process_status(
+ host.ipaddress,
+ self.services['virtual_machine']["publicport"],
+ self.vm_1.username,
+ self.vm_1.password,
+ router.linklocalip,
+ "service dnsmasq status"
+ )
+ res = str(result)
+ self.debug("Dnsmasq process status: %s" % res)
- self.assertEqual(
- res.count("running"),
- 1,
- "Check dnsmasq service is running or not"
+ self.assertEqual(
+ res.count("running"),
+ 1,
+ "Check dnsmasq service is running or not"
)
return
@@ -253,7 +253,7 @@ class TestRouterServices(cloudstackTestCase):
"Check list router response for router state"
)
- if self.apiclient.hypervisor.lower() == 'vmware':
+ if self.apiclient.hypervisor.lower() == 'vmware':
result = get_process_status(
self.apiclient.connection.mgtSvr,
22,
@@ -263,7 +263,7 @@ class TestRouterServices(cloudstackTestCase):
"service dnsmasq status",
hypervisor=self.apiclient.hypervisor
)
- else:
+ else:
result = get_process_status(
host.ipaddress,
self.services['virtual_machine']["publicport"],
@@ -281,7 +281,7 @@ class TestRouterServices(cloudstackTestCase):
"Check dnsmasq service is running or not"
)
- if self.apiclient.hypervisor.lower() == 'vmware':
+ if self.apiclient.hypervisor.lower() == 'vmware':
result = get_process_status(
self.apiclient.connection.mgtSvr,
22,
@@ -291,7 +291,7 @@ class TestRouterServices(cloudstackTestCase):
"service haproxy status",
hypervisor=self.apiclient.hypervisor
)
- else:
+ else:
result = get_process_status(
host.ipaddress,
self.services['virtual_machine']["publicport"],
@@ -456,7 +456,7 @@ class TestRouterServices(cloudstackTestCase):
)
host = hosts[0]
- if self.apiclient.hypervisor.lower() == 'vmware':
+ if self.apiclient.hypervisor.lower() == 'vmware':
res = get_process_status(
self.apiclient.connection.mgtSvr,
22,
@@ -466,7 +466,7 @@ class TestRouterServices(cloudstackTestCase):
"uptime",
hypervisor=self.apiclient.hypervisor
)
- else:
+ else:
res = get_process_status(
host.ipaddress,
self.services['virtual_machine']["publicport"],
[24/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-3050
XS - Enforce recommended guest OS values for ram
Signed off by : nitin mehta<ni...@citrix.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ea7b4467
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ea7b4467
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ea7b4467
Branch: refs/heads/vmsync
Commit: ea7b4467d74496de97eef16415a78382758076f4
Parents: f90279d
Author: Nitin Mehta <ni...@citrix.com>
Authored: Wed Jun 26 15:35:06 2013 +0530
Committer: Nitin Mehta <ni...@citrix.com>
Committed: Wed Jun 26 15:45:57 2013 +0530
----------------------------------------------------------------------
.../hypervisor/xen/resource/CitrixHelper.java | 254 +++++++------------
1 file changed, 92 insertions(+), 162 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ea7b4467/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java
index 8eb6b7e..c557631 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java
@@ -416,7 +416,7 @@ public class CitrixHelper {
_xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32*1024l));
_xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16*1024l));
_xenServer56FP1GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128*1024l));
- _xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));// ??
+ // _xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));// ??
_xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", new MemoryValues(512l, 16*1024l));
_xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", new MemoryValues(512l, 128*1024l));
_xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", new MemoryValues(512l, 16*1024l));
@@ -428,22 +428,22 @@ public class CitrixHelper {
_xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (32-bit)", new MemoryValues(512l, 16*1024l));
_xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (64-bit)", new MemoryValues(512l, 128*1024l));
_xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128*1024l)); //?
- _xenServer56FP1GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer56FP1GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer56FP1GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer56FP1GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 (32-bit)", new MemoryValues(256l, 64*1024l));
- _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 (64-bit)", new MemoryValues(256l, 128*1024l));
- _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 PAE (32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(64-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(64-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(64-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2008 (32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer56FP1GuestOsMemoryMap.put("Windows Server 2008 (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128*1024l)); //?
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 (32-bit)", new MemoryValues(256l, 64*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 (64-bit)", new MemoryValues(256l, 128*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 PAE (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2008 (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2008 (64-bit)", new MemoryValues(512l, 16*1024l));
_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2008 R2 (64-bit)", new MemoryValues(512l, 16*1024l));
_xenServer56FP1GuestOsMemoryMap.put("Windows Server 2012 (64-bit)", new MemoryValues(512l, 16*1024l));
_xenServer56FP1GuestOsMemoryMap.put("Windows Server 8 (64-bit)", new MemoryValues(512l, 16*1024l));
@@ -451,8 +451,8 @@ public class CitrixHelper {
_xenServer56FP1GuestOsMemoryMap.put("Windows XP SP3 (32-bit)", new MemoryValues(512l, 16*1024l));
_xenServer56FP1GuestOsMemoryMap.put("Ubuntu 10.04 (32-bit)", new MemoryValues(128l, 512l));
_xenServer56FP1GuestOsMemoryMap.put("Ubuntu 10.04 (64-bit)", new MemoryValues(128l, 32*1024l));
- _xenServer56FP1GuestOsMemoryMap.put("Ubuntu 10.10 (32-bit)", new MemoryValues(512l, 16*1024l));//?
- _xenServer56FP1GuestOsMemoryMap.put("Ubuntu 10.10 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ // _xenServer56FP1GuestOsMemoryMap.put("Ubuntu 10.10 (32-bit)", new MemoryValues(512l, 16*1024l));//?
+ //_xenServer56FP1GuestOsMemoryMap.put("Ubuntu 10.10 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
_xenServer56FP1GuestOsMemoryMap.put("Ubuntu 12.04 (32-bit)", new MemoryValues(128l, 32*1024l));
_xenServer56FP1GuestOsMemoryMap.put("Ubuntu 12.04 (64-bit)", new MemoryValues(128l, 128*1024l));
// _xenServer56FP1GuestOsMemoryMap.put("Other Linux (32-bit)", new MemoryValues(512l, 16*1024l));
@@ -622,7 +622,7 @@ public class CitrixHelper {
_xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32*1024l));
_xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16*1024l));
_xenServer56SP2GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128*1024l));
- _xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));// ??
+ //_xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));// ??
_xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", new MemoryValues(512l, 16*1024l));
_xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", new MemoryValues(512l, 128*1024l));
_xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", new MemoryValues(512l, 16*1024l));
@@ -634,22 +634,22 @@ public class CitrixHelper {
_xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (32-bit)", new MemoryValues(512l, 16*1024l));
_xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (64-bit)", new MemoryValues(512l, 128*1024l));
_xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128*1024l)); //?
- _xenServer56SP2GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer56SP2GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer56SP2GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer56SP2GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 (32-bit)", new MemoryValues(256l, 64*1024l));
- _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 (64-bit)", new MemoryValues(256l, 128*1024l));
- _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 PAE (32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(64-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(64-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(64-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2008 (32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2008 (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128*1024l)); //?
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ // _xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 (32-bit)", new MemoryValues(256l, 64*1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 (64-bit)", new MemoryValues(256l, 128*1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 PAE (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2008 (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2008 (64-bit)", new MemoryValues(512l, 16*1024l));
_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2008 R2 (64-bit)", new MemoryValues(512l, 16*1024l));
_xenServer56SP2GuestOsMemoryMap.put("Windows Server 2012 (64-bit)", new MemoryValues(512l, 16*1024l));
_xenServer56SP2GuestOsMemoryMap.put("Windows Server 8 (64-bit)", new MemoryValues(512l, 16*1024l));
@@ -657,8 +657,8 @@ public class CitrixHelper {
_xenServer56SP2GuestOsMemoryMap.put("Windows XP SP3 (32-bit)", new MemoryValues(512l, 16*1024l));
_xenServer56SP2GuestOsMemoryMap.put("Ubuntu 10.04 (32-bit)", new MemoryValues(128l, 512l));
_xenServer56SP2GuestOsMemoryMap.put("Ubuntu 10.04 (64-bit)", new MemoryValues(128l, 32*1024l));
- _xenServer56SP2GuestOsMemoryMap.put("Ubuntu 10.10 (32-bit)", new MemoryValues(512l, 16*1024l));//?
- _xenServer56SP2GuestOsMemoryMap.put("Ubuntu 10.10 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer56SP2GuestOsMemoryMap.put("Ubuntu 10.10 (32-bit)", new MemoryValues(512l, 16*1024l));//?
+ //_xenServer56SP2GuestOsMemoryMap.put("Ubuntu 10.10 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
_xenServer56SP2GuestOsMemoryMap.put("Ubuntu 12.04 (32-bit)", new MemoryValues(128l, 32*1024l));
_xenServer56SP2GuestOsMemoryMap.put("Ubuntu 12.04 (64-bit)", new MemoryValues(128l, 128*1024l));
// _xenServer56SP2GuestOsMemoryMap.put("Other Linux (32-bit)", new MemoryValues(512l, 16*1024l));
@@ -859,7 +859,7 @@ public class CitrixHelper {
_xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32*1024l));
_xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16*1024l));
_xenServer600GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128*1024l));
- _xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));// ??
+ //_xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));// ??
_xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", new MemoryValues(512l, 16*1024l));
_xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", new MemoryValues(512l, 128*1024l));
_xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", new MemoryValues(512l, 16*1024l));
@@ -871,22 +871,22 @@ public class CitrixHelper {
_xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (32-bit)", new MemoryValues(512l, 16*1024l));
_xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (64-bit)", new MemoryValues(512l, 128*1024l));
_xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128*1024l)); //?
- _xenServer600GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer600GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer600GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer600GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer600GuestOsMemoryMap.put("Windows Server 2003 (32-bit)", new MemoryValues(256l, 64*1024l));
- _xenServer600GuestOsMemoryMap.put("Windows Server 2003 (64-bit)", new MemoryValues(256l, 128*1024l));
- _xenServer600GuestOsMemoryMap.put("Windows Server 2003 PAE (32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer600GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer600GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(64-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer600GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer600GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(64-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer600GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer600GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(64-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer600GuestOsMemoryMap.put("Windows Server 2008 (32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer600GuestOsMemoryMap.put("Windows Server 2008 (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128*1024l)); //?
+ //_xenServer600GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer600GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer600GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer600GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ // _xenServer600GuestOsMemoryMap.put("Windows Server 2003 (32-bit)", new MemoryValues(256l, 64*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Windows Server 2003 (64-bit)", new MemoryValues(256l, 128*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Windows Server 2003 PAE (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Windows Server 2008 (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer600GuestOsMemoryMap.put("Windows Server 2008 (64-bit)", new MemoryValues(512l, 16*1024l));
_xenServer600GuestOsMemoryMap.put("Windows Server 2008 R2 (64-bit)", new MemoryValues(512l, 16*1024l));
_xenServer600GuestOsMemoryMap.put("Windows Server 2012 (64-bit)", new MemoryValues(512l, 16*1024l));
_xenServer600GuestOsMemoryMap.put("Windows Server 8 (64-bit)", new MemoryValues(512l, 16*1024l));
@@ -894,8 +894,8 @@ public class CitrixHelper {
_xenServer600GuestOsMemoryMap.put("Windows XP SP3 (32-bit)", new MemoryValues(512l, 16*1024l));
_xenServer600GuestOsMemoryMap.put("Ubuntu 10.04 (32-bit)", new MemoryValues(128l, 512l));
_xenServer600GuestOsMemoryMap.put("Ubuntu 10.04 (64-bit)", new MemoryValues(128l, 32*1024l));
- _xenServer600GuestOsMemoryMap.put("Ubuntu 10.10 (32-bit)", new MemoryValues(512l, 16*1024l));//?
- _xenServer600GuestOsMemoryMap.put("Ubuntu 10.10 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer600GuestOsMemoryMap.put("Ubuntu 10.10 (32-bit)", new MemoryValues(512l, 16*1024l));//?
+ //_xenServer600GuestOsMemoryMap.put("Ubuntu 10.10 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
_xenServer600GuestOsMemoryMap.put("Ubuntu 12.04 (32-bit)", new MemoryValues(128l, 32*1024l));
_xenServer600GuestOsMemoryMap.put("Ubuntu 12.04 (64-bit)", new MemoryValues(128l, 128*1024l));
//_xenServer600GuestOsMemoryMap.put("Other Linux (32-bit)", new MemoryValues(512l, 16*1024l));
@@ -1106,7 +1106,7 @@ public class CitrixHelper {
_xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.1 (64-bit)", new MemoryValues(512l, 32*1024l));
_xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (32-bit)", new MemoryValues(512l, 16*1024l));
_xenServer602GuestOsMemoryMap.put("Red Hat Enterprise Linux 6.2 (64-bit)", new MemoryValues(512l, 128*1024l));
- _xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));// ??
+ // _xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 9 SP4 (32-bit)", new MemoryValues(512l, 16*1024l));// ??
_xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (32-bit)", new MemoryValues(512l, 16*1024l));
_xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP1 (64-bit)", new MemoryValues(512l, 128*1024l));
_xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 10 SP2 (32-bit)", new MemoryValues(512l, 16*1024l));
@@ -1118,22 +1118,22 @@ public class CitrixHelper {
_xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (32-bit)", new MemoryValues(512l, 16*1024l));
_xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 (64-bit)", new MemoryValues(512l, 128*1024l));
_xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128*1024l)); //?
- _xenServer602GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer602GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer602GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer602GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer602GuestOsMemoryMap.put("Windows Server 2003 (32-bit)", new MemoryValues(256l, 64*1024l));
- _xenServer602GuestOsMemoryMap.put("Windows Server 2003 (64-bit)", new MemoryValues(256l, 128*1024l));
- _xenServer602GuestOsMemoryMap.put("Windows Server 2003 PAE (32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer602GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer602GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(64-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer602GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer602GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(64-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer602GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer602GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(64-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer602GuestOsMemoryMap.put("Windows Server 2008 (32-bit)", new MemoryValues(512l, 16*1024l));
- _xenServer602GuestOsMemoryMap.put("Windows Server 2008 (64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer602GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128*1024l)); //?
+ //_xenServer602GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer602GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer602GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer602GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2003 (32-bit)", new MemoryValues(256l, 64*1024l));
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2003 (64-bit)", new MemoryValues(256l, 128*1024l));
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2003 PAE (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(64-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2008 (32-bit)", new MemoryValues(512l, 16*1024l));
+ //_xenServer602GuestOsMemoryMap.put("Windows Server 2008 (64-bit)", new MemoryValues(512l, 16*1024l));
_xenServer602GuestOsMemoryMap.put("Windows Server 2008 R2 (64-bit)", new MemoryValues(512l, 16*1024l));
_xenServer602GuestOsMemoryMap.put("Windows Server 2012 (64-bit)", new MemoryValues(512l, 16*1024l));
_xenServer602GuestOsMemoryMap.put("Windows Server 8 (64-bit)", new MemoryValues(512l, 16*1024l));
@@ -1141,8 +1141,8 @@ public class CitrixHelper {
_xenServer602GuestOsMemoryMap.put("Windows XP SP3 (32-bit)", new MemoryValues(512l, 16*1024l));
_xenServer602GuestOsMemoryMap.put("Ubuntu 10.04 (32-bit)", new MemoryValues(128l, 512l));
_xenServer602GuestOsMemoryMap.put("Ubuntu 10.04 (64-bit)", new MemoryValues(128l, 32*1024l));
- _xenServer602GuestOsMemoryMap.put("Ubuntu 10.10 (32-bit)", new MemoryValues(512l, 16*1024l));//?
- _xenServer602GuestOsMemoryMap.put("Ubuntu 10.10 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer602GuestOsMemoryMap.put("Ubuntu 10.10 (32-bit)", new MemoryValues(512l, 16*1024l));//?
+ //_xenServer602GuestOsMemoryMap.put("Ubuntu 10.10 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
_xenServer602GuestOsMemoryMap.put("Ubuntu 12.04 (32-bit)", new MemoryValues(128l, 32*1024l));
_xenServer602GuestOsMemoryMap.put("Ubuntu 12.04 (64-bit)", new MemoryValues(128l, 128*1024l));
// _xenServer602GuestOsMemoryMap.put("Other Linux (32-bit)", new MemoryValues(512l, 16*1024l));
@@ -1403,28 +1403,28 @@ public class CitrixHelper {
_xenServer610GuestOsMemoryMap.put("SUSE Linux Enterprise Server 11 SP1 (64-bit)", new MemoryValues(512l, 128*1024l));
_xenServer610GuestOsMemoryMap.put("Windows 7 (32-bit)", new MemoryValues(1024l, 4*1024l));
_xenServer610GuestOsMemoryMap.put("Windows 7 (64-bit)", new MemoryValues(2*1024l, 128*1024l));
- _xenServer610GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer610GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer610GuestOsMemoryMap.put("Windows Server 2003 (32-bit)", new MemoryValues(256l, 64*1024l)); //?
- _xenServer610GuestOsMemoryMap.put("Windows Server 2003 (64-bit)", new MemoryValues(256l, 128*1024l)); //?
- _xenServer610GuestOsMemoryMap.put("Windows Server 2003 PAE (32-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer610GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(32-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer610GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(64-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer610GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(32-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer610GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(64-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer610GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(32-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer610GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(64-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer610GuestOsMemoryMap.put("Windows Server 2008 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
- _xenServer610GuestOsMemoryMap.put("Windows Server 2008 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows 8 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows 8 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2003 (32-bit)", new MemoryValues(256l, 64*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2003 (64-bit)", new MemoryValues(256l, 128*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2003 PAE (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2003 Enterprise Edition(64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2003 DataCenter Edition(64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2003 Standard Edition(64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2008 (32-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2008 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
_xenServer610GuestOsMemoryMap.put("Windows Server 2008 R2 (64-bit)", new MemoryValues(512l, 128*1024l));
- _xenServer610GuestOsMemoryMap.put("Windows Server 2012 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Windows Server 2012 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
_xenServer610GuestOsMemoryMap.put("Windows Server 8 (64-bit)", new MemoryValues(512l, 16*1024l));
_xenServer610GuestOsMemoryMap.put("Windows Vista (32-bit)", new MemoryValues(1024l, 4*1024l));
_xenServer610GuestOsMemoryMap.put("Windows XP SP3 (32-bit)", new MemoryValues(256l, 4*1024l));
_xenServer610GuestOsMemoryMap.put("Ubuntu 10.04 (32-bit)", new MemoryValues(128l, 512l));
_xenServer610GuestOsMemoryMap.put("Ubuntu 10.04 (64-bit)", new MemoryValues(128l, 32*1024l));
- _xenServer610GuestOsMemoryMap.put("Ubuntu 10.10 (32-bit)", new MemoryValues(512l, 16*1024l));//?
- _xenServer610GuestOsMemoryMap.put("Ubuntu 10.10 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
+ //_xenServer610GuestOsMemoryMap.put("Ubuntu 10.10 (32-bit)", new MemoryValues(512l, 16*1024l));//?
+ //_xenServer610GuestOsMemoryMap.put("Ubuntu 10.10 (64-bit)", new MemoryValues(512l, 16*1024l)); //?
_xenServer610GuestOsMemoryMap.put("Ubuntu 12.04 (32-bit)", new MemoryValues(128l, 32*1024l));
_xenServer610GuestOsMemoryMap.put("Ubuntu 12.04 (64-bit)", new MemoryValues(128l, 128*1024l));
// _xenServer610GuestOsMemoryMap.put("Other Linux (32-bit)", new MemoryValues(512l, 16*1024l));
@@ -1492,13 +1492,6 @@ public class CitrixHelper {
public static long getXenServer56FP1StaticMax(String stdType, boolean bootFromCD) {
MemoryValues recommendedMaxMinMemory = _xenServer56FP1GuestOsMemoryMap.get(stdType);
if (recommendedMaxMinMemory == null) {
- /*if ( !bootFromCD ) {
- s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 FP1 guestOS type, start it as HVM guest");
- guestOS = "Other install media";
- } else {
- String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
- s_logger.warn(msg);
- }*/
return 0l;
}
return recommendedMaxMinMemory.getMax();
@@ -1507,13 +1500,6 @@ public class CitrixHelper {
public static long getXenServer56FP1StaticMin(String stdType, boolean bootFromCD) {
MemoryValues recommendedMaxMinMemory = _xenServer56FP1GuestOsMemoryMap.get(stdType);
if (recommendedMaxMinMemory == null) {
- /*if ( !bootFromCD ) {
- s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 FP1 guestOS type, start it as HVM guest");
- guestOS = "Other install media";
- } else {
- String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
- s_logger.warn(msg);
- }*/
return 0l;
}
return recommendedMaxMinMemory.getMin();
@@ -1536,13 +1522,6 @@ public class CitrixHelper {
public static long getXenServer56SP2StaticMax(String stdType, boolean bootFromCD) {
MemoryValues recommendedMaxMinMemory = _xenServer56SP2GuestOsMemoryMap.get(stdType);
if (recommendedMaxMinMemory == null) {
- /*if ( !bootFromCD ) {
- s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 FP1 guestOS type, start it as HVM guest");
- guestOS = "Other install media";
- } else {
- String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
- s_logger.warn(msg);
- }*/
return 0l;
}
return recommendedMaxMinMemory.getMax();
@@ -1551,13 +1530,6 @@ public class CitrixHelper {
public static long getXenServer56SP2StaticMin(String stdType, boolean bootFromCD) {
MemoryValues recommendedMaxMinMemory = _xenServer56SP2GuestOsMemoryMap.get(stdType);
if (recommendedMaxMinMemory == null) {
- /*if ( !bootFromCD ) {
- s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 FP1 guestOS type, start it as HVM guest");
- guestOS = "Other install media";
- } else {
- String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
- s_logger.warn(msg);
- }*/
return 0l;
}
return recommendedMaxMinMemory.getMin();
@@ -1581,13 +1553,6 @@ public class CitrixHelper {
public static long getXenServer600StaticMax(String stdType, boolean bootFromCD) {
MemoryValues recommendedMaxMinMemory = _xenServer600GuestOsMemoryMap.get(stdType);
if (recommendedMaxMinMemory == null) {
- /*if ( !bootFromCD ) {
- s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 FP1 guestOS type, start it as HVM guest");
- guestOS = "Other install media";
- } else {
- String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
- s_logger.warn(msg);
- }*/
return 0l;
}
return recommendedMaxMinMemory.getMax();
@@ -1596,13 +1561,6 @@ public class CitrixHelper {
public static long getXenServer600StaticMin(String stdType, boolean bootFromCD) {
MemoryValues recommendedMaxMinMemory = _xenServer600GuestOsMemoryMap.get(stdType);
if (recommendedMaxMinMemory == null) {
- /*if ( !bootFromCD ) {
- s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 FP1 guestOS type, start it as HVM guest");
- guestOS = "Other install media";
- } else {
- String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
- s_logger.warn(msg);
- }*/
return 0l;
}
return recommendedMaxMinMemory.getMin();
@@ -1626,13 +1584,6 @@ public class CitrixHelper {
public static long getXenServer602StaticMax(String stdType, boolean bootFromCD) {
MemoryValues recommendedMaxMinMemory = _xenServer602GuestOsMemoryMap.get(stdType);
if (recommendedMaxMinMemory == null) {
- /*if ( !bootFromCD ) {
- s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 FP1 guestOS type, start it as HVM guest");
- guestOS = "Other install media";
- } else {
- String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
- s_logger.warn(msg);
- }*/
return 0l;
}
return recommendedMaxMinMemory.getMax();
@@ -1641,13 +1592,6 @@ public class CitrixHelper {
public static long getXenServer602StaticMin(String stdType, boolean bootFromCD) {
MemoryValues recommendedMaxMinMemory = _xenServer602GuestOsMemoryMap.get(stdType);
if (recommendedMaxMinMemory == null) {
- /*if ( !bootFromCD ) {
- s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 FP1 guestOS type, start it as HVM guest");
- guestOS = "Other install media";
- } else {
- String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
- s_logger.warn(msg);
- }*/
return 0l;
}
return recommendedMaxMinMemory.getMin();
@@ -1670,13 +1614,6 @@ public class CitrixHelper {
public static long getXenServer610StaticMax(String stdType, boolean bootFromCD) {
MemoryValues recommendedMaxMinMemory = _xenServer610GuestOsMemoryMap.get(stdType);
if (recommendedMaxMinMemory == null) {
- /*if ( !bootFromCD ) {
- s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 FP1 guestOS type, start it as HVM guest");
- guestOS = "Other install media";
- } else {
- String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
- s_logger.warn(msg);
- }*/
return 0l;
}
return recommendedMaxMinMemory.getMax();
@@ -1685,13 +1622,6 @@ public class CitrixHelper {
public static long getXenServer610StaticMin(String stdType, boolean bootFromCD) {
MemoryValues recommendedMaxMinMemory = _xenServer610GuestOsMemoryMap.get(stdType);
if (recommendedMaxMinMemory == null) {
- /*if ( !bootFromCD ) {
- s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer 5.6 FP1 guestOS type, start it as HVM guest");
- guestOS = "Other install media";
- } else {
- String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
- s_logger.warn(msg);
- }*/
return 0l;
}
return recommendedMaxMinMemory.getMin();
[10/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
Update resource count for networks only when the network is non system and Isolated. Before we used to update the count only when offering had specifyVlan=false. And in 4.2 even isolated networks can have this attribute set to true, and we have to count them
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1eacd787
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1eacd787
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1eacd787
Branch: refs/heads/vmsync
Commit: 1eacd7872e3749eaa470c9fbf6c419b58e121513
Parents: f74e635
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Tue Jun 25 13:31:29 2013 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Tue Jun 25 13:46:35 2013 -0700
----------------------------------------------------------------------
server/src/com/cloud/network/NetworkManagerImpl.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1eacd787/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java
index 674a35f..8e90cb7 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -2866,7 +2866,9 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
}
private boolean resourceCountNeedsUpdate(NetworkOffering ntwkOff, ACLType aclType) {
- boolean updateResourceCount = (!ntwkOff.getSpecifyVlan() && aclType == ACLType.Account);
+ //Update resource count only for Isolated account specific non-system networks
+ boolean updateResourceCount = (ntwkOff.getGuestType() == GuestType.Isolated &&
+ !ntwkOff.isSystemOnly() && aclType == ACLType.Account);
return updateResourceCount;
}
[30/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-3214: transferring portable IP across zones with enableStatic
NAT does not work
making an exception for portabe IP, so that if the current datacenter with
portable IP is associated is different from destiantion data center
also on transfer on to new zone, transfer the portable ip association to
new data center, physical network id's
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ff167134
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ff167134
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ff167134
Branch: refs/heads/vmsync
Commit: ff167134e45a3321dd5d9a3f45e3f9621b16d759
Parents: 1c102a0
Author: Murali Reddy <mu...@gmail.com>
Authored: Wed Jun 26 19:27:09 2013 +0530
Committer: Murali Reddy <mu...@gmail.com>
Committed: Wed Jun 26 19:29:55 2013 +0530
----------------------------------------------------------------------
engine/schema/src/com/cloud/dc/VlanVO.java | 4 ++++
.../src/com/cloud/network/dao/IPAddressVO.java | 4 ++++
.../com/cloud/network/NetworkManagerImpl.java | 21 +++++++++++++++++++-
.../cloud/network/rules/RulesManagerImpl.java | 5 ++++-
4 files changed, 32 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ff167134/engine/schema/src/com/cloud/dc/VlanVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/dc/VlanVO.java b/engine/schema/src/com/cloud/dc/VlanVO.java
index af6b5fc..a2f7a9c 100644
--- a/engine/schema/src/com/cloud/dc/VlanVO.java
+++ b/engine/schema/src/com/cloud/dc/VlanVO.java
@@ -120,6 +120,10 @@ public class VlanVO implements Vlan {
return dataCenterId;
}
+ public void setDataCenterId(long dcId) {
+ this.dataCenterId = dcId;
+ }
+
@Override
public String getIpRange() {
return ipRange;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ff167134/engine/schema/src/com/cloud/network/dao/IPAddressVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/IPAddressVO.java b/engine/schema/src/com/cloud/network/dao/IPAddressVO.java
index 5eb2500..c5f17504 100644
--- a/engine/schema/src/com/cloud/network/dao/IPAddressVO.java
+++ b/engine/schema/src/com/cloud/network/dao/IPAddressVO.java
@@ -158,6 +158,10 @@ public class IPAddressVO implements IpAddress {
return dataCenterId;
}
+ public void setDataCenterId(long dcId) {
+ this.dataCenterId = dcId;
+ }
+
@Override
public Ip getAddress() {
return address;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ff167134/server/src/com/cloud/network/NetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java
index 8e90cb7..cb3cbbf 100755
--- a/server/src/com/cloud/network/NetworkManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkManagerImpl.java
@@ -1125,7 +1125,6 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
}
Transaction txn = Transaction.currentTxn();
- txn.start();
assert(isPortableIpTransferableFromNetwork(ipAddrId, currentNetworkId));
@@ -1135,8 +1134,27 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
disassociatePortableIPToGuestNetwork(ipAddrId, currentNetworkId);
}
+ if (srcNetwork.getDataCenterId() != dstNetwork.getDataCenterId()) {
+ // portable IP need to be transferred across the zones, so mark the entry corresponding to portable ip
+ // in user_ip_address as provisioned in destination data center
+ txn.start();
+ ip.setDataCenterId(dstNetwork.getDataCenterId());
+ ip.setPhysicalNetworkId(dstNetwork.getPhysicalNetworkId());
+ _ipAddressDao.update(ipAddrId, ip);
+
+ VlanVO vlan = _vlanDao.findById(ip.getVlanId());
+ vlan.setPhysicalNetworkId(dstNetwork.getPhysicalNetworkId());
+ vlan.setNetworkId(newNetworkId);
+ vlan.setDataCenterId(dstNetwork.getDataCenterId());
+ _vlanDao.update(ip.getVlanId(), vlan);
+ txn.commit();
+ }
+
associatePortableIPToGuestNetwork(ipAddrId, newNetworkId, false);
+
+ txn.start();
+
if (dstNetwork.getVpcId() != null) {
ip.setVpcId(dstNetwork.getVpcId());
} else {
@@ -1144,6 +1162,7 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
}
_ipAddressDao.update(ipAddrId, ip);
+
txn.commit();
ActionEventUtils.onActionEvent(User.UID_SYSTEM, Account.ACCOUNT_ID_SYSTEM, Domain.ROOT_DOMAIN,
EventTypes.EVENT_PORTABLE_IP_TRANSFER, "Portable IP associated is transferred from network "
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ff167134/server/src/com/cloud/network/rules/RulesManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/rules/RulesManagerImpl.java b/server/src/com/cloud/network/rules/RulesManagerImpl.java
index bcda32d..0f733fb 100755
--- a/server/src/com/cloud/network/rules/RulesManagerImpl.java
+++ b/server/src/com/cloud/network/rules/RulesManagerImpl.java
@@ -159,7 +159,10 @@ public class RulesManagerImpl extends ManagerBase implements RulesManager, Rules
// validate that userVM is in the same availability zone as the IP address
if (ipAddress.getDataCenterId() != userVm.getDataCenterId()) {
- throw new InvalidParameterValueException("Unable to create ip forwarding rule, IP address " + ipAddress + " is not in the same availability zone as virtual machine " + userVm.toString());
+ //make an exception for portable IP
+ if (!ipAddress.isPortable()) {
+ throw new InvalidParameterValueException("Unable to create ip forwarding rule, IP address " + ipAddress + " is not in the same availability zone as virtual machine " + userVm.toString());
+ }
}
}
[06/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
Updated japanse and chinese localization files
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c6d36118
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c6d36118
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c6d36118
Branch: refs/heads/vmsync
Commit: c6d361184b5c277f7de89e6f577536cc6b29b2cf
Parents: c36a952
Author: Pranav Saxena <ps...@gmail.com>
Authored: Tue Jun 25 23:25:38 2013 +0530
Committer: Pranav Saxena <ps...@gmail.com>
Committed: Tue Jun 25 23:25:38 2013 +0530
----------------------------------------------------------------------
.../classes/resources/messages_ja.properties | 48 +++++++++++---------
.../classes/resources/messages_zh_CN.properties | 4 ++
2 files changed, 30 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c6d36118/client/WEB-INF/classes/resources/messages_ja.properties
----------------------------------------------------------------------
diff --git a/client/WEB-INF/classes/resources/messages_ja.properties b/client/WEB-INF/classes/resources/messages_ja.properties
index 4a2eaee..63d30e7 100644
--- a/client/WEB-INF/classes/resources/messages_ja.properties
+++ b/client/WEB-INF/classes/resources/messages_ja.properties
@@ -25,7 +25,7 @@ confirm.enable.s3=S3 \u30d9\u30fc\u30b9\u306e\u30bb\u30ab\u30f3\u30c0\u30ea \u30
confirm.enable.swift=Swift \u306e\u30b5\u30dd\u30fc\u30c8\u3092\u6709\u52b9\u306b\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u60c5\u5831\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002
error.could.not.enable.zone=\u30be\u30fc\u30f3\u3092\u6709\u52b9\u306b\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f
error.installWizard.message=\u554f\u984c\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002\u623b\u3063\u3066\u30a8\u30e9\u30fc\u3092\u4fee\u6b63\u3067\u304d\u307e\u3059\u3002
-error.invalid.username.password=\u7121\u52b9\u306a\u30e6\u30fc\u30b6\u30fc\u540d\u307e\u305f\u306f\u30d1\u30b9\u30ef\u30fc\u30c9
+error.invalid.username.password=\u7121\u52b9\u306a\u30e6\u30fc\u30b6\u30fc\u540d\u307e\u305f\u306f\u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u3059\u3002
error.login=\u30e6\u30fc\u30b6\u30fc\u540d/\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u8a18\u9332\u3068\u4e00\u81f4\u3057\u307e\u305b\u3093\u3002
error.menu.select=\u9805\u76ee\u304c\u9078\u629e\u3055\u308c\u3066\u3044\u306a\u3044\u305f\u3081\u64cd\u4f5c\u3092\u5b9f\u884c\u3067\u304d\u307e\u305b\u3093\u3002
error.mgmt.server.inaccessible=\u7ba1\u7406\u30b5\u30fc\u30d0\u30fc\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u305b\u3093\u3002\u5f8c\u3067\u518d\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002
@@ -37,11 +37,11 @@ error.unable.to.reach.management.server=\u7ba1\u7406\u30b5\u30fc\u30d0\u30fc\u30
error.unresolved.internet.name=\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u540d\u3092\u89e3\u6c7a\u3067\u304d\u307e\u305b\u3093\u3002
extractable=\u62bd\u51fa\u53ef\u80fd
force.delete.domain.warning=\u8b66\u544a\: \u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u9078\u629e\u3059\u308b\u3068\u3001\u3059\u3079\u3066\u306e\u5b50\u30c9\u30e1\u30a4\u30f3\u304a\u3088\u3073\u95a2\u9023\u3059\u308b\u3059\u3079\u3066\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u3068\u305d\u306e\u30ea\u30bd\u30fc\u30b9\u304c\u524a\u9664\u3055\u308c\u307e\u3059\u3002
-force.delete=\u5f37\u5236\u524a\u9664
+force.delete=\u5f37\u5236\u7684\u306b\u524a\u9664\u3059\u308b
force.remove.host.warning=\u8b66\u544a\: \u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u9078\u629e\u3059\u308b\u3068\u3001\u5b9f\u884c\u4e2d\u306e\u3059\u3079\u3066\u306e\u4eee\u60f3\u30de\u30b7\u30f3\u304c\u5f37\u5236\u7684\u306b\u505c\u6b62\u3055\u308c\u3001\u30af\u30e9\u30b9\u30bf\u30fc\u304b\u3089\u3053\u306e\u30db\u30b9\u30c8\u304c\u5f37\u5236\u7684\u306b\u89e3\u9664\u3055\u308c\u307e\u3059\u3002
-force.remove=\u5f37\u5236\u89e3\u9664
+force.remove=\u5f37\u5236\u7684\u306b\u89e3\u9664\u3059\u308b
force.stop.instance.warning=\u8b66\u544a\: \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u5f37\u5236\u505c\u6b62\u306f\u3001\u6700\u7d42\u624b\u6bb5\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30c7\u30fc\u30bf\u3092\u640d\u5931\u3059\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u4eee\u60f3\u30de\u30b7\u30f3\u306e\u52d5\u4f5c\u304c\u4e00\u8cab\u3057\u306a\u304f\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002
-force.stop=\u5f37\u5236\u505c\u6b62
+force.stop=\u5f37\u5236\u7684\u306b\u505c\u6b62\u3059\u308b
ICMP.code=ICMP \u30b3\u30fc\u30c9
ICMP.type=ICMP \u306e\u7a2e\u985e
image.directory=\u753b\u50cf\u30c7\u30a3\u30ec\u30af\u30c8\u30ea
@@ -240,7 +240,7 @@ label.action.vmsnapshot.revert=VM \u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30
label.actions=\u64cd\u4f5c
label.activate.project=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30a2\u30af\u30c6\u30a3\u30d6\u5316
label.active.sessions=\u30a2\u30af\u30c6\u30a3\u30d6\u306a\u30bb\u30c3\u30b7\u30e7\u30f3
-label.add.account.to.project=\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3078\u306e\u8ffd\u52a0
+label.add.account.to.project=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3078\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u8ffd\u52a0
label.add.account=\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u8ffd\u52a0
label.add.accounts.to=\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u8ffd\u52a0\u5148:
label.add.accounts=\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u8ffd\u52a0
@@ -291,7 +291,7 @@ label.add.static.nat.rule=\u9759\u7684 NAT \u898f\u5247\u306e\u8ffd\u52a0
label.add.static.route=\u9759\u7684\u30eb\u30fc\u30c8\u306e\u8ffd\u52a0
label.add.system.service.offering=\u30b7\u30b9\u30c6\u30e0 \u30b5\u30fc\u30d3\u30b9 \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u306e\u8ffd\u52a0
label.add.template=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u8ffd\u52a0
-label.add.to.group=\u30b0\u30eb\u30fc\u30d7\u3078\u306e\u8ffd\u52a0
+label.add.to.group=\u8ffd\u52a0\u5148\u30b0\u30eb\u30fc\u30d7
label.add.user=\u30e6\u30fc\u30b6\u30fc\u306e\u8ffd\u52a0
label.add.vlan=VLAN \u306e\u8ffd\u52a0
label.add.VM.to.tier=\u968e\u5c64\u3078\u306e VM \u306e\u8ffd\u52a0
@@ -381,7 +381,7 @@ label.CIDR.list=CIDR \u4e00\u89a7
label.cidr.list=\u9001\u4fe1\u5143 CIDR
label.CIDR.of.destination.network=\u5b9b\u5148\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e CIDR
label.cidr=CIDR
-label.clean.up=\u30af\u30ea\u30fc\u30f3 \u30a2\u30c3\u30d7
+label.clean.up=\u30af\u30ea\u30fc\u30f3 \u30a2\u30c3\u30d7\u3059\u308b
label.clear.list=\u4e00\u89a7\u306e\u6d88\u53bb
label.close=\u9589\u3058\u308b
label.cloud.console=\u30af\u30e9\u30a6\u30c9\u7ba1\u7406\u30b3\u30f3\u30bd\u30fc\u30eb
@@ -428,7 +428,7 @@ label.data.disk.offering=\u30c7\u30fc\u30bf \u30c7\u30a3\u30b9\u30af \u30aa\u30d
label.date=\u65e5\u6642
label.day.of.month=\u6bce\u6708\u6307\u5b9a\u65e5
label.day.of.week=\u6bce\u9031\u6307\u5b9a\u65e5
-label.dead.peer.detection=\u505c\u6b62\u30d4\u30a2\u306e\u691c\u51fa
+label.dead.peer.detection=\u505c\u6b62\u30d4\u30a2\u3092\u691c\u51fa\u3059\u308b
label.decline.invitation=\u62db\u5f85\u306e\u8f9e\u9000
label.dedicated=\u5c02\u7528
label.default.use=\u30c7\u30d5\u30a9\u30eb\u30c8\u4f7f\u7528
@@ -466,6 +466,10 @@ label.disable.vpn=VPN \u306e\u7121\u52b9\u5316
label.disabled=\u7121\u52b9
label.disabling.vpn.access=VPN \u30a2\u30af\u30bb\u30b9\u3092\u7121\u52b9\u306b\u3057\u3066\u3044\u307e\u3059
label.disk.allocated=\u5272\u308a\u5f53\u3066\u6e08\u307f\u306e\u30c7\u30a3\u30b9\u30af
+label.disk.bytes.read.rate=\u30c7\u30a3\u30b9\u30af\u8aad\u307f\u53d6\u308a\u901f\u5ea6 (BPS)
+label.disk.bytes.write.rate=\u30c7\u30a3\u30b9\u30af\u66f8\u304d\u8fbc\u307f\u901f\u5ea6 (BPS)
+label.disk.iops.read.rate=\u30c7\u30a3\u30b9\u30af\u8aad\u307f\u53d6\u308a\u901f\u5ea6 (IOPS)
+label.disk.iops.write.rate=\u30c7\u30a3\u30b9\u30af\u66f8\u304d\u8fbc\u307f\u901f\u5ea6 (IOPS)
label.disk.offering=\u30c7\u30a3\u30b9\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0
label.disk.read.bytes=\u30c7\u30a3\u30b9\u30af\u8aad\u307f\u53d6\u308a (\u30d0\u30a4\u30c8)
label.disk.read.io=\u30c7\u30a3\u30b9\u30af\u8aad\u307f\u53d6\u308a (IO)
@@ -621,7 +625,7 @@ label.ip.range=IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2
label.ip.ranges=IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2
label.ip=IP
label.ipaddress=IP \u30a2\u30c9\u30ec\u30b9
-label.ips=IP
+label.ips=IP \u30a2\u30c9\u30ec\u30b9
label.IPsec.preshared.key=IPsec \u4e8b\u524d\u5171\u6709\u30ad\u30fc
label.is.default=\u30c7\u30d5\u30a9\u30eb\u30c8
label.is.redundant.router=\u5197\u9577
@@ -638,7 +642,7 @@ label.item.listing=\u9805\u76ee\u4e00\u89a7
label.keep=\u7dad\u6301
label.key=\u30ad\u30fc
label.keyboard.type=\u30ad\u30fc\u30dc\u30fc\u30c9\u306e\u7a2e\u985e
-label.kvm.traffic.label=KVM \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e\u30e9\u30d9\u30eb
+label.kvm.traffic.label=KVM \u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af \u30e9\u30d9\u30eb
label.label=\u30e9\u30d9\u30eb
label.lang.arabic=\u30a2\u30e9\u30d3\u30a2\u8a9e
label.lang.brportugese=\u30dd\u30eb\u30c8\u30ac\u30eb\u8a9e (\u30d6\u30e9\u30b8\u30eb)
@@ -667,7 +671,7 @@ label.load.balancer=\u8ca0\u8377\u5206\u6563\u88c5\u7f6e
label.load.balancing.policies=\u8ca0\u8377\u5206\u6563\u30dd\u30ea\u30b7\u30fc
label.load.balancing=\u8ca0\u8377\u5206\u6563
label.loading=\u30ed\u30fc\u30c9\u3057\u3066\u3044\u307e\u3059
-label.local.storage.enabled=\u30ed\u30fc\u30ab\u30eb \u30b9\u30c8\u30ec\u30fc\u30b8\u306f\u6709\u52b9\u3067\u3059
+label.local.storage.enabled=\u30ed\u30fc\u30ab\u30eb \u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u6709\u52b9\u306b\u3059\u308b
label.local.storage=\u30ed\u30fc\u30ab\u30eb \u30b9\u30c8\u30ec\u30fc\u30b8
label.local=\u30ed\u30fc\u30ab\u30eb
label.login=\u30ed\u30b0\u30aa\u30f3
@@ -781,10 +785,10 @@ label.network.offering.name=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30aa\u30d5\u3
label.network.offering=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0
label.network.rate.megabytes=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u901f\u5ea6 (MB/\u79d2)
label.network.rate=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u901f\u5ea6
-label.network.read=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u8aad\u307f\u53d6\u308a
+label.network.read=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8aad\u307f\u53d6\u308a
label.network.service.providers=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30b5\u30fc\u30d3\u30b9 \u30d7\u30ed\u30d0\u30a4\u30c0\u30fc
label.network.type=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u7a2e\u985e
-label.network.write=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u66f8\u304d\u8fbc\u307f
+label.network.write=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u66f8\u304d\u8fbc\u307f
label.network=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af
label.networking.and.security=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3068\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3
label.networks=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af
@@ -906,7 +910,7 @@ label.remove.from.load.balancer=\u8ca0\u8377\u5206\u6563\u88c5\u7f6e\u304b\u3089
label.remove.ingress.rule=\u53d7\u4fe1\u898f\u5247\u306e\u524a\u9664
label.remove.ip.range=IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u306e\u524a\u9664
label.remove.pf=\u30dd\u30fc\u30c8\u8ee2\u9001\u898f\u5247\u306e\u524a\u9664
-label.remove.project.account=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8 \u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u524a\u9664
+label.remove.project.account=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304b\u3089\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u524a\u9664
label.remove.region=\u9818\u57df\u306e\u524a\u9664
label.remove.rule=\u898f\u5247\u306e\u524a\u9664
label.remove.static.nat.rule=\u9759\u7684 NAT \u898f\u5247\u306e\u524a\u9664
@@ -923,7 +927,7 @@ label.reserved.system.netmask=\u4e88\u7d04\u6e08\u307f\u30b7\u30b9\u30c6\u30e0 \
label.reset.VPN.connection=VPN \u63a5\u7d9a\u306e\u30ea\u30bb\u30c3\u30c8
label.resize.new.offering.id=\u65b0\u3057\u3044\u30aa\u30d5\u30a1\u30ea\u30f3\u30b0
label.resize.new.size=\u65b0\u3057\u3044\u30b5\u30a4\u30ba (GB)
-label.resize.shrink.ok=\u7e2e\u5c0f\u53ef\u80fd
+label.resize.shrink.ok=\u7e2e\u5c0f\u53ef\u80fd\u306b\u3059\u308b
label.resource.limits=\u30ea\u30bd\u30fc\u30b9\u5236\u9650
label.resource.state=\u30ea\u30bd\u30fc\u30b9\u306e\u72b6\u614b
label.resource=\u30ea\u30bd\u30fc\u30b9
@@ -1013,7 +1017,7 @@ label.static.nat.to=\u9759\u7684 NAT \u306e\u8a2d\u5b9a\u5148:
label.static.nat.vm.details=\u9759\u7684 NAT VM \u306e\u8a73\u7d30
label.static.nat=\u9759\u7684 NAT
label.statistics=\u7d71\u8a08
-label.status=\u72b6\u614b
+label.status=\u72b6\u6cc1
label.step.1.title=\u624b\u9806 1\: <strong>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u9078\u629e</strong>
label.step.1=\u624b\u9806 1
label.step.2.title=\u624b\u9806 2\: <strong>\u30b5\u30fc\u30d3\u30b9 \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0</strong>
@@ -1144,12 +1148,12 @@ label.VMFS.datastore=VMFS \u30c7\u30fc\u30bf\u30b9\u30c8\u30a2
label.vmfs=VMFS
label.VMs.in.tier=\u968e\u5c64\u5185\u306e VM
label.vms=VM
-label.vmsnapshot.current=isCurrent
-label.vmsnapshot.memory=\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8 \u30e1\u30e2\u30ea
+label.vmsnapshot.current=\u4f7f\u7528\u4e2d
+label.vmsnapshot.memory=\u30e1\u30e2\u30ea\u3082\u542b\u3081\u308b
label.vmsnapshot.parentname=\u89aa
label.vmsnapshot.type=\u7a2e\u985e
label.vmsnapshot=VM \u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8
-label.vmware.traffic.label=VMware \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e\u30e9\u30d9\u30eb
+label.vmware.traffic.label=VMware \u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af \u30e9\u30d9\u30eb
label.volgroup=\u30dc\u30ea\u30e5\u30fc\u30e0 \u30b0\u30eb\u30fc\u30d7
label.volume.limits=\u30dc\u30ea\u30e5\u30fc\u30e0\u5236\u9650
label.volume.name=\u30dc\u30ea\u30e5\u30fc\u30e0\u540d
@@ -1174,7 +1178,7 @@ label.weekly=\u6bce\u9031
label.welcome.cloud.console=\u7ba1\u7406\u30b3\u30f3\u30bd\u30fc\u30eb\u3078\u3088\u3046\u3053\u305d
label.welcome=\u3088\u3046\u3053\u305d
label.what.is.cloudstack=CloudStack&\#8482; \u306b\u3064\u3044\u3066
-label.xen.traffic.label=XenServer \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e\u30e9\u30d9\u30eb
+label.xen.traffic.label=XenServer \u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af \u30e9\u30d9\u30eb
label.yes=\u306f\u3044
label.zone.details=\u30be\u30fc\u30f3\u306e\u8a73\u7d30
label.zone.id=\u30be\u30fc\u30f3 ID
@@ -1348,7 +1352,7 @@ message.desc.secondary.storage=\u5404\u30be\u30fc\u30f3\u306b\u306f\u5c11\u306a\
message.desc.zone=\u30be\u30fc\u30f3\u306f CloudStack \u74b0\u5883\u5185\u306e\u6700\u5927\u306e\u7d44\u7e54\u5358\u4f4d\u3067\u3001\u901a\u5e38\u3001\u5358\u4e00\u306e\u30c7\u30fc\u30bf\u30bb\u30f3\u30bf\u30fc\u306b\u76f8\u5f53\u3057\u307e\u3059\u3002\u30be\u30fc\u30f3\u306b\u3088\u3063\u3066\u7269\u7406\u7684\u306a\u5206\u96e2\u3068\u5197\u9577\u6027\u304c\u63d0\u4f9b\u3055\u308c\u307e\u3059\u3002\u30be\u30fc\u30f3\u306f 1 \u3064\u4ee5\u4e0a\u306e\u30dd\u30c3\u30c9 (\u5404\u30dd\u30c3\u30c9\u306f\u30db\u30b9\u30c8\u3068\u30d7\u30e9\u30a4\u30de\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8 \u30b5\u30fc\u30d0\u30fc\u304b\u3089\u69cb\u6210\u3055\u308c\u307e\u3059) \u3068\u3001\u30be\u30fc\u30f3\u5185\u306e\u3059\u3079\u3066\u306e\u30dd\u30c3\u30c9\u3067\u5171\u6709\u3055\u308c\u308b\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8 \u30b5\u30fc\u30d0\u30fc\u304b\u3089\u69cb\u6210\u3055\u308c\u307e\u3059\u3002
message.detach.disk=\u3053\u306e\u30c7\u30a3\u30b9\u30af\u3092\u30c7\u30bf\u30c3\u30c1\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b?
message.detach.iso.confirm=\u3053\u306e\u4eee\u60f3\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304b\u3089 ISO \u30d5\u30a1\u30a4\u30eb\u3092\u30c7\u30bf\u30c3\u30c1\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b?
-message.disable.account=\u3053\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u7121\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? \u3053\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u3059\u3079\u3066\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u30af\u30e9\u30a6\u30c9 \u30ea\u30bd\u30fc\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u304f\u306a\u308a\u307e\u3059\u3002\u5b9f\u884c\u4e2d\u306e\u3059\u3079\u3066\u306e\u4eee\u60f3\u30de\u30b7\u30f3\u306f\u4eca\u3059\u3050\u306b\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3055\u308c\u307e\u3059\u3002
+message.disable.account=\u3053\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u7121\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? \u3053\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u3059\u3079\u3066\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u30af\u30e9\u30a6\u30c9 \u30ea\u30bd\u30fc\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u304f\u306a\u308a\u307e\u3059\u3002\u5b9f\u884c\u4e2d\u306e\u3059\u3079\u3066\u306e\u4eee\u60f3\u30de\u30b7\u30f3\u304c\u4eca\u3059\u3050\u306b\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3055\u308c\u307e\u3059\u3002
message.disable.snapshot.policy=\u73fe\u5728\u306e\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8 \u30dd\u30ea\u30b7\u30fc\u3092\u7121\u52b9\u306b\u3057\u307e\u3057\u305f\u3002
message.disable.user=\u3053\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u7121\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b?
message.disable.vpn.access=VPN \u30a2\u30af\u30bb\u30b9\u3092\u7121\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b?
@@ -1357,7 +1361,7 @@ message.download.ISO=ISO \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\
message.download.template=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u306b\u306f <a href\="\#">00000</a> \u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059
message.download.volume.confirm=\u3053\u306e\u30dc\u30ea\u30e5\u30fc\u30e0\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b?
message.download.volume=\u30dc\u30ea\u30e5\u30fc\u30e0\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u306b\u306f <a href\="\#">00000</a> \u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059
-message.edit.account=\u7de8\u96c6 ("-1" \u306f\u3001\u30ea\u30bd\u30fc\u30b9\u4f5c\u6210\u306e\u91cf\u306b\u5236\u9650\u304c\u306a\u3044\u3053\u3068\u3092\u793a\u3057\u307e\u3059)
+message.edit.account=\u7de8\u96c6 (\u300c-1\u300d\u306f\u3001\u30ea\u30bd\u30fc\u30b9\u4f5c\u6210\u306e\u91cf\u306b\u5236\u9650\u304c\u306a\u3044\u3053\u3068\u3092\u793a\u3057\u307e\u3059)
message.edit.confirm=[\u4fdd\u5b58] \u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u524d\u306b\u5909\u66f4\u5185\u5bb9\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002
message.edit.limits=\u6b21\u306e\u30ea\u30bd\u30fc\u30b9\u306b\u5236\u9650\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u300c-1\u300d\u306f\u3001\u30ea\u30bd\u30fc\u30b9\u4f5c\u6210\u306b\u5236\u9650\u304c\u306a\u3044\u3053\u3068\u3092\u793a\u3057\u307e\u3059\u3002
message.edit.traffic.type=\u3053\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e\u7a2e\u985e\u306b\u95a2\u9023\u4ed8\u3051\u308b\u30c8\u30e9\u30d5\u30a3\u30c3\u30af \u30e9\u30d9\u30eb\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c6d36118/client/WEB-INF/classes/resources/messages_zh_CN.properties
----------------------------------------------------------------------
diff --git a/client/WEB-INF/classes/resources/messages_zh_CN.properties b/client/WEB-INF/classes/resources/messages_zh_CN.properties
index 68ab156..75ecb34 100644
--- a/client/WEB-INF/classes/resources/messages_zh_CN.properties
+++ b/client/WEB-INF/classes/resources/messages_zh_CN.properties
@@ -466,6 +466,10 @@ label.disable.vpn=\u7981\u7528 VPN
label.disabled=\u5df2\u7981\u7528
label.disabling.vpn.access=\u6b63\u5728\u7981\u7528 VPN \u8bbf\u95ee
label.disk.allocated=\u5df2\u5206\u914d\u7684\u78c1\u76d8
+label.disk.bytes.read.rate=\u78c1\u76d8\u8bfb\u53d6\u901f\u5ea6(BPS)
+label.disk.bytes.write.rate=\u78c1\u76d8\u5199\u5165\u901f\u5ea6(BPS)
+label.disk.iops.read.rate=\u78c1\u76d8\u8bfb\u53d6\u901f\u5ea6(IOPS)
+label.disk.iops.write.rate=\u78c1\u76d8\u5199\u5165\u901f\u5ea6(IOPS)
label.disk.offering=\u78c1\u76d8\u65b9\u6848
label.disk.read.bytes=\u78c1\u76d8\u8bfb\u53d6(\u5b57\u8282)
label.disk.read.io=\u78c1\u76d8\u8bfb\u53d6(IO)
[21/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-3206. CreateVlanIpRange fails with IndexOutOfBoundsException.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/55f0e167
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/55f0e167
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/55f0e167
Branch: refs/heads/vmsync
Commit: 55f0e167ecda92bf4731eeff2a56b2ad22a3be21
Parents: 3bb4ec9
Author: Likitha Shetty <li...@citrix.com>
Authored: Wed Jun 26 14:58:45 2013 +0530
Committer: Likitha Shetty <li...@citrix.com>
Committed: Wed Jun 26 14:59:36 2013 +0530
----------------------------------------------------------------------
server/src/com/cloud/configuration/ConfigurationManagerImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/55f0e167/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 26dc088..041f29a 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -2685,8 +2685,8 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
}
List<VlanVO> vlans = _vlanDao.listVlansByNetworkId(network.getId());
- VlanVO vlan = vlans.get(0);
if (vlans != null && vlans.size() > 0) {
+ VlanVO vlan = vlans.get(0);
if (vlanId == null) {
vlanId = vlan.getVlanTag();
} else if (!vlan.getVlanTag().equals(vlanId)) {
[47/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
cmds is not a list. just regular string to ssh
Signed-off-by: Prasanna Santhanam <ts...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/2af6db24
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/2af6db24
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/2af6db24
Branch: refs/heads/vmsync
Commit: 2af6db24ed35a95b5bb9493003b241617b5d7835
Parents: 181567b
Author: Prasanna Santhanam <ts...@apache.org>
Authored: Tue Jun 25 19:39:15 2013 +0530
Committer: Prasanna Santhanam <ts...@apache.org>
Committed: Thu Jun 27 20:30:36 2013 +0530
----------------------------------------------------------------------
test/integration/smoke/test_vm_life_cycle.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2af6db24/test/integration/smoke/test_vm_life_cycle.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_vm_life_cycle.py b/test/integration/smoke/test_vm_life_cycle.py
index b54182e..c2c2592 100644
--- a/test/integration/smoke/test_vm_life_cycle.py
+++ b/test/integration/smoke/test_vm_life_cycle.py
@@ -747,7 +747,7 @@ class TestVMLifeCycle(cloudstackTestCase):
self.fail("SSH failed for virtual machine: %s - %s" %
(self.virtual_machine.ipaddress, e))
- cmds = [ "mkdir -p %s" % self.services["mount_dir"] ]
+ cmds = "mkdir -p %s" % self.services["mount_dir"]
self.assert_(ssh_client.execute(cmds) == [], "mkdir failed within guest")
for diskdevice in self.services["diskdevice"]:
[37/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-728 Set vmspec extra config for the Nicira NVP vApp
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/53d1ce75
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/53d1ce75
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/53d1ce75
Branch: refs/heads/vmsync
Commit: 53d1ce75a19a15f6f588c5c17970d081368fd1d8
Parents: 98dc68d
Author: Hugo Trippaers <ht...@schubergphilis.com>
Authored: Wed Jun 19 17:03:35 2013 -0700
Committer: Hugo Trippaers <ht...@schubergphilis.com>
Committed: Wed Jun 26 15:41:52 2013 -0700
----------------------------------------------------------------------
.../vmware/resource/VmwareResource.java | 56 ++++++++++++++------
1 file changed, 39 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/53d1ce75/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index 80e87e9..5c51585 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -2750,28 +2750,50 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
// pass boot arguments through machine.id & perform customized options to VMX
- Map<String, String> vmDetailOptions = validateVmDetails(vmSpec.getDetails());
- OptionValue[] extraOptions = new OptionValue[2 + vmDetailOptions.size()];
- extraOptions[0] = new OptionValue();
- extraOptions[0].setKey("machine.id");
- extraOptions[0].setValue(vmSpec.getBootArgs());
-
- extraOptions[1] = new OptionValue();
- extraOptions[1].setKey("devices.hotplug");
- extraOptions[1].setValue("true");
-
- int j = 2;
- for(Map.Entry<String, String> entry : vmDetailOptions.entrySet()) {
- extraOptions[j] = new OptionValue();
- extraOptions[j].setKey(entry.getKey());
- extraOptions[j].setValue(entry.getValue());
- j++;
+ ArrayList<OptionValue> extraOptions = new ArrayList<OptionValue>();
+ OptionValue newVal = new OptionValue();
+ newVal.setKey("machine.id");
+ newVal.setValue(vmSpec.getBootArgs());
+ extraOptions.add(newVal);
+
+ newVal = new OptionValue();
+ newVal.setKey("devices.hotplug");
+ newVal.setValue("true");
+ extraOptions.add(newVal);
+
+ /**
+ * Extra Config : nvp.vm-uuid = uuid
+ * - Required for Nicira NVP integration
+ */
+ newVal = new OptionValue();
+ newVal.setKey("nvp.vm-uuid");
+ newVal.setValue(vmSpec.getUuid());
+ extraOptions.add(newVal);
+
+ /**
+ * Extra Config : nvp.iface-id<num> = uuid
+ * - Required for Nicira NVP integration
+ */
+ int nicNum = 0;
+ for (NicTO nicTo : sortNicsByDeviceId(nics)) {
+ newVal = new OptionValue();
+ newVal.setKey("nvp.iface-id" + nicNum);
+ newVal.setValue(nicTo.getUuid());
+ extraOptions.add(newVal);
+ nicNum++;
+ }
+
+ for(Map.Entry<String, String> entry : validateVmDetails(vmSpec.getDetails()).entrySet()) {
+ newVal = new OptionValue();
+ newVal.setKey(entry.getKey());
+ newVal.setValue(entry.getValue());
+ extraOptions.add(newVal);
}
String keyboardLayout = null;
if(vmSpec.getDetails() != null)
keyboardLayout = vmSpec.getDetails().get(VmDetailConstants.KEYBOARD);
- vmConfigSpec.getExtraConfig().addAll(Arrays.asList(configureVnc(extraOptions, hyperHost, vmName, vmSpec.getVncPassword(), keyboardLayout)));
+ vmConfigSpec.getExtraConfig().addAll(Arrays.asList(configureVnc(extraOptions.toArray(new OptionValue[0]), hyperHost, vmName, vmSpec.getVncPassword(), keyboardLayout)));
if (!vmMo.configureVm(vmConfigSpec)) {
throw new Exception("Failed to configure VM before start. vmName: " + vmName);
[18/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
fix CLOUDSTACK-2989, do not list network offering with specifyvlan=true for non-root-admin user
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/94254e3c
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/94254e3c
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/94254e3c
Branch: refs/heads/vmsync
Commit: 94254e3c2bd38573adac22d0c66817db3cfa1873
Parents: c484d8a
Author: Mice Xia <mi...@tcloudcomputing.com>
Authored: Wed Jun 26 15:55:13 2013 +0800
Committer: Mice Xia <mi...@tcloudcomputing.com>
Committed: Wed Jun 26 15:55:32 2013 +0800
----------------------------------------------------------------------
.../src/com/cloud/configuration/ConfigurationManagerImpl.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/94254e3c/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 48728f7..26dc088 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -4519,11 +4519,12 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
}
// only root admin can list network offering with specifyVlan = true
- if (specifyVlan != null && caller.getType() == Account.ACCOUNT_TYPE_ADMIN) {
- sc.addAnd("specifyVlan", SearchCriteria.Op.EQ, specifyVlan);
- } else {
+ if(caller.getType() != Account.ACCOUNT_TYPE_ADMIN){
specifyVlan = false;
}
+ if (specifyVlan != null) {
+ sc.addAnd("specifyVlan", SearchCriteria.Op.EQ, specifyVlan);
+ }
if (availability != null) {
sc.addAnd("availability", SearchCriteria.Op.EQ, availability);
[07/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-3165: UI > VPC page - Configure VPC chart - pass associatednetworkid instead of networkid to listPublicIpAddresses API.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6a711fc6
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6a711fc6
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6a711fc6
Branch: refs/heads/vmsync
Commit: 6a711fc682754b18092d3f7ecde66695d565c7b5
Parents: c6d3611
Author: Jessica Wang <je...@apache.org>
Authored: Tue Jun 25 11:36:34 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Tue Jun 25 11:43:53 2013 -0700
----------------------------------------------------------------------
ui/scripts/vpc.js | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6a711fc6/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index 773409f..ed07a2c 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -831,7 +831,7 @@
$.ajax({
url: createURL('listPublicIpAddresses'),
async: false,
- data: { networkid: args.context.networks[0].id, forloadbalancing: true },
+ data: { associatednetworkid: args.context.networks[0].id, forloadbalancing: true },
success: function(json) {
var items = json.listpublicipaddressesresponse;
args.response.success({ data: items });
@@ -1398,7 +1398,7 @@
$.ajax({
url: createURL('listPublicIpAddresses'),
data: {
- networkid: args.context.networks[0].id,
+ associatednetworkid: args.context.networks[0].id,
isstaticnat: true,
listall: true
},
@@ -3503,8 +3503,8 @@
url: createURL('listPublicIpAddresses'),
async: false,
data: {
- vpcid: args.context.vpc[0].id,
- listAll: true
+ vpcid: args.context.vpc[0].id,
+ listAll: true
},
success: function(json) {
publicIpAddresses = json.listpublicipaddressesresponse;
@@ -3583,7 +3583,7 @@
$.ajax({
url: createURL('listPublicIpAddresses&listAll=true'),
async: false,
- data: { networkid: tier.id, forloadbalancing: true },
+ data: { associatednetworkid: tier.id, forloadbalancing: true },
success: function(json) {
publicLbIps = json.listpublicipaddressesresponse;
},
@@ -3596,7 +3596,7 @@
$.ajax({
url: createURL('listPublicIpAddresses&listAll=true'),
async: false,
- data: { networkid: tier.id, isstaticnat: true },
+ data: { associatednetworkid: tier.id, isstaticnat: true },
success: function(json) {
staticNatIps = json.listpublicipaddressesresponse;
},
[39/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
Gracefully handle racing condition in updating state of dataobject and
data store mapping table.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/de44a778
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/de44a778
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/de44a778
Branch: refs/heads/vmsync
Commit: de44a77878c972f061ab42ec6e41e1cfb3f67adc
Parents: a654e52
Author: Min Chen <mi...@citrix.com>
Authored: Wed Jun 26 17:16:25 2013 -0700
Committer: Min Chen <mi...@citrix.com>
Committed: Wed Jun 26 17:16:25 2013 -0700
----------------------------------------------------------------------
.../storage/image/store/TemplateObject.java | 51 ++--------------
.../datastore/DataObjectManagerImpl.java | 62 ++++++++++++++++++--
.../datastore/ObjectInDataStoreManager.java | 3 +-
.../datastore/ObjectInDataStoreManagerImpl.java | 34 ++++++-----
.../storage/volume/VolumeServiceImpl.java | 8 +--
5 files changed, 88 insertions(+), 70 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/de44a778/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
----------------------------------------------------------------------
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
index b093cbd..7a8fc60 100644
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
@@ -27,7 +27,6 @@ import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine;
import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine.Event;
-import org.apache.cloudstack.engine.subsystem.api.storage.TemplateEvent;
import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo;
import org.apache.cloudstack.storage.command.CopyCmdAnswer;
import org.apache.cloudstack.storage.datastore.ObjectInDataStoreManager;
@@ -39,6 +38,7 @@ import org.apache.log4j.Logger;
import com.cloud.agent.api.Answer;
import com.cloud.agent.api.to.DataObjectType;
import com.cloud.agent.api.to.DataTO;
+import com.cloud.exception.ConcurrentOperationException;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.storage.DataStoreRole;
import com.cloud.storage.Storage.ImageFormat;
@@ -152,41 +152,14 @@ public class TemplateObject implements TemplateInfo {
return this.imageVO.getFormat();
}
- // public boolean stateTransit(TemplateEvent e) throws NoTransitionException
- // {
- // this.imageVO = imageDao.findById(this.imageVO.getId());
- // boolean result = imageMgr.getStateMachine().transitTo(this.imageVO, e,
- // null, imageDao);
- // this.imageVO = imageDao.findById(this.imageVO.getId());
- // return result;
- // }
-
@Override
public void processEvent(Event event) {
try {
- if (this.getDataStore().getRole() == DataStoreRole.Image
- || this.getDataStore().getRole() == DataStoreRole.ImageCache) {
- TemplateEvent templEvent = null;
- if (event == ObjectInDataStoreStateMachine.Event.CreateOnlyRequested) {
- templEvent = TemplateEvent.CreateRequested;
- } else if (event == ObjectInDataStoreStateMachine.Event.DestroyRequested) {
- templEvent = TemplateEvent.DestroyRequested;
- } else if (event == ObjectInDataStoreStateMachine.Event.OperationSuccessed) {
- templEvent = TemplateEvent.OperationSucceeded;
- } else if (event == ObjectInDataStoreStateMachine.Event.OperationFailed) {
- templEvent = TemplateEvent.OperationFailed;
- }
-
- // if (templEvent != null && this.getDataStore().getRole() ==
- // DataStoreRole.Image) {
- // this.stateTransit(templEvent);
- // }
- }
-
objectInStoreMgr.update(this, event);
} catch (NoTransitionException e) {
- s_logger.debug("failed to update state", e);
- throw new CloudRuntimeException("Failed to update state" + e.toString());
+ throw new CloudRuntimeException("Failed to update state", e);
+ } catch (ConcurrentOperationException e) {
+ throw new CloudRuntimeException("Failed to update state", e);
} finally {
// in case of OperationFailed, expunge the entry
if (event == ObjectInDataStoreStateMachine.Event.OperationFailed) {
@@ -229,22 +202,6 @@ public class TemplateObject implements TemplateInfo {
this.imageDao.update(templateVO.getId(), templateVO);
}
}
-
- TemplateEvent templEvent = null;
- if (event == ObjectInDataStoreStateMachine.Event.CreateOnlyRequested) {
- templEvent = TemplateEvent.CreateRequested;
- } else if (event == ObjectInDataStoreStateMachine.Event.DestroyRequested) {
- templEvent = TemplateEvent.DestroyRequested;
- } else if (event == ObjectInDataStoreStateMachine.Event.OperationSuccessed) {
- templEvent = TemplateEvent.OperationSucceeded;
- } else if (event == ObjectInDataStoreStateMachine.Event.OperationFailed) {
- templEvent = TemplateEvent.OperationFailed;
- }
-
- // if (templEvent != null && this.getDataStore().getRole() ==
- // DataStoreRole.Image) {
- // this.stateTransit(templEvent);
- // }
}
objectInStoreMgr.update(this, event);
} catch (NoTransitionException e) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/de44a778/engine/storage/src/org/apache/cloudstack/storage/datastore/DataObjectManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/DataObjectManagerImpl.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/DataObjectManagerImpl.java
index 6e97e6f..fa9f993 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/DataObjectManagerImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/DataObjectManagerImpl.java
@@ -35,6 +35,7 @@ import org.apache.cloudstack.storage.command.CommandResult;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
+import com.cloud.exception.ConcurrentOperationException;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.utils.fsm.NoTransitionException;
@@ -136,7 +137,18 @@ public class DataObjectManagerImpl implements DataObjectManager {
} catch (NoTransitionException e) {
try {
objectInDataStoreMgr.update(objInStore, ObjectInDataStoreStateMachine.Event.OperationFailed);
- } catch (NoTransitionException e1) {
+ } catch (Exception e1) {
+ s_logger.debug("state transation failed", e1);
+ }
+ CreateCmdResult result = new CreateCmdResult(null, null);
+ result.setSuccess(false);
+ result.setResult(e.toString());
+ callback.complete(result);
+ return;
+ } catch (ConcurrentOperationException e) {
+ try {
+ objectInDataStoreMgr.update(objInStore, ObjectInDataStoreStateMachine.Event.OperationFailed);
+ } catch (Exception e1) {
s_logger.debug("state transation failed", e1);
}
CreateCmdResult result = new CreateCmdResult(null, null);
@@ -170,7 +182,17 @@ public class DataObjectManagerImpl implements DataObjectManager {
} catch (NoTransitionException e) {
try {
objectInDataStoreMgr.update(objInStrore, ObjectInDataStoreStateMachine.Event.OperationFailed);
- } catch (NoTransitionException e1) {
+ } catch (Exception e1) {
+ s_logger.debug("failed to change state", e1);
+ }
+
+ upResult.setResult(e.toString());
+ context.getParentCallback().complete(upResult);
+ return null;
+ } catch (ConcurrentOperationException e) {
+ try {
+ objectInDataStoreMgr.update(objInStrore, ObjectInDataStoreStateMachine.Event.OperationFailed);
+ } catch (Exception e1) {
s_logger.debug("failed to change state", e1);
}
@@ -202,7 +224,17 @@ public class DataObjectManagerImpl implements DataObjectManager {
s_logger.debug("failed to change state", e);
try {
objectInDataStoreMgr.update(destData, ObjectInDataStoreStateMachine.Event.OperationFailed);
- } catch (NoTransitionException e1) {
+ } catch (Exception e1) {
+
+ }
+ CreateCmdResult res = new CreateCmdResult(null, null);
+ res.setResult("Failed to change state: " + e.toString());
+ callback.complete(res);
+ } catch (ConcurrentOperationException e) {
+ s_logger.debug("failed to change state", e);
+ try {
+ objectInDataStoreMgr.update(destData, ObjectInDataStoreStateMachine.Event.OperationFailed);
+ } catch (Exception e1) {
}
CreateCmdResult res = new CreateCmdResult(null, null);
@@ -227,6 +259,8 @@ public class DataObjectManagerImpl implements DataObjectManager {
objectInDataStoreMgr.update(destObj, Event.OperationFailed);
} catch (NoTransitionException e) {
s_logger.debug("Failed to update copying state", e);
+ } catch (ConcurrentOperationException e) {
+ s_logger.debug("Failed to update copying state", e);
}
CreateCmdResult res = new CreateCmdResult(null, null);
res.setResult(result.getResult());
@@ -239,7 +273,16 @@ public class DataObjectManagerImpl implements DataObjectManager {
s_logger.debug("Failed to update copying state: ", e);
try {
objectInDataStoreMgr.update(destObj, ObjectInDataStoreStateMachine.Event.OperationFailed);
- } catch (NoTransitionException e1) {
+ } catch (Exception e1) {
+ }
+ CreateCmdResult res = new CreateCmdResult(null, null);
+ res.setResult("Failed to update copying state: " + e.toString());
+ context.getParentCallback().complete(res);
+ } catch (ConcurrentOperationException e) {
+ s_logger.debug("Failed to update copying state: ", e);
+ try {
+ objectInDataStoreMgr.update(destObj, ObjectInDataStoreStateMachine.Event.OperationFailed);
+ } catch (Exception e1) {
}
CreateCmdResult res = new CreateCmdResult(null, null);
res.setResult("Failed to update copying state: " + e.toString());
@@ -268,6 +311,10 @@ public class DataObjectManagerImpl implements DataObjectManager {
s_logger.debug("destroy failed", e);
CreateCmdResult res = new CreateCmdResult(null, null);
callback.complete(res);
+ } catch (ConcurrentOperationException e) {
+ s_logger.debug("destroy failed", e);
+ CreateCmdResult res = new CreateCmdResult(null, null);
+ callback.complete(res);
}
DeleteContext<CommandResult> context = new DeleteContext<CommandResult>(callback, data);
@@ -288,6 +335,8 @@ public class DataObjectManagerImpl implements DataObjectManager {
objectInDataStoreMgr.update(destObj, Event.OperationFailed);
} catch (NoTransitionException e) {
s_logger.debug("delete failed", e);
+ } catch (ConcurrentOperationException e) {
+ s_logger.debug("delete failed", e);
}
} else {
@@ -295,6 +344,8 @@ public class DataObjectManagerImpl implements DataObjectManager {
objectInDataStoreMgr.update(destObj, Event.OperationSuccessed);
} catch (NoTransitionException e) {
s_logger.debug("delete failed", e);
+ } catch (ConcurrentOperationException e) {
+ s_logger.debug("delete failed", e);
}
}
@@ -318,6 +369,9 @@ public class DataObjectManagerImpl implements DataObjectManager {
} catch (NoTransitionException e) {
s_logger.debug("Failed to update state", e);
throw new CloudRuntimeException("Failed to update state", e);
+ } catch (ConcurrentOperationException e) {
+ s_logger.debug("Failed to update state", e);
+ throw new CloudRuntimeException("Failed to update state", e);
}
return objInStore;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/de44a778/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManager.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManager.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManager.java
index b72d07b..fbd315e 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManager.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManager.java
@@ -22,6 +22,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine.Event;
import com.cloud.agent.api.to.DataObjectType;
+import com.cloud.exception.ConcurrentOperationException;
import com.cloud.storage.DataStoreRole;
import com.cloud.utils.fsm.NoTransitionException;
@@ -32,7 +33,7 @@ public interface ObjectInDataStoreManager {
public DataObject get(DataObject dataObj, DataStore store);
- public boolean update(DataObject vo, Event event) throws NoTransitionException;
+ public boolean update(DataObject vo, Event event) throws NoTransitionException, ConcurrentOperationException;
DataObjectInStore findObject(long objId, DataObjectType type, long dataStoreId, DataStoreRole role);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/de44a778/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
index 4b3d4a6..427609e 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/ObjectInDataStoreManagerImpl.java
@@ -42,6 +42,7 @@ import org.springframework.stereotype.Component;
import com.cloud.agent.api.to.DataObjectType;
import com.cloud.agent.api.to.S3TO;
+import com.cloud.exception.ConcurrentOperationException;
import com.cloud.storage.DataStoreRole;
import com.cloud.storage.VMTemplateStoragePoolVO;
import com.cloud.storage.dao.SnapshotDao;
@@ -127,14 +128,14 @@ public class ObjectInDataStoreManagerImpl implements ObjectInDataStoreManager {
if (dataStore.getTO() instanceof S3TO) {
TemplateInfo tmpl = (TemplateInfo) obj;
installPath += "/" + tmpl.getUniqueName(); // for S3, we
- // append
- // template name
- // in the path
- // for template
- // sync since we
- // don't have
- // template.properties
- // there
+ // append
+ // template name
+ // in the path
+ // for template
+ // sync since we
+ // don't have
+ // template.properties
+ // there
}
ts.setInstallPath(installPath);
ts.setState(ObjectInDataStoreStateMachine.State.Allocated);
@@ -221,35 +222,40 @@ public class ObjectInDataStoreManagerImpl implements ObjectInDataStoreManager {
}
@Override
- public boolean update(DataObject data, Event event) throws NoTransitionException {
+ public boolean update(DataObject data, Event event) throws NoTransitionException, ConcurrentOperationException {
DataObjectInStore obj = this.findObject(data, data.getDataStore());
if (obj == null) {
throw new CloudRuntimeException("can't find mapping in ObjectInDataStore table for: " + data);
}
+ boolean result = true;
if (data.getDataStore().getRole() == DataStoreRole.Image
|| data.getDataStore().getRole() == DataStoreRole.ImageCache) {
switch (data.getType()) {
case TEMPLATE:
- this.stateMachines.transitTo(obj, event, null, templateDataStoreDao);
+ result = this.stateMachines.transitTo(obj, event, null, templateDataStoreDao);
break;
case SNAPSHOT:
- this.stateMachines.transitTo(obj, event, null, snapshotDataStoreDao);
+ result = this.stateMachines.transitTo(obj, event, null, snapshotDataStoreDao);
break;
case VOLUME:
- this.stateMachines.transitTo(obj, event, null, volumeDataStoreDao);
+ result = this.stateMachines.transitTo(obj, event, null, volumeDataStoreDao);
break;
}
} else if (data.getType() == DataObjectType.TEMPLATE && data.getDataStore().getRole() == DataStoreRole.Primary) {
- this.stateMachines.transitTo(obj, event, null, templatePoolDao);
+ result = this.stateMachines.transitTo(obj, event, null, templatePoolDao);
} else if (data.getType() == DataObjectType.SNAPSHOT && data.getDataStore().getRole() == DataStoreRole.Primary) {
- this.stateMachines.transitTo(obj, event, null, snapshotDataStoreDao);
+ result = this.stateMachines.transitTo(obj, event, null, snapshotDataStoreDao);
} else {
throw new CloudRuntimeException("Invalid data or store type: " + data.getType() + " "
+ data.getDataStore().getRole());
}
+
+ if (!result){
+ throw new ConcurrentOperationException("Multiple threads are trying to update data object state, racing condition");
+ }
return true;
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/de44a778/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
index 1d36f93..e9316ff 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
@@ -332,7 +332,7 @@ public class VolumeServiceImpl implements VolumeService {
try {
templateOnPrimaryStoreObj.processEvent(Event.CreateOnlyRequested);
} catch (Exception e) {
- s_logger.info("Got exception in case of multi-thread");
+ s_logger.info("Multiple threads are trying to copy template to primary storage, current thread should just wait");
try {
templateOnPrimaryStoreObj = waitForTemplateDownloaded(dataStore, template);
} catch (Exception e1) {
@@ -1050,7 +1050,7 @@ public class VolumeServiceImpl implements VolumeService {
try {
_resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(volume.getAccountId()),
com.cloud.configuration.Resource.ResourceType.secondary_storage, volInfo.getSize()
- - volInfo.getPhysicalSize());
+ - volInfo.getPhysicalSize());
} catch (ResourceAllocationException e) {
s_logger.warn(e.getMessage());
_alertMgr.sendAlert(AlertManager.ALERT_TYPE_RESOURCE_LIMIT_EXCEEDED,
@@ -1075,8 +1075,8 @@ public class VolumeServiceImpl implements VolumeService {
if (toBeDownloaded.size() > 0) {
for (VolumeDataStoreVO volumeHost : toBeDownloaded) {
if (volumeHost.getDownloadUrl() == null) { // If url is null we
- // can't initiate the
- // download
+ // can't initiate the
+ // download
continue;
}
s_logger.debug("Volume " + volumeHost.getVolumeId() + " needs to be downloaded to " + store.getName());
[20/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-1192: Disk I/O Statistics support KVM only util 20130625
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/3bb4ec9f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3bb4ec9f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3bb4ec9f
Branch: refs/heads/vmsync
Commit: 3bb4ec9f657be41fb22705e0cd80a4245a62e26e
Parents: 82958f0
Author: Wei Zhou <w....@leaseweb.com>
Authored: Wed Jun 26 11:10:11 2013 +0200
Committer: Wei Zhou <w....@leaseweb.com>
Committed: Wed Jun 26 11:10:11 2013 +0200
----------------------------------------------------------------------
api/src/com/cloud/vm/VmDiskStats.java | 8 +++---
.../com/cloud/agent/api/VmDiskStatsEntry.java | 26 ++++++++++----------
server/src/com/cloud/server/StatsCollector.java | 2 ++
server/src/com/cloud/vm/UserVmManagerImpl.java | 5 ++--
4 files changed, 21 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3bb4ec9f/api/src/com/cloud/vm/VmDiskStats.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/vm/VmDiskStats.java b/api/src/com/cloud/vm/VmDiskStats.java
index 0cf82d0..0551011 100644
--- a/api/src/com/cloud/vm/VmDiskStats.java
+++ b/api/src/com/cloud/vm/VmDiskStats.java
@@ -19,12 +19,12 @@ package com.cloud.vm;
public interface VmDiskStats {
// vm related disk stats
- public Long getIORead();
+ public long getIORead();
- public Long getIOWrite();
+ public long getIOWrite();
- public Long getBytesRead();
+ public long getBytesRead();
- public Long getBytesWrite();
+ public long getBytesWrite();
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3bb4ec9f/core/src/com/cloud/agent/api/VmDiskStatsEntry.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/api/VmDiskStatsEntry.java b/core/src/com/cloud/agent/api/VmDiskStatsEntry.java
index 9bec031..8daa69b 100644
--- a/core/src/com/cloud/agent/api/VmDiskStatsEntry.java
+++ b/core/src/com/cloud/agent/api/VmDiskStatsEntry.java
@@ -22,15 +22,15 @@ public class VmDiskStatsEntry implements VmDiskStats {
String vmName;
String path;
- Long ioRead = 0L;
- Long ioWrite = 0L;
- Long bytesWrite = 0L;
- Long bytesRead = 0L;
+ long ioRead = 0;
+ long ioWrite = 0;
+ long bytesWrite = 0;
+ long bytesRead = 0;
public VmDiskStatsEntry() {
}
- public VmDiskStatsEntry(String vmName, String path, Long ioWrite, Long ioRead, Long bytesWrite, Long bytesRead) {
+ public VmDiskStatsEntry(String vmName, String path, long ioWrite, long ioRead, long bytesWrite, long bytesRead) {
this.ioRead = ioRead;
this.ioWrite = ioWrite;
this.bytesRead = bytesRead;
@@ -55,35 +55,35 @@ public class VmDiskStatsEntry implements VmDiskStats {
return path;
}
- public void setBytesRead(Long bytesRead) {
+ public void setBytesRead(long bytesRead) {
this.bytesRead = bytesRead;
}
- public Long getBytesRead() {
+ public long getBytesRead() {
return bytesRead;
}
- public void setBytesWrite(Long bytesWrite) {
+ public void setBytesWrite(long bytesWrite) {
this.bytesWrite = bytesWrite;
}
- public Long getBytesWrite() {
+ public long getBytesWrite() {
return bytesWrite;
}
- public void setIORead(Long ioRead) {
+ public void setIORead(long ioRead) {
this.ioRead = ioRead;
}
- public Long getIORead() {
+ public long getIORead() {
return ioRead;
}
- public void setIOWrite(Long ioWrite) {
+ public void setIOWrite(long ioWrite) {
this.ioWrite = ioWrite;
}
- public Long getIOWrite() {
+ public long getIOWrite() {
return ioWrite;
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3bb4ec9f/server/src/com/cloud/server/StatsCollector.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/StatsCollector.java b/server/src/com/cloud/server/StatsCollector.java
index 68c8600..1a6e424 100755
--- a/server/src/com/cloud/server/StatsCollector.java
+++ b/server/src/com/cloud/server/StatsCollector.java
@@ -65,6 +65,7 @@ import com.cloud.host.HostStats;
import com.cloud.host.HostVO;
import com.cloud.host.Status;
import com.cloud.host.dao.HostDao;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.resource.ResourceState;
import com.cloud.storage.StorageManager;
import com.cloud.storage.StoragePoolHostVO;
@@ -407,6 +408,7 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc
sc.addAnd("status", SearchCriteria.Op.EQ, Status.Up.toString());
sc.addAnd("resourceState", SearchCriteria.Op.NIN, ResourceState.Maintenance, ResourceState.PrepareForMaintenance, ResourceState.ErrorInMaintenance);
sc.addAnd("type", SearchCriteria.Op.EQ, Host.Type.Routing.toString());
+ sc.addAnd("hypervisorType", SearchCriteria.Op.EQ, HypervisorType.KVM); // support KVM only util 2013.06.25
List<HostVO> hosts = _hostDao.search(sc, null);
for (HostVO host : hosts) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3bb4ec9f/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index 66103fb..3cef182 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -3388,9 +3388,8 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use
@Override
public void collectVmDiskStatistics (UserVmVO userVm) {
- // support KVM and XenServer only
- if (!userVm.getHypervisorType().equals(HypervisorType.XenServer)
- && !userVm.getHypervisorType().equals(HypervisorType.KVM))
+ // support KVM only util 2013.06.25
+ if (!userVm.getHypervisorType().equals(HypervisorType.KVM))
return;
// Collect vm disk statistics from host before stopping Vm
long hostId = userVm.getHostId();
[05/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-1767 VMWare DVS - cannot use untagged portgroups
Signed-off-by: Sateesh Chodapuneedi <sa...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c36a952f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c36a952f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c36a952f
Branch: refs/heads/vmsync
Commit: c36a952f159fccb899409a8eca97e0f7621905e3
Parents: b3927ff
Author: Sateesh Chodapuneedi <sa...@apache.org>
Authored: Tue Jun 25 19:43:20 2013 +0530
Committer: Sateesh Chodapuneedi <sa...@apache.org>
Committed: Tue Jun 25 19:43:20 2013 +0530
----------------------------------------------------------------------
.../vmware/manager/VmwareManagerImpl.java | 9 ++--
.../vmware/resource/VmwareResource.java | 6 ++-
.../com/cloud/network/VmwareTrafficLabel.java | 5 ++-
.../vmware/mo/HypervisorHostHelper.java | 47 +++++++-------------
4 files changed, 32 insertions(+), 35 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c36a952f/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
index 77a95a4..06451d8 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java
@@ -336,12 +336,15 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw
// prepare at least one network on the vswitch to enable OVF importing
String vSwitchName = privateTrafficLabel;
String vlanId = null;
+ String vlanToken;
String[] tokens = privateTrafficLabel.split(",");
- if(tokens.length == 2) {
+ if(tokens.length >= 2) {
vSwitchName = tokens[0].trim();
- vlanId = tokens[1].trim();
+ vlanToken = tokens[1].trim();
+ if (!vlanToken.isEmpty()) {
+ vlanId = vlanToken;
+ }
}
-
s_logger.info("Preparing network on host " + hostMo.getContext().toString() + " for " + privateTrafficLabel);
HypervisorHostHelper.prepareNetwork(vSwitchName, "cloud.private", hostMo, vlanId, null, null, 180000, false);
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c36a952f/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index 32e28d1..d860383 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -2981,7 +2981,11 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
// If all 3 fields are mentioned then number of tokens would be 3.
// If only <VSWITCH>,<VLANID> are mentioned then number of tokens would be 2.
if(tokens.length == 2 || tokens.length == 3) {
- return new Pair<String, String>(tokens[0], tokens[1]);
+ String vlanToken = tokens[1];
+ if (vlanToken.isEmpty()) {
+ vlanToken = Vlan.UNTAGGED;
+ }
+ return new Pair<String, String>(tokens[0], vlanToken);
} else {
return new Pair<String, String>(nicTo.getName(), Vlan.UNTAGGED);
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c36a952f/plugins/hypervisors/vmware/src/com/cloud/network/VmwareTrafficLabel.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/network/VmwareTrafficLabel.java b/plugins/hypervisors/vmware/src/com/cloud/network/VmwareTrafficLabel.java
index 90a4278..8d2890a 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/network/VmwareTrafficLabel.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/network/VmwareTrafficLabel.java
@@ -74,7 +74,10 @@ public class VmwareTrafficLabel implements TrafficLabel {
_vSwitchName = tokens[VMWARE_LABEL_FIELD_INDEX_NAME].trim();
}
if (tokens.length > VMWARE_LABEL_FIELD_INDEX_VLANID) {
- _vlanId = tokens[VMWARE_LABEL_FIELD_INDEX_VLANID].trim();
+ String vlanToken = tokens[VMWARE_LABEL_FIELD_INDEX_VLANID].trim();
+ if (!vlanToken.isEmpty()) {
+ _vlanId = vlanToken;
+ }
}
if (tokens.length > VMWARE_LABEL_FIELD_INDEX_VSWITCH_TYPE) {
_vSwitchType = VirtualSwitchType.getType(tokens[VMWARE_LABEL_FIELD_INDEX_VSWITCH_TYPE].trim());
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c36a952f/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
index 3739058..994fb30 100755
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java
@@ -461,7 +461,7 @@ public class HypervisorHostHelper {
VmwareDistributedVirtualSwitchPvlanSpec pvlanSpec = null;
//VMwareDVSPvlanConfigSpec pvlanSpec = null;
DVSSecurityPolicy secPolicy;
- VMwareDVSPortSetting dvsPortSetting;
+ VMwareDVSPortSetting dvsPortSetting = null;
DVPortgroupConfigSpec dvPortGroupSpec;
DVPortgroupConfigInfo dvPortgroupInfo;
//DVSConfigInfo dvsInfo;
@@ -551,30 +551,21 @@ public class HypervisorHostHelper {
}
// Next, create the port group. For this, we need to create a VLAN spec.
- if (vid == null) {
- vlanSpec = createDVPortVlanSpec();
- } else {
- if (spvlanid == null) {
- // Create vlan spec.
- vlanSpec = createDVPortVlanIdSpec(vid);
- } else {
- // Create a pvlan spec. The pvlan spec is different from the pvlan config spec
- // that we created earlier. The pvlan config spec is used to configure the switch
- // with a <primary vlanId, secondary vlanId> tuple. The pvlan spec is used
- // to configure a port group (i.e., a network) with a secondary vlan id. We don't
- // need to mention more than the secondary vlan id because one secondary vlan id
- // can be associated with only one primary vlan id. Give vCenter the secondary vlan id,
- // and it will find out the associated primary vlan id and do the rest of the
- // port group configuration.
- pvlanSpec = createDVPortPvlanIdSpec(spvlanid);
- }
- }
-
// NOTE - VmwareDistributedVirtualSwitchPvlanSpec extends VmwareDistributedVirtualSwitchVlanSpec.
- if (pvlanSpec != null) {
+ if (vid == null || spvlanid == null) {
+ vlanSpec = createDVPortVlanIdSpec(vid);
+ dvsPortSetting = createVmwareDVPortSettingSpec(shapingPolicy, secPolicy, vlanSpec);
+ } else if (spvlanid != null) {
+ // Create a pvlan spec. The pvlan spec is different from the pvlan config spec
+ // that we created earlier. The pvlan config spec is used to configure the switch
+ // with a <primary vlanId, secondary vlanId> tuple. The pvlan spec is used
+ // to configure a port group (i.e., a network) with a secondary vlan id. We don't
+ // need to mention more than the secondary vlan id because one secondary vlan id
+ // can be associated with only one primary vlan id. Give vCenter the secondary vlan id,
+ // and it will find out the associated primary vlan id and do the rest of the
+ // port group configuration.
+ pvlanSpec = createDVPortPvlanIdSpec(spvlanid);
dvsPortSetting = createVmwareDVPortSettingSpec(shapingPolicy, secPolicy, pvlanSpec);
- } else {
- dvsPortSetting = createVmwareDVPortSettingSpec(shapingPolicy, secPolicy, vlanSpec);
}
dvPortGroupSpec = createDvPortGroupSpec(networkName, dvsPortSetting, numPorts, autoExpandSupported);
@@ -804,17 +795,13 @@ public class HypervisorHostHelper {
pvlanConfigSpec.setOperation(operation.toString());
return pvlanConfigSpec;
}
- public static VmwareDistributedVirtualSwitchVlanIdSpec createDVPortVlanIdSpec(int vlanId) {
+
+ public static VmwareDistributedVirtualSwitchVlanIdSpec createDVPortVlanIdSpec(Integer vlanId) {
VmwareDistributedVirtualSwitchVlanIdSpec vlanIdSpec = new VmwareDistributedVirtualSwitchVlanIdSpec();
- vlanIdSpec.setVlanId(vlanId);
+ vlanIdSpec.setVlanId(vlanId == null ? 0 : vlanId.intValue());
return vlanIdSpec;
}
- public static VmwareDistributedVirtualSwitchVlanSpec createDVPortVlanSpec() {
- VmwareDistributedVirtualSwitchVlanSpec vlanSpec = new VmwareDistributedVirtualSwitchVlanSpec();
- return vlanSpec;
- }
-
public static DVSSecurityPolicy createDVSSecurityPolicy() {
DVSSecurityPolicy secPolicy = new DVSSecurityPolicy();
BoolPolicy allow = new BoolPolicy();
[48/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
reverts commit 7e96bf5f1989f43db969ee026e34ae96efa54cf0 which causes regression of CreateAccount dialog.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6ea38bff
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6ea38bff
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6ea38bff
Branch: refs/heads/vmsync
Commit: 6ea38bff1662ccbe5698e32b74a7586fabe49b21
Parents: 8dc99d9
Author: Jessica Wang <je...@apache.org>
Authored: Thu Jun 27 09:50:57 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Thu Jun 27 09:50:57 2013 -0700
----------------------------------------------------------------------
ui/scripts/ui/dialog.js | 4 +-
ui/scripts/ui/widgets/multiEdit.js | 5 +-
ui/scripts/vpc.js | 289 ++++++++++----------------------
3 files changed, 93 insertions(+), 205 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6ea38bff/ui/scripts/ui/dialog.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js
index e4ca389..6f05af2 100644
--- a/ui/scripts/ui/dialog.js
+++ b/ui/scripts/ui/dialog.js
@@ -236,7 +236,7 @@
response: {
success: function(args) {
$(args.data).each(function() {
- var id = this.id ? this.id : this.name;
+ var id = this.id;
var description = this.description;
if (args.descriptionField)
@@ -272,7 +272,7 @@
.appendTo($value);
// Pass form item to provider for additional manipulation
- $.extend(selectArgs, { $select: $input, $form: $form, type: 'createForm' });
+ $.extend(selectArgs, { $select: $input });
if (dependsOn) {
$dependsOn = $input.closest('form').find('input, select').filter(function() {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6ea38bff/ui/scripts/ui/widgets/multiEdit.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/multiEdit.js b/ui/scripts/ui/widgets/multiEdit.js
index 26a6bdb..ea177c5 100755
--- a/ui/scripts/ui/widgets/multiEdit.js
+++ b/ui/scripts/ui/widgets/multiEdit.js
@@ -336,7 +336,8 @@
},
error: function(args) {
error(args);
- $multi.trigger('refresh');
+ $loading.remove();
+ $dataItem.show();
return cloudStack.dialog.error;
}
@@ -401,8 +402,6 @@
var editableFields = {};
$.each(fields, function(key, field) {
- field.isDisabled = false;
-
if (field && field.isEditable) editableFields[key] = $.extend(true, {}, field, {
defaultValue: data[key]
});
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6ea38bff/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index 5742286..310fbb6 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -60,15 +60,13 @@
'number':{
label:'Rule Number',
- edit:true,
- isEditable: true
+ edit:true
},
- 'cidrlist': { edit: true, label: 'label.cidr', isEditable: true },
+ 'cidrlist': { edit: true, label: 'label.cidr' },
action: {
label: 'Action',
- isEditable: true,
select: function(args) {
args.response.success({
data: [
@@ -80,125 +78,63 @@
},
'protocol': {
label: 'label.protocol',
- isEditable: true,
select: function(args) {
- var isEditDialog = args.type === 'createForm';
-
args.$select.change(function() {
- var $inputs, $icmpFields, $otherFields, $portFields, $protocolFields, $protocolinput;
-
- //
- // Editing existing rules in createForm dialog
- //
- if (isEditDialog) {
- $inputs = args.$form.find('.form-item');
- $icmpFields = $inputs.filter(function() {
- var name = $(this).attr('rel');
-
- return $.inArray(name, [
- 'icmptype',
- 'icmpcode'
- ]) > -1;
- });
- $otherFields = $inputs.filter(function() {
- var name = $(this).attr('rel');
-
- return name != 'protocolnumber' &&
- name != 'icmptype' &&
- name != 'icmpcode' &&
- name != 'cidrlist';
- });
- $portFields = $inputs.filter(function() {
- var name = $(this).attr('rel');
- return $.inArray(name, [
- 'startport',
- 'endport'
- ]) > -1;
- });
- $protocolFields = $inputs.filter(function(){
- var name = $(this).attr('rel');
-
- return $.inArray(name,['protocolnumber']) > -1;
- });
+ var $inputs = args.$form.find('input');
+ var $icmpFields = $inputs.filter(function() {
+ var name = $(this).attr('name');
+
+ return $.inArray(name, [
+ 'icmptype',
+ 'icmpcode'
+ ]) > -1;
+ });
+ var $otherFields = $inputs.filter(function() {
+ var name = $(this).attr('name');
- if ($(this).val() == 'protocolnumber' ){
- $icmpFields.hide();
- $portFields.show();
- $protocolFields.show();
- } else if ($(this).val() == 'icmp') {
- $icmpFields.show();
- $protocolFields.hide();
- $portFields.hide();
- } else {
- $otherFields.show();
- $icmpFields.hide();
- $protocolFields.hide();
-
- if ($(this).val() == 'all') {
- $portFields.hide();
- }
- }
- } else {
- //
- // Add new form
- //
- $inputs = args.$form.find('input');
- $icmpFields = $inputs.filter(function() {
- var name = $(this).attr('name');
-
- return $.inArray(name, [
- 'icmptype',
- 'icmpcode'
- ]) > -1;
- });
- $otherFields = $inputs.filter(function() {
- var name = $(this).attr('name');
-
- return name != 'protocolnumber' &&
- name != 'icmptype' &&
- name != 'icmpcode' &&
- name != 'cidrlist' &&
- name != 'number';
- });
- $portFields = $inputs.filter(function() {
- var name = $(this).attr('name');
- return $.inArray(name, [
- 'startport',
- 'endport'
- ]) > -1;
- });
+ return name != 'protocolnumber' &&
+ name != 'icmptype' &&
+ name != 'icmpcode' &&
+ name != 'cidrlist';
+ });
+ var $portFields = $inputs.filter(function() {
+ var name = $(this).attr('name');
+ return $.inArray(name, [
+ 'startport',
+ 'endport'
+ ]) > -1;
+ });
- $protocolinput = args.$form.find('td input');
- $protocolFields = $protocolinput.filter(function(){
- var name = $(this).attr('name');
+ var $protocolinput = args.$form.find('td input');
+ var $protocolFields = $protocolinput.filter(function(){
+ var name = $(this).attr('name');
- return $.inArray(name,['protocolnumber']) > -1;
- });
+ return $.inArray(name,['protocolnumber']) > -1;
+ });
- if ($(this).val() == 'protocolnumber' ){
- $icmpFields.hide();
- $otherFields.hide();
- $protocolFields.show().addClass('required');
- } else if ($(this).val() == 'icmp') {
- $icmpFields.show();
- $icmpFields.attr('disabled', false);
- $protocolFields.hide().removeClass('required');
- $otherFields.attr('disabled', 'disabled');
- $otherFields.hide();
- $otherFields.parent().find('label.error').hide();
- } else {
- $otherFields.show();
- $otherFields.parent().find('label.error').hide();
- $otherFields.attr('disabled', false);
- $icmpFields.attr('disabled', 'disabled');
- $icmpFields.hide();
- $icmpFields.parent().find('label.error').hide();
- $protocolFields.hide().removeClass('required');
- if ($(this).val() == 'all'){
- $portFields.attr('disabled', 'disabled');
- $portFields.hide();
- }
- }
+ if ($(this).val() == 'protocolnumber' ){
+ $icmpFields.hide();
+ $otherFields.hide();
+ $protocolFields.show().addClass('required');
+ } else if ($(this).val() == 'icmp') {
+ $icmpFields.show();
+ $icmpFields.attr('disabled', false);
+ $protocolFields.hide().removeClass('required');
+ $otherFields.attr('disabled', 'disabled');
+ $otherFields.hide();
+ $otherFields.parent().find('label.error').hide();
+ } else {
+ $otherFields.show();
+ $otherFields.parent().find('label.error').hide();
+ $otherFields.attr('disabled', false);
+ $icmpFields.attr('disabled', 'disabled');
+ $icmpFields.hide();
+ $icmpFields.parent().find('label.error').hide();
+ $protocolFields.hide().removeClass('required');
+ if ($(this).val() == 'all'){
+ $portFields.attr('disabled', 'disabled');
+ $portFields.hide();
+ }
}
});
@@ -217,9 +153,9 @@
}
},
- 'protocolnumber': {label:'Protocol Number',edit:true, isEditable: true},
- 'startport': { edit: true, label: 'label.start.port', isOptional: true, isEditable: true },
- 'endport': { edit: true, label: 'label.end.port', isOptional: true, isEditable: true },
+ 'protocolnumber': {label:'Protocol Number',edit:true},
+ 'startport': { edit: true, label: 'label.start.port', isOptional: true },
+ 'endport': { edit: true, label: 'label.end.port', isOptional: true },
'networkid': {
label: 'Select Tier',
select: function(args) {
@@ -256,11 +192,10 @@
});
}
},
- 'icmptype': { edit: true, label: 'ICMP.type', isDisabled: true, desc:'Please specify -1 if you want to allow all ICMP types', defaultValue:'-1', isEditable: true },
- 'icmpcode': { edit: true, label: 'ICMP.code', isDisabled: true, desc:'Please specify -1 if you want to allow all ICMP codes', defaultValue:'-1', isEditable: true },
+ 'icmptype': { edit: true, label: 'ICMP.type', isDisabled: true, desc:'Please specify -1 if you want to allow all ICMP types', defaultValue:'-1' },
+ 'icmpcode': { edit: true, label: 'ICMP.code', isDisabled: true, desc:'Please specify -1 if you want to allow all ICMP codes', defaultValue:'-1' },
'traffictype' : {
label: 'label.traffic.type',
- isEditable: true,
select: function(args) {
args.response.success({
data: [
@@ -284,100 +219,54 @@
var $multi = args.$multi;
//Support for Protocol Number between 0 to 255
if(args.data.protocol == 'protocolnumber'){
- $.extend(args.data,{protocol:args.data.protocolnumber});
- delete args.data.protocolnumber;
+ $.extend(args.data,{protocol:args.data.protocolnumber});
+ delete args.data.protocolnumber;
}
else
delete args.data.protocolnumber;
-
+
if((args.data.protocol == 'tcp' || args.data.protocol == 'udp') && (args.data.startport=="" || args.data.startport == undefined)){
- cloudStack.dialog.notice({message:_l('Start Port or End Port value should not be blank')});
+ cloudStack.dialog.notice({message:_l('Start Port or End Port value should not be blank')});
$(window).trigger('cloudStack.fullRefresh');
}
else if((args.data.protocol == 'tcp' || args.data.protocol == 'udp') && (args.data.endport=="" || args.data.endport == undefined)){
- cloudStack.dialog.notice({message:_l('Start Port or End Port value should not be blank')});
+ cloudStack.dialog.notice({message:_l('Start Port or End Port value should not be blank')});
$(window).trigger('cloudStack.fullRefresh');
}
- else{
- $.ajax({
- url: createURL('createNetworkACL'),
- data: $.extend(args.data, {
- aclid: args.context.aclLists[0].id
- }),
- dataType: 'json',
- success: function(data) {
- args.response.success({
- _custom: {
- jobId: data.createnetworkaclresponse.jobid,
- getUpdatedItem: function(json) {
- $(window).trigger('cloudStack.fullRefresh');
+ else{
+ $.ajax({
+ url: createURL('createNetworkACL'),
+ data: $.extend(args.data, {
+ aclid: args.context.aclLists[0].id
+ }),
+ dataType: 'json',
+ success: function(data) {
+ args.response.success({
+ _custom: {
+ jobId: data.createnetworkaclresponse.jobid,
+ getUpdatedItem: function(json) {
+ $(window).trigger('cloudStack.fullRefresh');
- return data;
- }
- },
- notification: {
- label: 'label.add.ACL',
- poll: pollAsyncJobResult
+ return data;
}
- });
- },
- error: function(data) {
- args.response.error(parseXMLHttpResponse(data));
- }
- });
- }
+ },
+ notification: {
+ label: 'label.add.ACL',
+ poll: pollAsyncJobResult
+ }
+ });
+ },
+ error: function(data) {
+ args.response.error(parseXMLHttpResponse(data));
+ }
+ });
+ }
}
},
actions: {
- edit: {
- label: 'label.edit',
- action: function(args) {
- var data = {
- id: args.context.multiRule[0].id,
- cidrlist: args.data.cidrlist,
- number: args.data.number,
- protocol: args.data.protocol,
- traffictype: args.data.traffictype,
- action: args.data.action
- };
-
- if (data.protocol === 'tcp' || data.protocol === 'udp') {
- $.extend(data, {
- startport: args.data.startport,
- endport: args.data.endport
- });
- } else if (data.protocol === 'icmp') {
- $.extend(data, {
- icmptype: args.data.icmptype,
- icmpcode: args.data.icmpcode
- });
- } else if (data.protocol === 'protocolnumber') {
- $.extend(data, {
- protocolnumber: args.data.protocolnumber
- });
- }
-
- $.ajax({
- url: createURL('updateNetworkACLItem'),
- data: data,
- success: function(json) {
- args.response.success({
- _custom: { jobId: json.createnetworkaclresponse.jobid }, // API response obj name needs to be fixed
- notification: {
- label: 'Edit ACL rule',
- poll: pollAsyncJobResult
- }
- });
- },
- error: function(error) {
- args.response.error(parseXMLHttpResponse(error));
- }
- });
- }
- },
destroy: {
label: 'label.remove.ACL',
action: function(args) {
[29/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-2835: Change function from execute to executeUpdate
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1c102a05
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1c102a05
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1c102a05
Branch: refs/heads/vmsync
Commit: 1c102a0589cb5b99c2c6922e8eea0a082608410d
Parents: c059153
Author: Nitin Mehta <ni...@citrix.com>
Authored: Wed Jun 26 17:47:17 2013 +0530
Committer: Nitin Mehta <ni...@citrix.com>
Committed: Wed Jun 26 17:47:17 2013 +0530
----------------------------------------------------------------------
engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1c102a05/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
index c67a971..a70f4b9 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
@@ -213,7 +213,7 @@ public class Upgrade410to420 implements DbUpgrade {
// update templete ID of system Vms
pstmt = conn.prepareStatement("update `cloud`.`vm_instance` set vm_template_id = ? where type <> 'User' and hypervisor_type = 'KVM'");
pstmt.setLong(1, templateId);
- pstmt.execute();
+ pstmt.executeUpdate();
pstmt.close();
// Change value of global configuration parameter router.template.kvm
pstmt = conn.prepareStatement("INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'router.template.kvm', 'systemvm-kvm-4.2', 'Name of the default router template on KVM')");
[34/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
CLOUDSTACK-3170: Support editing ACL rule items
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/7e96bf5f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/7e96bf5f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/7e96bf5f
Branch: refs/heads/vmsync
Commit: 7e96bf5f1989f43db969ee026e34ae96efa54cf0
Parents: aeab881
Author: Brian Federle <br...@citrix.com>
Authored: Wed Jun 26 12:07:52 2013 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Wed Jun 26 12:28:37 2013 -0700
----------------------------------------------------------------------
ui/scripts/ui/dialog.js | 4 +-
ui/scripts/ui/widgets/multiEdit.js | 5 +-
ui/scripts/vpc.js | 289 ++++++++++++++++++++++----------
3 files changed, 205 insertions(+), 93 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e96bf5f/ui/scripts/ui/dialog.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js
index 6f05af2..e4ca389 100644
--- a/ui/scripts/ui/dialog.js
+++ b/ui/scripts/ui/dialog.js
@@ -236,7 +236,7 @@
response: {
success: function(args) {
$(args.data).each(function() {
- var id = this.id;
+ var id = this.id ? this.id : this.name;
var description = this.description;
if (args.descriptionField)
@@ -272,7 +272,7 @@
.appendTo($value);
// Pass form item to provider for additional manipulation
- $.extend(selectArgs, { $select: $input });
+ $.extend(selectArgs, { $select: $input, $form: $form, type: 'createForm' });
if (dependsOn) {
$dependsOn = $input.closest('form').find('input, select').filter(function() {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e96bf5f/ui/scripts/ui/widgets/multiEdit.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/multiEdit.js b/ui/scripts/ui/widgets/multiEdit.js
index ea177c5..26a6bdb 100755
--- a/ui/scripts/ui/widgets/multiEdit.js
+++ b/ui/scripts/ui/widgets/multiEdit.js
@@ -336,8 +336,7 @@
},
error: function(args) {
error(args);
- $loading.remove();
- $dataItem.show();
+ $multi.trigger('refresh');
return cloudStack.dialog.error;
}
@@ -402,6 +401,8 @@
var editableFields = {};
$.each(fields, function(key, field) {
+ field.isDisabled = false;
+
if (field && field.isEditable) editableFields[key] = $.extend(true, {}, field, {
defaultValue: data[key]
});
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7e96bf5f/ui/scripts/vpc.js
----------------------------------------------------------------------
diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js
index 310fbb6..5742286 100644
--- a/ui/scripts/vpc.js
+++ b/ui/scripts/vpc.js
@@ -60,13 +60,15 @@
'number':{
label:'Rule Number',
- edit:true
+ edit:true,
+ isEditable: true
},
- 'cidrlist': { edit: true, label: 'label.cidr' },
+ 'cidrlist': { edit: true, label: 'label.cidr', isEditable: true },
action: {
label: 'Action',
+ isEditable: true,
select: function(args) {
args.response.success({
data: [
@@ -78,63 +80,125 @@
},
'protocol': {
label: 'label.protocol',
+ isEditable: true,
select: function(args) {
+ var isEditDialog = args.type === 'createForm';
+
args.$select.change(function() {
- var $inputs = args.$form.find('input');
- var $icmpFields = $inputs.filter(function() {
- var name = $(this).attr('name');
-
- return $.inArray(name, [
- 'icmptype',
- 'icmpcode'
- ]) > -1;
- });
- var $otherFields = $inputs.filter(function() {
- var name = $(this).attr('name');
-
- return name != 'protocolnumber' &&
- name != 'icmptype' &&
- name != 'icmpcode' &&
- name != 'cidrlist';
- });
- var $portFields = $inputs.filter(function() {
- var name = $(this).attr('name');
- return $.inArray(name, [
- 'startport',
- 'endport'
- ]) > -1;
- });
+ var $inputs, $icmpFields, $otherFields, $portFields, $protocolFields, $protocolinput;
+
+ //
+ // Editing existing rules in createForm dialog
+ //
+ if (isEditDialog) {
+ $inputs = args.$form.find('.form-item');
+ $icmpFields = $inputs.filter(function() {
+ var name = $(this).attr('rel');
+
+ return $.inArray(name, [
+ 'icmptype',
+ 'icmpcode'
+ ]) > -1;
+ });
+ $otherFields = $inputs.filter(function() {
+ var name = $(this).attr('rel');
- var $protocolinput = args.$form.find('td input');
- var $protocolFields = $protocolinput.filter(function(){
- var name = $(this).attr('name');
+ return name != 'protocolnumber' &&
+ name != 'icmptype' &&
+ name != 'icmpcode' &&
+ name != 'cidrlist';
+ });
+ $portFields = $inputs.filter(function() {
+ var name = $(this).attr('rel');
+ return $.inArray(name, [
+ 'startport',
+ 'endport'
+ ]) > -1;
+ });
+ $protocolFields = $inputs.filter(function(){
+ var name = $(this).attr('rel');
- return $.inArray(name,['protocolnumber']) > -1;
- });
+ return $.inArray(name,['protocolnumber']) > -1;
+ });
- if ($(this).val() == 'protocolnumber' ){
- $icmpFields.hide();
- $otherFields.hide();
- $protocolFields.show().addClass('required');
- } else if ($(this).val() == 'icmp') {
- $icmpFields.show();
- $icmpFields.attr('disabled', false);
- $protocolFields.hide().removeClass('required');
- $otherFields.attr('disabled', 'disabled');
- $otherFields.hide();
- $otherFields.parent().find('label.error').hide();
- } else {
- $otherFields.show();
- $otherFields.parent().find('label.error').hide();
- $otherFields.attr('disabled', false);
- $icmpFields.attr('disabled', 'disabled');
- $icmpFields.hide();
- $icmpFields.parent().find('label.error').hide();
- $protocolFields.hide().removeClass('required');
- if ($(this).val() == 'all'){
- $portFields.attr('disabled', 'disabled');
+ if ($(this).val() == 'protocolnumber' ){
+ $icmpFields.hide();
+ $portFields.show();
+ $protocolFields.show();
+ } else if ($(this).val() == 'icmp') {
+ $icmpFields.show();
+ $protocolFields.hide();
$portFields.hide();
- }
+ } else {
+ $otherFields.show();
+ $icmpFields.hide();
+ $protocolFields.hide();
+
+ if ($(this).val() == 'all') {
+ $portFields.hide();
+ }
+ }
+ } else {
+ //
+ // Add new form
+ //
+ $inputs = args.$form.find('input');
+ $icmpFields = $inputs.filter(function() {
+ var name = $(this).attr('name');
+
+ return $.inArray(name, [
+ 'icmptype',
+ 'icmpcode'
+ ]) > -1;
+ });
+ $otherFields = $inputs.filter(function() {
+ var name = $(this).attr('name');
+
+ return name != 'protocolnumber' &&
+ name != 'icmptype' &&
+ name != 'icmpcode' &&
+ name != 'cidrlist' &&
+ name != 'number';
+ });
+ $portFields = $inputs.filter(function() {
+ var name = $(this).attr('name');
+ return $.inArray(name, [
+ 'startport',
+ 'endport'
+ ]) > -1;
+ });
+
+ $protocolinput = args.$form.find('td input');
+ $protocolFields = $protocolinput.filter(function(){
+ var name = $(this).attr('name');
+
+ return $.inArray(name,['protocolnumber']) > -1;
+ });
+
+ if ($(this).val() == 'protocolnumber' ){
+ $icmpFields.hide();
+ $otherFields.hide();
+ $protocolFields.show().addClass('required');
+ } else if ($(this).val() == 'icmp') {
+ $icmpFields.show();
+ $icmpFields.attr('disabled', false);
+ $protocolFields.hide().removeClass('required');
+ $otherFields.attr('disabled', 'disabled');
+ $otherFields.hide();
+ $otherFields.parent().find('label.error').hide();
+ } else {
+ $otherFields.show();
+ $otherFields.parent().find('label.error').hide();
+ $otherFields.attr('disabled', false);
+ $icmpFields.attr('disabled', 'disabled');
+ $icmpFields.hide();
+ $icmpFields.parent().find('label.error').hide();
+ $protocolFields.hide().removeClass('required');
+ if ($(this).val() == 'all'){
+ $portFields.attr('disabled', 'disabled');
+ $portFields.hide();
+ }
+ }
}
});
@@ -153,9 +217,9 @@
}
},
- 'protocolnumber': {label:'Protocol Number',edit:true},
- 'startport': { edit: true, label: 'label.start.port', isOptional: true },
- 'endport': { edit: true, label: 'label.end.port', isOptional: true },
+ 'protocolnumber': {label:'Protocol Number',edit:true, isEditable: true},
+ 'startport': { edit: true, label: 'label.start.port', isOptional: true, isEditable: true },
+ 'endport': { edit: true, label: 'label.end.port', isOptional: true, isEditable: true },
'networkid': {
label: 'Select Tier',
select: function(args) {
@@ -192,10 +256,11 @@
});
}
},
- 'icmptype': { edit: true, label: 'ICMP.type', isDisabled: true, desc:'Please specify -1 if you want to allow all ICMP types', defaultValue:'-1' },
- 'icmpcode': { edit: true, label: 'ICMP.code', isDisabled: true, desc:'Please specify -1 if you want to allow all ICMP codes', defaultValue:'-1' },
+ 'icmptype': { edit: true, label: 'ICMP.type', isDisabled: true, desc:'Please specify -1 if you want to allow all ICMP types', defaultValue:'-1', isEditable: true },
+ 'icmpcode': { edit: true, label: 'ICMP.code', isDisabled: true, desc:'Please specify -1 if you want to allow all ICMP codes', defaultValue:'-1', isEditable: true },
'traffictype' : {
label: 'label.traffic.type',
+ isEditable: true,
select: function(args) {
args.response.success({
data: [
@@ -219,54 +284,100 @@
var $multi = args.$multi;
//Support for Protocol Number between 0 to 255
if(args.data.protocol == 'protocolnumber'){
- $.extend(args.data,{protocol:args.data.protocolnumber});
- delete args.data.protocolnumber;
+ $.extend(args.data,{protocol:args.data.protocolnumber});
+ delete args.data.protocolnumber;
}
else
delete args.data.protocolnumber;
-
+
if((args.data.protocol == 'tcp' || args.data.protocol == 'udp') && (args.data.startport=="" || args.data.startport == undefined)){
- cloudStack.dialog.notice({message:_l('Start Port or End Port value should not be blank')});
+ cloudStack.dialog.notice({message:_l('Start Port or End Port value should not be blank')});
$(window).trigger('cloudStack.fullRefresh');
}
else if((args.data.protocol == 'tcp' || args.data.protocol == 'udp') && (args.data.endport=="" || args.data.endport == undefined)){
- cloudStack.dialog.notice({message:_l('Start Port or End Port value should not be blank')});
+ cloudStack.dialog.notice({message:_l('Start Port or End Port value should not be blank')});
$(window).trigger('cloudStack.fullRefresh');
}
- else{
- $.ajax({
- url: createURL('createNetworkACL'),
- data: $.extend(args.data, {
- aclid: args.context.aclLists[0].id
- }),
- dataType: 'json',
- success: function(data) {
- args.response.success({
- _custom: {
- jobId: data.createnetworkaclresponse.jobid,
- getUpdatedItem: function(json) {
- $(window).trigger('cloudStack.fullRefresh');
+ else{
+ $.ajax({
+ url: createURL('createNetworkACL'),
+ data: $.extend(args.data, {
+ aclid: args.context.aclLists[0].id
+ }),
+ dataType: 'json',
+ success: function(data) {
+ args.response.success({
+ _custom: {
+ jobId: data.createnetworkaclresponse.jobid,
+ getUpdatedItem: function(json) {
+ $(window).trigger('cloudStack.fullRefresh');
- return data;
+ return data;
+ }
+ },
+ notification: {
+ label: 'label.add.ACL',
+ poll: pollAsyncJobResult
}
- },
- notification: {
- label: 'label.add.ACL',
- poll: pollAsyncJobResult
- }
- });
- },
- error: function(data) {
- args.response.error(parseXMLHttpResponse(data));
- }
- });
- }
+ });
+ },
+ error: function(data) {
+ args.response.error(parseXMLHttpResponse(data));
+ }
+ });
+ }
}
},
actions: {
+ edit: {
+ label: 'label.edit',
+ action: function(args) {
+ var data = {
+ id: args.context.multiRule[0].id,
+ cidrlist: args.data.cidrlist,
+ number: args.data.number,
+ protocol: args.data.protocol,
+ traffictype: args.data.traffictype,
+ action: args.data.action
+ };
+
+ if (data.protocol === 'tcp' || data.protocol === 'udp') {
+ $.extend(data, {
+ startport: args.data.startport,
+ endport: args.data.endport
+ });
+ } else if (data.protocol === 'icmp') {
+ $.extend(data, {
+ icmptype: args.data.icmptype,
+ icmpcode: args.data.icmpcode
+ });
+ } else if (data.protocol === 'protocolnumber') {
+ $.extend(data, {
+ protocolnumber: args.data.protocolnumber
+ });
+ }
+
+ $.ajax({
+ url: createURL('updateNetworkACLItem'),
+ data: data,
+ success: function(json) {
+ args.response.success({
+ _custom: { jobId: json.createnetworkaclresponse.jobid }, // API response obj name needs to be fixed
+ notification: {
+ label: 'Edit ACL rule',
+ poll: pollAsyncJobResult
+ }
+ });
+ },
+ error: function(error) {
+ args.response.error(parseXMLHttpResponse(error));
+ }
+ });
+ }
+ },
destroy: {
label: 'label.remove.ACL',
action: function(args) {
[50/50] [abbrv] git commit: updated refs/heads/vmsync to 3c2aa18
Posted by ah...@apache.org.
Fixed the problem with buildapidocs. There are now too many jars but with 1.6 JRE, you can just specify the directory rather than each jar individually.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/3c2aa185
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3c2aa185
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3c2aa185
Branch: refs/heads/vmsync
Commit: 3c2aa1850075a0ae53207cc766c8419b6b814993
Parents: 262352a
Author: Alex Huang <al...@gmail.com>
Authored: Thu Jun 27 13:57:37 2013 -0700
Committer: Alex Huang <al...@gmail.com>
Committed: Thu Jun 27 13:57:37 2013 -0700
----------------------------------------------------------------------
.../hypervisor/vmware/resource/VmwareResource.java | 2 +-
.../src/com/cloud/api/commands/AddSspCmd.java | 13 +++++++------
.../src/com/cloud/api/commands/DeleteSspCmd.java | 13 +++++++------
.../src/com/cloud/network/element/SspElement.java | 17 ++++++++++-------
.../cloud/network/guru/SspGuestNetworkGuru.java | 11 +++++------
tools/apidoc/build-apidoc.sh | 10 +---------
6 files changed, 31 insertions(+), 35 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3c2aa185/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
index 7fa9c5d..0e5997e 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
@@ -2777,7 +2777,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
for (NicTO nicTo : sortNicsByDeviceId(nics)) {
newVal = new OptionValue();
newVal.setKey("nvp.iface-id" + nicNum);
- newVal.setValue(nicTo.getUuid());
+ newVal.setValue(nicTo.getNicUuid());
extraOptions.add(newVal);
nicNum++;
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3c2aa185/plugins/network-elements/stratosphere-ssp/src/com/cloud/api/commands/AddSspCmd.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/stratosphere-ssp/src/com/cloud/api/commands/AddSspCmd.java b/plugins/network-elements/stratosphere-ssp/src/com/cloud/api/commands/AddSspCmd.java
index 3034f9b..5639292 100644
--- a/plugins/network-elements/stratosphere-ssp/src/com/cloud/api/commands/AddSspCmd.java
+++ b/plugins/network-elements/stratosphere-ssp/src/com/cloud/api/commands/AddSspCmd.java
@@ -17,12 +17,14 @@
package com.cloud.api.commands;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.response.ZoneResponse;
import org.apache.cloudstack.api.Parameter;
-import org.apache.log4j.Logger;
+import org.apache.cloudstack.api.response.ZoneResponse;
+import org.apache.cloudstack.context.CallContext;
import com.cloud.api.response.SspResponse;
import com.cloud.dc.dao.DataCenterDao;
@@ -33,7 +35,6 @@ import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.host.Host;
import com.cloud.network.element.SspService;
-import com.cloud.user.UserContext;
@APICommand(name="addStratosphereSsp", responseObject=SspResponse.class, description="Adds stratosphere ssp server")
@@ -70,7 +71,7 @@ public class AddSspCmd extends BaseCmd {
@Override
public long getEntityOwnerId() {
- return UserContext.current().getCaller().getId();
+ return CallContext.current().getCallingAccountId();
}
@Override
@@ -82,10 +83,10 @@ public class AddSspCmd extends BaseCmd {
SspResponse response = new SspResponse();
response.setResponseName(getCommandName());
response.setObjectName("ssphost");
- response.setUrl(this.getUrl());
+ response.setUrl(getUrl());
response.setZoneId(_dcDao.findById(getZoneId()).getUuid());
response.setHostId(host.getUuid());
- this.setResponseObject(response);
+ setResponseObject(response);
}
public Long getZoneId() {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3c2aa185/plugins/network-elements/stratosphere-ssp/src/com/cloud/api/commands/DeleteSspCmd.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/stratosphere-ssp/src/com/cloud/api/commands/DeleteSspCmd.java b/plugins/network-elements/stratosphere-ssp/src/com/cloud/api/commands/DeleteSspCmd.java
index 1f3bba6..8ba0355 100644
--- a/plugins/network-elements/stratosphere-ssp/src/com/cloud/api/commands/DeleteSspCmd.java
+++ b/plugins/network-elements/stratosphere-ssp/src/com/cloud/api/commands/DeleteSspCmd.java
@@ -18,13 +18,15 @@ package com.cloud.api.commands;
import javax.inject.Inject;
-import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.cloudstack.api.response.HostResponse;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
-import org.apache.log4j.Logger;
+import org.apache.cloudstack.api.response.HostResponse;
+import org.apache.cloudstack.api.response.SuccessResponse;
+import org.apache.cloudstack.context.CallContext;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
@@ -32,7 +34,6 @@ import com.cloud.exception.NetworkRuleConflictException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.element.SspService;
-import com.cloud.user.UserContext;
@APICommand(name="deleteStratosphereSsp", responseObject=SuccessResponse.class, description="Removes stratosphere ssp server")
public class DeleteSspCmd extends BaseCmd {
@@ -51,7 +52,7 @@ public class DeleteSspCmd extends BaseCmd {
@Override
public long getEntityOwnerId() {
- return UserContext.current().getCaller().getId();
+ return CallContext.current().getCallingAccountId();
}
@Override
@@ -61,7 +62,7 @@ public class DeleteSspCmd extends BaseCmd {
s_logger.trace("execute");
SuccessResponse resp = new SuccessResponse();
resp.setSuccess(_service.deleteSspHost(this));
- this.setResponseObject(resp);
+ setResponseObject(resp);
}
public Long getHostId() {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3c2aa185/plugins/network-elements/stratosphere-ssp/src/com/cloud/network/element/SspElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/stratosphere-ssp/src/com/cloud/network/element/SspElement.java b/plugins/network-elements/stratosphere-ssp/src/com/cloud/network/element/SspElement.java
index 016ae14..72add30 100644
--- a/plugins/network-elements/stratosphere-ssp/src/com/cloud/network/element/SspElement.java
+++ b/plugins/network-elements/stratosphere-ssp/src/com/cloud/network/element/SspElement.java
@@ -66,15 +66,14 @@ import com.cloud.network.dao.SspTenantVO;
import com.cloud.network.dao.SspUuidDao;
import com.cloud.network.dao.SspUuidVO;
import com.cloud.offering.NetworkOffering;
+import com.cloud.resource.ResourceManager;
import com.cloud.utils.component.AdapterBase;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.vm.NicProfile;
import com.cloud.vm.NicVO;
import com.cloud.vm.ReservationContext;
-import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
import com.cloud.vm.dao.NicDao;
-import com.cloud.resource.ResourceManager;
/**
* Stratosphere sdn platform network element
@@ -306,6 +305,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
return _hostDao.remove(cmd.getHostId());
}
+ @Override
public boolean createNetwork(Network network, NetworkOffering offering,
DeployDestination dest, ReservationContext context){
if(_sspUuidDao.findUuidByNetwork(network) != null){
@@ -343,6 +343,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
}
}
+ @Override
public boolean deleteNetwork(Network network){
String tenantNetworkUuid = _sspUuidDao.findUuidByNetwork(network);
if(tenantNetworkUuid != null){
@@ -364,6 +365,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
}
// we use context.reservationId for dedup of guru & element operations.
+ @Override
public boolean createNicEnv(Network network, NicProfile nic, DeployDestination dest, ReservationContext context){
String tenantNetworkUuid = _sspUuidDao.findUuidByNetwork(network);
if(tenantNetworkUuid == null){
@@ -415,6 +417,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
return false;
}
+ @Override
public boolean deleteNicEnv(Network network, NicProfile nic, ReservationContext context){
if(context==null){
s_logger.error("ReservationContext was null for "+nic+" "+network);
@@ -507,7 +510,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
*/
@Override
public boolean prepare(Network network, NicProfile nic,
- VirtualMachineProfile<? extends VirtualMachine> vm,
+ VirtualMachineProfile vm,
DeployDestination dest, ReservationContext context)
throws ConcurrentOperationException, ResourceUnavailableException,
InsufficientCapacityException {
@@ -524,7 +527,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
*/
@Override
public boolean release(Network network, NicProfile nic,
- VirtualMachineProfile<? extends VirtualMachine> vm,
+ VirtualMachineProfile vm,
ReservationContext context) throws ConcurrentOperationException,
ResourceUnavailableException {
s_logger.trace("release");
@@ -567,7 +570,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
@Override
public boolean prepareMigration(NicProfile nic, Network network,
- VirtualMachineProfile<? extends VirtualMachine> vm,
+ VirtualMachineProfile vm,
DeployDestination dest, ReservationContext context) {
try {
prepare(network, nic, vm, dest, context);
@@ -586,7 +589,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
@Override
public void rollbackMigration(NicProfile nic, Network network,
- VirtualMachineProfile<? extends VirtualMachine> vm,
+ VirtualMachineProfile vm,
ReservationContext src, ReservationContext dst) {
try {
release(network, nic, vm, dst);
@@ -599,7 +602,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
@Override
public void commitMigration(NicProfile nic, Network network,
- VirtualMachineProfile<? extends VirtualMachine> vm,
+ VirtualMachineProfile vm,
ReservationContext src, ReservationContext dst) {
try {
release(network, nic, vm, src);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3c2aa185/plugins/network-elements/stratosphere-ssp/src/com/cloud/network/guru/SspGuestNetworkGuru.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/stratosphere-ssp/src/com/cloud/network/guru/SspGuestNetworkGuru.java b/plugins/network-elements/stratosphere-ssp/src/com/cloud/network/guru/SspGuestNetworkGuru.java
index b504a4b..af67326 100644
--- a/plugins/network-elements/stratosphere-ssp/src/com/cloud/network/guru/SspGuestNetworkGuru.java
+++ b/plugins/network-elements/stratosphere-ssp/src/com/cloud/network/guru/SspGuestNetworkGuru.java
@@ -38,7 +38,6 @@ import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
import com.cloud.vm.NicProfile;
import com.cloud.vm.ReservationContext;
import com.cloud.vm.ReservationContextImpl;
-import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachineProfile;
/**
@@ -117,7 +116,7 @@ public class SspGuestNetworkGuru extends GuestNetworkGuru implements NetworkMigr
@Override
public void reserve(NicProfile nic, Network network,
- VirtualMachineProfile<? extends VirtualMachine> vm,
+ VirtualMachineProfile vm,
DeployDestination dest, ReservationContext context)
throws InsufficientVirtualNetworkCapcityException,
InsufficientAddressCapacityException {
@@ -127,7 +126,7 @@ public class SspGuestNetworkGuru extends GuestNetworkGuru implements NetworkMigr
@Override
public boolean release(NicProfile nic,
- VirtualMachineProfile<? extends VirtualMachine> vm,
+ VirtualMachineProfile vm,
String reservationId) {
Network network = _networkDao.findById(nic.getNetworkId());
_sspMgr.deleteNicEnv(network, nic, new ReservationContextImpl(reservationId, null, null));
@@ -141,7 +140,7 @@ public class SspGuestNetworkGuru extends GuestNetworkGuru implements NetworkMigr
@Override
public boolean prepareMigration(NicProfile nic, Network network,
- VirtualMachineProfile<? extends VirtualMachine> vm,
+ VirtualMachineProfile vm,
DeployDestination dest, ReservationContext context) {
try {
reserve(nic, network, vm, dest, context);
@@ -157,14 +156,14 @@ public class SspGuestNetworkGuru extends GuestNetworkGuru implements NetworkMigr
@Override
public void rollbackMigration(NicProfile nic, Network network,
- VirtualMachineProfile<? extends VirtualMachine> vm,
+ VirtualMachineProfile vm,
ReservationContext src, ReservationContext dst) {
release(nic, vm, dst.getReservationId());
}
@Override
public void commitMigration(NicProfile nic, Network network,
- VirtualMachineProfile<? extends VirtualMachine> vm,
+ VirtualMachineProfile vm,
ReservationContext src, ReservationContext dst) {
release(nic, vm, src.getReservationId());
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3c2aa185/tools/apidoc/build-apidoc.sh
----------------------------------------------------------------------
diff --git a/tools/apidoc/build-apidoc.sh b/tools/apidoc/build-apidoc.sh
index d048a1b..541c032 100755
--- a/tools/apidoc/build-apidoc.sh
+++ b/tools/apidoc/build-apidoc.sh
@@ -47,16 +47,8 @@ fi
CP=$PATHSEP/
-for file in $TARGETJARDIR/*.jar
-do
- CP=${CP}$PATHSEP$file
-done
-for file in $DEPSDIR/*.jar; do
- CP=${CP}$PATHSEP$file
-done
-
-java -cp $CP com.cloud.api.doc.ApiXmlDocWriter -d "$DISTDIR" $*
+java -cp $CP$PATHSEP$TARGETJARDIR/*$PATHSEP$DEPSDIR/* com.cloud.api.doc.ApiXmlDocWriter -d "$DISTDIR" $*
if [ $? -ne 0 ]
then