You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by an...@apache.org on 2013/09/04 01:41:30 UTC
[01/21] git commit: updated refs/heads/4.2 to 51707d8
Updated Branches:
refs/heads/4.2 f09afea06 -> 51707d8c7
[Upgrade from 3.0.6 to 4.2][vmware] After upgrade the system vms fail to come up because "Secondary storage mount point" is pointing to a wrong location
when secondary storage is mounted as read-only, changing permission of files on it will fail. But we should still stick to current mount point instread of
returning a wrong mount point /mnt/sec
(cherry picked from commit db2d9703c16aac0aa0ebcadaa75022981fbfe6cc)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/dced9723
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/dced9723
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/dced9723
Branch: refs/heads/4.2
Commit: dced9723ffd3c349c1ac7af7d28ff2ae6db3e922
Parents: f09afea
Author: frank <fr...@citrix.com>
Authored: Thu Aug 29 10:29:17 2013 -0700
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:12:03 2013 -0700
----------------------------------------------------------------------
.../src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dced9723/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 b5e7535..91d030b 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
@@ -767,7 +767,6 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw
result = script.execute();
if (result != null) {
s_logger.warn("Unable to set permissions for " + mountPoint + " due to " + result);
- return null;
}
return mountPoint;
}
[09/21] git commit: updated refs/heads/4.2 to 51707d8
Posted by an...@apache.org.
Added Accessing System VM via SSH
(cherry picked from commit 404474751466bd1ca84b7e6abfbc65dbb1014e64)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8e8cef8e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8e8cef8e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8e8cef8e
Branch: refs/heads/4.2
Commit: 8e8cef8edbc15dbfa2f093190696a38add555333
Parents: 6ed8a20
Author: Marty Sweet <ms...@gmail.com>
Authored: Sun Aug 25 13:17:51 2013 +0100
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:22:20 2013 -0700
----------------------------------------------------------------------
docs/en-US/accessing-system-vms.xml | 66 +++++++++++++++++++++++
docs/en-US/images/view-systemvm-details.png | Bin 0 -> 25483 bytes
docs/en-US/working-with-system-vm.xml | 1 +
3 files changed, 67 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8e8cef8e/docs/en-US/accessing-system-vms.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/accessing-system-vms.xml b/docs/en-US/accessing-system-vms.xml
new file mode 100755
index 0000000..e1b6090
--- /dev/null
+++ b/docs/en-US/accessing-system-vms.xml
@@ -0,0 +1,66 @@
+<?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="accessing-system-vms">
+ <title>Accessing System VMs</title>
+ <para>It may sometimes be necessary to access System VMs for diagnostics of certain issues, for example if you are experiencing SSVM (Secondary Storage VM) connection issues. Use the steps below in order to connect to the SSH console of a running System VM.</para>
+ <para>
+ Accessing System VMs over the network requires the use of private keys and connecting to System VMs SSH Daemon on port 3922.
+ XenServer/KVM Hypervisors store this key at /root/.ssh/id_rsa.cloud on each &PRODUCT; agent.
+ To access System VMs running on ESXi, the key is stored on the management server at /var/lib/cloudstack/management/.ssh/id_rsa.
+ </para>
+ <orderedlist>
+ <listitem>
+ <para>Find the details of the System VM</para>
+ <orderedlist numeration="loweralpha">
+ <listitem><para>Log in with admin privileges to the &PRODUCT; UI.</para></listitem>
+ <listitem><para>Click Infrastructure, then System VMs, and then click the name of a running VM.</para></listitem>
+ <listitem><para>Take a note of the 'Host', 'Private IP Address' and 'Link Local IP Address' of the System VM you wish to access.</para></listitem>
+ </orderedlist>
+ <para><inlinegraphic format="PNG" fileref="images/view-systemvm-details.png"/></para>
+ </listitem>
+ <listitem>
+ <para>XenServer/KVM Hypervisors</para>
+ <orderedlist numeration="loweralpha">
+ <listitem><para>Connect to the Host of which the System VM is running.</para></listitem>
+ <listitem><para>SSH the 'Link Local IP Address' of the System VM from the Host on which the VM is running.</para></listitem>
+ <listitem><para>Format: ssh -i <path-to-private-key> <link-local-ip> -p 3922</para></listitem>
+ <listitem><para>Example: root@faith:~# ssh -i /root/.ssh/id_rsa.cloud 169.254.3.93 -p 3922</para></listitem>
+ </orderedlist>
+ </listitem>
+ <listitem>
+ <para>ESXi Hypervisors</para>
+ <orderedlist numeration="loweralpha">
+ <listitem><para>Connect to your &PRODUCT; Management Server.</para></listitem>
+ <listitem><para>ESXi users should SSH to the private IP address of the System VM.</para></listitem>
+ <listitem><para>Format: ssh -i <path-to-private-key> <vm-private-ip> -p 3922</para></listitem>
+ <listitem><para>Example: root@management:~# ssh -i /var/lib/cloudstack/management/.ssh/id_rsa 172.16.0.250 -p 3922</para></listitem>
+ </orderedlist>
+ </listitem>
+ </orderedlist>
+
+
+
+
+</section>
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8e8cef8e/docs/en-US/images/view-systemvm-details.png
----------------------------------------------------------------------
diff --git a/docs/en-US/images/view-systemvm-details.png b/docs/en-US/images/view-systemvm-details.png
new file mode 100755
index 0000000..bce270b
Binary files /dev/null and b/docs/en-US/images/view-systemvm-details.png differ
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8e8cef8e/docs/en-US/working-with-system-vm.xml
----------------------------------------------------------------------
diff --git a/docs/en-US/working-with-system-vm.xml b/docs/en-US/working-with-system-vm.xml
index 70f7dd1..073d077 100644
--- a/docs/en-US/working-with-system-vm.xml
+++ b/docs/en-US/working-with-system-vm.xml
@@ -32,6 +32,7 @@
parameter on the &PRODUCT; UI or by calling the listConfigurations API.</para>
</note>
<xi:include href="system-vm-template.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+ <xi:include href="accessing-system-vms.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="multiple-system-vm-vmware.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="console-proxy.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<xi:include href="virtual-router.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
[13/21] git commit: updated refs/heads/4.2 to 51707d8
Posted by an...@apache.org.
CLOUDSTACK-4572: findHostsForMigration API does not return correct host list
Changes:
Expected behavior:
The api should return the list of suitable/unsuitable hosts
Added fix that creates a deep copy of the the variable allHosts and prevents faulty host list return.
(cherry picked from commit 6354604eedff0c5f4ddef4940ce02df80adb656c)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/eb85ff6f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/eb85ff6f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/eb85ff6f
Branch: refs/heads/4.2
Commit: eb85ff6f3bf783700f26ccac640024394a9360a5
Parents: 92f2360
Author: Saksham Srivastava <sa...@citrix.com>
Authored: Fri Aug 30 12:30:41 2013 -0700
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:25:49 2013 -0700
----------------------------------------------------------------------
server/src/com/cloud/server/ManagementServerImpl.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/eb85ff6f/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 3341c05..8437c99 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -1161,8 +1161,10 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
null, null, null);
}
- Pair<List<? extends Host>, Integer> otherHosts = new Pair<List <? extends Host>, Integer>(allHosts,
- new Integer(allHosts.size()));
+ //'otherHosts' must use the current value of allHosts as allHosts may get modified later in the allocator
+ List<HostVO> allHostsCpy = new ArrayList<HostVO>(allHosts);
+ Pair<List<? extends Host>, Integer> otherHosts = new Pair<List <? extends Host>, Integer>(allHostsCpy,
+ new Integer(allHostsCpy.size()));
List<Host> suitableHosts = new ArrayList<Host>();
ExcludeList excludes = new ExcludeList();
excludes.addHost(srcHostId);
[21/21] git commit: updated refs/heads/4.2 to 51707d8
Posted by an...@apache.org.
CLOUDSTACK-1192: fix collectVmDiskStatistics issue when stopping a vm
(Cherry-picked from commit 65c1c986da2cd14b9138a229ad6843ffbf46f3f4)
(cherry picked from commit d0ffc9e33985a4a19277b94df6d13a94b53c317c)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/51707d8c
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/51707d8c
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/51707d8c
Branch: refs/heads/4.2
Commit: 51707d8c71f7b1f36177e440e813b7d1df413ddb
Parents: fbba6d0
Author: Wei Zhou <w....@leaseweb.com>
Authored: Tue Sep 3 11:45:34 2013 +0200
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:33:18 2013 -0700
----------------------------------------------------------------------
server/src/com/cloud/vm/UserVmManagerImpl.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/51707d8c/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 251c203..73d4602 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -3488,8 +3488,8 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use
public void collectVmDiskStatistics (UserVmVO userVm) {
// support KVM only util 2013.06.25
if (!userVm.getHypervisorType().equals(HypervisorType.KVM))
- return;
- // Collect vm disk statistics from host before stopping Vm
+ return;
+ s_logger.debug("Collect vm disk statistics from host before stopping Vm");
long hostId = userVm.getHostId();
List<String> vmNames = new ArrayList<String>();
vmNames.add(userVm.getInstanceName());
@@ -3511,8 +3511,9 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use
try {
txn.start();
HashMap<String, List<VmDiskStatsEntry>> vmDiskStatsByName = diskStatsAnswer.getVmDiskStatsMap();
+ if (vmDiskStatsByName == null)
+ return;
List<VmDiskStatsEntry> vmDiskStats = vmDiskStatsByName.get(userVm.getInstanceName());
-
if (vmDiskStats == null)
return;
@@ -4980,7 +4981,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use
@Override
public void prepareStop(VirtualMachineProfile<UserVmVO> profile) {
UserVmVO vm = _vmDao.findById(profile.getId());
- if (vm.getState() == State.Running)
+ if (vm != null && vm.getState() == State.Stopping)
collectVmDiskStatistics(vm);
}
[10/21] git commit: updated refs/heads/4.2 to 51707d8
Posted by an...@apache.org.
updating the version number
(cherry picked from commit b5713ecad2eddec9ba57619c0f9c046ca557b4d5)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/58e5ad7c
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/58e5ad7c
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/58e5ad7c
Branch: refs/heads/4.2
Commit: 58e5ad7c42bec95b2f90fd3553292301b655c071
Parents: 8e8cef8
Author: David Nalley <da...@gnsa.us>
Authored: Fri Aug 30 12:10:57 2013 -0400
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:23:23 2013 -0700
----------------------------------------------------------------------
docs/qig/en-US/Book_Info.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/58e5ad7c/docs/qig/en-US/Book_Info.xml
----------------------------------------------------------------------
diff --git a/docs/qig/en-US/Book_Info.xml b/docs/qig/en-US/Book_Info.xml
index e356de4..98cbcb4 100644
--- a/docs/qig/en-US/Book_Info.xml
+++ b/docs/qig/en-US/Book_Info.xml
@@ -27,7 +27,7 @@
<title>Quick Install Guide</title>
<subtitle>Prescriptive instructions for deploying Apache CloudStack</subtitle>
<productname>Apache CloudStack</productname>
- <productnumber>4.0.2</productnumber>
+ <productnumber>4.2.0</productnumber>
<edition>0</edition>
<pubsnumber>0</pubsnumber>
<abstract>
[14/21] git commit: updated refs/heads/4.2 to 51707d8
Posted by an...@apache.org.
CLOUDSTACK-4575: Portable IP: disassociating a transferred public IP fails
The code is excessively complicated and convoluted.
DisassociateIP ->
Revoke Rule -> {FW, PF{incl SNAT}, LB, RA VPN} ->
-> Send IpAssoc (false) to VR
Send all config to VR again
-> Send IpAssoc(false) to VR again <---- fails here since it cannot find the VLAN for the IP since it is already gone
-> Mark Ip as released
The workaround fix would be to not throw an exception in CitrixResourceBase if it is disassociate and the VLAN does not exist on the XS host.
Signed-off-by: Chiradeep Vittal <ch...@apache.org>
(cherry picked from commit a98eb12549a900c7f88acc68457957a4a955fecd)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/655c3753
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/655c3753
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/655c3753
Branch: refs/heads/4.2
Commit: 655c3753b1f990cac95e86439e7ef276b6c0dc06
Parents: eb85ff6
Author: Chiradeep Vittal <ch...@apache.org>
Authored: Fri Aug 30 14:27:40 2013 -0700
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:28:07 2013 -0700
----------------------------------------------------------------------
.../src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/655c3753/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index 815299b..9f254c3 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -2299,6 +2299,9 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
if (add && correctVif == null) {
addVif = true;
}
+ if (!add && correctVif == null) {
+ return; // it is a disassociateIp and it has already happened
+ }
if (addVif) {
// Add a new VIF to DomR
[04/21] git commit: updated refs/heads/4.2 to 51707d8
Posted by an...@apache.org.
CLOUDSTACK-4561: DeployVm failed after upgrading from earlier version having a private zone to 4.2
Changes:
- In the upgrade path, for a private zone, entry needs to be added in the affinity_group_domain_map to provide access to the private zone for the domains it belongs too.
(cherry picked from commit 0b9b36cbca0a4294ccdb3f68ababefc314d9fd8e)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c696b449
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c696b449
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c696b449
Branch: refs/heads/4.2
Commit: c696b449ee805672e01b7d90aee27ef2c7448db6
Parents: 499bd93
Author: Prachi Damle <pr...@cloud.com>
Authored: Thu Aug 29 14:33:36 2013 -0700
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:14:39 2013 -0700
----------------------------------------------------------------------
.../schema/src/com/cloud/upgrade/dao/Upgrade410to420.java | 9 +++++++++
setup/db/db/schema-410to420.sql | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c696b449/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 2e58ddd..773ad62 100755
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
@@ -392,6 +392,15 @@ public class Upgrade410to420 implements DbUpgrade {
if (rs2.next()) {
affinityGroupId = rs2.getLong(1);
}
+
+ // add the domain map
+ String sqlMap = "INSERT INTO `cloud`.`affinity_group_domain_map` (`domain_id`, `affinity_group_id`) VALUES (?, ?)";
+ pstmtUpdate = conn.prepareStatement(sqlMap);
+ pstmtUpdate.setLong(1, domainId);
+ pstmtUpdate.setLong(2, affinityGroupId);
+ pstmtUpdate.executeUpdate();
+ pstmtUpdate.close();
+
}
rs2.close();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c696b449/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index 723791d..6eb7534 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -440,7 +440,7 @@ CREATE TABLE `cloud`.`affinity_group_domain_map` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`domain_id` bigint unsigned NOT NULL COMMENT 'domain id',
`affinity_group_id` bigint unsigned NOT NULL COMMENT 'affinity group id',
- `subdomain_access` int(1) unsigned COMMENT '1 if affinity group can be accessible from the subdomain',
+ `subdomain_access` int(1) unsigned DEFAULT 1 COMMENT '1 if affinity group can be accessible from the subdomain',
PRIMARY KEY (`id`),
CONSTRAINT `fk_affinity_group_domain_map__domain_id` FOREIGN KEY (`domain_id`) REFERENCES `domain`(`id`) ON DELETE CASCADE,
CONSTRAINT `fk_affinity_group_domain_map__affinity_group_id` FOREIGN KEY (`affinity_group_id`) REFERENCES `affinity_group`(`id`) ON DELETE CASCADE
[08/21] git commit: updated refs/heads/4.2 to 51707d8
Posted by an...@apache.org.
CLOUDSTACK-2319: fix incorrect account_id in event table for Revoke SecurityGroupRule commands
(cherry picked from commit d9ba234d6c032aeb2ba04d4e6be0502de8a4efd9)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6ed8a206
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6ed8a206
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6ed8a206
Branch: refs/heads/4.2
Commit: 6ed8a206977e7b1dfd80871e4d39cc9c7493a99e
Parents: 1b684ac
Author: Wei Zhou <w....@leaseweb.com>
Authored: Fri Aug 30 11:13:59 2013 +0200
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:21:18 2013 -0700
----------------------------------------------------------------------
.../user/securitygroup/RevokeSecurityGroupEgressCmd.java | 10 +++++++---
.../user/securitygroup/RevokeSecurityGroupIngressCmd.java | 10 +++++++---
.../api/response/SecurityGroupRuleResponse.java | 4 ++--
.../network/security/dao/SecurityGroupRulesDaoImpl.java | 8 --------
4 files changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6ed8a206/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupEgressCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupEgressCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupEgressCmd.java
index c03d3e4..b30ba1c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupEgressCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupEgressCmd.java
@@ -29,6 +29,7 @@ import org.apache.log4j.Logger;
import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.network.security.SecurityGroup;
+import com.cloud.network.security.SecurityRule;
import com.cloud.user.Account;
@APICommand(name = "revokeSecurityGroupEgress", responseObject = SuccessResponse.class, description = "Deletes a particular egress rule from this security group", since="3.0.0")
@@ -67,9 +68,12 @@ public class RevokeSecurityGroupEgressCmd extends BaseAsyncCmd {
@Override
public long getEntityOwnerId() {
- SecurityGroup group = _entityMgr.findById(SecurityGroup.class, getId());
- if (group != null) {
- return group.getAccountId();
+ SecurityRule rule = _entityMgr.findById(SecurityRule.class, getId());
+ if (rule != null) {
+ SecurityGroup group = _entityMgr.findById(SecurityGroup.class, rule.getSecurityGroupId());
+ if (group != null) {
+ return group.getAccountId();
+ }
}
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6ed8a206/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupIngressCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupIngressCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupIngressCmd.java
index c2fdb8b..a547fb0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupIngressCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupIngressCmd.java
@@ -29,6 +29,7 @@ import org.apache.log4j.Logger;
import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.network.security.SecurityGroup;
+import com.cloud.network.security.SecurityRule;
import com.cloud.user.Account;
@APICommand(name = "revokeSecurityGroupIngress", responseObject = SuccessResponse.class, description = "Deletes a particular ingress rule from this security group")
@@ -67,9 +68,12 @@ public class RevokeSecurityGroupIngressCmd extends BaseAsyncCmd {
@Override
public long getEntityOwnerId() {
- SecurityGroup group = _entityMgr.findById(SecurityGroup.class, getId());
- if (group != null) {
- return group.getAccountId();
+ SecurityRule rule = _entityMgr.findById(SecurityRule.class, getId());
+ if (rule != null) {
+ SecurityGroup group = _entityMgr.findById(SecurityGroup.class, rule.getSecurityGroupId());
+ if (group != null) {
+ return group.getAccountId();
+ }
}
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6ed8a206/api/src/org/apache/cloudstack/api/response/SecurityGroupRuleResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/SecurityGroupRuleResponse.java b/api/src/org/apache/cloudstack/api/response/SecurityGroupRuleResponse.java
index 5aeee6f..798b123 100644
--- a/api/src/org/apache/cloudstack/api/response/SecurityGroupRuleResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/SecurityGroupRuleResponse.java
@@ -20,11 +20,11 @@ import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
-import com.cloud.network.security.SecurityGroupRules;
+import com.cloud.network.security.SecurityRule;
import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
-@EntityReference(value = SecurityGroupRules.class)
+@EntityReference(value = SecurityRule.class)
public class SecurityGroupRuleResponse extends BaseResponse {
@SerializedName("ruleid") @Param(description="the id of the security group rule")
private String ruleId;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6ed8a206/engine/schema/src/com/cloud/network/security/dao/SecurityGroupRulesDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/security/dao/SecurityGroupRulesDaoImpl.java b/engine/schema/src/com/cloud/network/security/dao/SecurityGroupRulesDaoImpl.java
index 18ef57f..cb3baac 100644
--- a/engine/schema/src/com/cloud/network/security/dao/SecurityGroupRulesDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/security/dao/SecurityGroupRulesDaoImpl.java
@@ -85,12 +85,4 @@ public class SecurityGroupRulesDaoImpl extends GenericDaoBase<SecurityGroupRules
return listBy(sc, searchFilter);
}
- @Override
- public SecurityGroupRulesVO findByUuidIncludingRemoved(final String uuid) {
- SearchCriteria<SecurityGroupRulesVO> sc = createSearchCriteria();
- sc.addAnd("ruleUuid", SearchCriteria.Op.EQ, uuid);
- SecurityGroupRulesVO rule = findOneIncludingRemovedBy(sc);
- SecurityGroupRulesVO newRule = new SecurityGroupRulesVO(rule.getRuleId());
- return newRule;
- }
}
[03/21] git commit: updated refs/heads/4.2 to 51707d8
Posted by an...@apache.org.
CLOUDSTACK-4459: fix silly bug, one more time
(cherry picked from commit 93bfe708d9cc4da6a7bec3ecaaa17812b2b73048)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/499bd934
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/499bd934
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/499bd934
Branch: refs/heads/4.2
Commit: 499bd9349fbd5d2e6a39cab57f97248920473340
Parents: e3eefdf
Author: Edison Su <su...@gmail.com>
Authored: Thu Aug 29 14:24:35 2013 -0700
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:13:17 2013 -0700
----------------------------------------------------------------------
.../src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/499bd934/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java
index dc7981c..c0e1000 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStoragePool.java
@@ -129,7 +129,7 @@ public class LibvirtStoragePool implements KVMStoragePool {
try {
disk = this._storageAdaptor.getPhysicalDisk(volumeUuid, this);
} catch (CloudRuntimeException e) {
- if ((this.getStoragePoolType() != StoragePoolType.NetworkFilesystem) ||
+ if ((this.getStoragePoolType() != StoragePoolType.NetworkFilesystem) &&
(this.getStoragePoolType() != StoragePoolType.Filesystem)) {
throw e;
}
[11/21] git commit: updated refs/heads/4.2 to 51707d8
Posted by an...@apache.org.
CLOUDSTACK-4089: UI > zone wizard > hypervisor VMware > multiple physical networks > edit Public/Guest traffic type > fix a bug that vSwitch Type dropdown selection didn't remain after Public/Guest traffic type is dragged to another physical network.
(cherry picked from commit 2c2ebee3f7395a6541088eefe91ceaa1b02c70d5)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ae001183
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ae001183
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ae001183
Branch: refs/heads/4.2
Commit: ae001183fb41ddf262f803767f0b4cc8c5a7a490
Parents: 58e5ad7
Author: Jessica Wang <je...@apache.org>
Authored: Fri Aug 30 11:03:11 2013 -0700
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:24:42 2013 -0700
----------------------------------------------------------------------
ui/scripts/ui-custom/zoneWizard.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ae001183/ui/scripts/ui-custom/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/zoneWizard.js b/ui/scripts/ui-custom/zoneWizard.js
index b8f77a4..254ea63 100644
--- a/ui/scripts/ui-custom/zoneWizard.js
+++ b/ui/scripts/ui-custom/zoneWizard.js
@@ -324,10 +324,10 @@
}, {
id: 'vmwaredvs',
description: 'VMware vNetwork Distributed Virtual Switch'
- }],
- defaultValue: trafficData.vSwitchType
+ }]
});
- }
+ },
+ defaultValue: trafficData.vSwitchType
}
});
}
[05/21] git commit: updated refs/heads/4.2 to 51707d8
Posted by an...@apache.org.
CLOUDSTACK-4539: [VMWARE] vmware.create.full.clone is set to true in upgraded setup;default nature of vms are full clone
Reviwed-by: Kelven Yang <ke...@citrix.com>
Description:
Change the criterion for overriding/preserving the vmware.create.full.clone
flag. The earlier criterion was simply the version numbers, but that is not
a good business logic basis for the change. With this fix, if past version
deployments have any deployments (data centers), this flag will be set to
false. Else, it will be set to true.
(cherry picked from commit 07d79c7ad660375cfb0e88794048993c4e349cf0)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d6b19bad
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d6b19bad
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d6b19bad
Branch: refs/heads/4.2
Commit: d6b19bad1fe75887a6b53f9706ca7a78e9f67a09
Parents: c696b44
Author: Vijayendra Bhamidipati <vi...@citrix.com>
Authored: Thu Aug 29 09:02:22 2013 -0700
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:15:05 2013 -0700
----------------------------------------------------------------------
.../com/cloud/upgrade/dao/Upgrade410to420.java | 48 ++++++++++++++++++++
setup/db/db/schema-410to420.sql | 7 ---
2 files changed, 48 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d6b19bad/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 773ad62..839ab86 100755
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
@@ -113,6 +113,54 @@ public class Upgrade410to420 implements DbUpgrade {
migrateDatafromIsoIdInVolumesTable(conn);
setRAWformatForRBDVolumes(conn);
migrateVolumeOnSecondaryStorage(conn);
+ createFullCloneFlag(conn);
+ }
+
+ private void createFullCloneFlag(Connection conn) {
+ ResultSet rs = null;
+ PreparedStatement delete = null;
+ PreparedStatement query = null;
+ PreparedStatement update = null;
+ int numRows = 0;
+ try {
+ delete = conn.prepareStatement("delete from `cloud`.`configuration` where name='vmware.create.full.clone';");
+ delete.executeUpdate();
+ query = conn.prepareStatement("select count(*) from `cloud`.`data_center`");
+ rs = query.executeQuery();
+ if (rs.next()) {
+ numRows = rs.getInt(1);
+ }
+ if (numRows > 0) {
+ update = conn.prepareStatement("insert into `cloud`.`configuration` (`category`, `instance`, `component`, `name`, `value`, `description`) VALUES ('Advanced', 'DEFAULT', 'UserVmManager', 'vmware.create.full.clone' , 'false', 'If set to true, creates VMs as full clones on ESX hypervisor');");
+ } else {
+ update = conn.prepareStatement("insert into `cloud`.`configuration` (`category`, `instance`, `component`, `name`, `value`, `description`) VALUES ('Advanced', 'DEFAULT', 'UserVmManager', 'vmware.create.full.clone' , 'true', 'If set to true, creates VMs as full clones on ESX hypervisor');");
+ }
+ update.executeUpdate();
+ } catch (SQLException e) {
+ throw new CloudRuntimeException("Failed to set global flag vmware.create.full.clone: ", e);
+ } finally {
+ if (update != null) {
+ try {
+ update.close();
+ } catch (SQLException e) {
+
+ }
+ }
+ if (query != null) {
+ try {
+ query.close();
+ } catch (SQLException e) {
+
+ }
+ }
+ if (delete != null) {
+ try {
+ delete.close();
+ } catch (SQLException e) {
+
+ }
+ }
+ }
}
private void migrateVolumeOnSecondaryStorage(Connection conn) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d6b19bad/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index 6eb7534..6e9fe72 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -403,13 +403,6 @@ CREATE TABLE `cloud`.`user_vm_clone_setting` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-INSERT INTO `cloud`.`configuration` (category, instance, component, name, value, description)
- SELECT tmp.category, tmp.instance, tmp.component, tmp.name, tmp.value, tmp.description FROM
- (SELECT 'Advanced' category, 'DEFAULT' instance, 'UserVmManager' component, 'vmware.create.full.clone' name, 'true' value, 'If set to true, creates VMs as full clones on ESX hypervisor' description) tmp
- WHERE NOT EXISTS (SELECT 1 FROM `cloud`.`configuration` WHERE name = 'vmware.create.full.clone');
-
-
-
CREATE TABLE `cloud`.`affinity_group` (
`id` bigint unsigned NOT NULL auto_increment,
`name` varchar(255) NOT NULL,
[15/21] git commit: updated refs/heads/4.2 to 51707d8
Posted by an...@apache.org.
CLOUDSTACK-4089: UI > zone wizard > VMware hypervisor > physical network > edit Public/Guest traffic type > vSwitchType dropdown > set default option upon configuration 'vmware.use.dvswtich' and 'vmware.use.nexus.vswitch'.
(cherry picked from commit 8d60e4436bbc71f62c52b2d3861ecad1cd82596b)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/38a7aba1
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/38a7aba1
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/38a7aba1
Branch: refs/heads/4.2
Commit: 38a7aba1c0ed3535031b35b2502f297c15a056ee
Parents: 655c375
Author: Jessica Wang <je...@apache.org>
Authored: Fri Aug 30 14:52:44 2013 -0700
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:29:16 2013 -0700
----------------------------------------------------------------------
ui/scripts/ui-custom/zoneWizard.js | 40 ++++++++++++++++++++++++++++++++-
1 file changed, 39 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/38a7aba1/ui/scripts/ui-custom/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/zoneWizard.js b/ui/scripts/ui-custom/zoneWizard.js
index 254ea63..a1c5803 100644
--- a/ui/scripts/ui-custom/zoneWizard.js
+++ b/ui/scripts/ui-custom/zoneWizard.js
@@ -309,7 +309,45 @@
}
};
- if($trafficType.hasClass('guest') || $trafficType.hasClass('public')) {
+ if($trafficType.hasClass('guest') || $trafficType.hasClass('public')) {
+ if(trafficData.vSwitchType == null) {
+ var useDvs = false;
+ $.ajax({
+ url: createURL('listConfigurations'),
+ data: {
+ name: 'vmware.use.dvswitch'
+ },
+ async: false,
+ success: function(json) {
+ if (json.listconfigurationsresponse.configuration[0].value == 'true') {
+ useDvs = true;
+ }
+ }
+ });
+ if (useDvs == true) {
+ var useNexusDvs = false;
+ $.ajax({
+ url: createURL('listConfigurations'),
+ data: {
+ name: 'vmware.use.nexus.vswitch'
+ },
+ async: false,
+ success: function(json) {
+ if (json.listconfigurationsresponse.configuration[0].value == 'true') {
+ useNexusDvs = true;
+ }
+ }
+ });
+ if (useNexusDvs == true) {
+ trafficData.vSwitchType = 'nexusdvs';
+ } else {
+ trafficData.vSwitchType = 'vmwaredvs';
+ }
+ } else { //useDvs == false
+ trafficData.vSwitchType = 'vmwaresvs';
+ }
+ }
+
$.extend(fields, {
vSwitchType: {
label: 'vSwitch Type',
[16/21] git commit: updated refs/heads/4.2 to 51707d8
Posted by an...@apache.org.
CLOUDSTACK-4089: UI > zone wizard > VMware hypervisor > physical network > edit traffic type > set default value for vSwitchName field upon selected vSwitchType.
(cherry picked from commit ff4f931cd8b29983b5ad82675ccc65b651839a62)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/97cb5f38
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/97cb5f38
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/97cb5f38
Branch: refs/heads/4.2
Commit: 97cb5f386144780367909f6f0edf194a7be95353
Parents: 38a7aba
Author: Jessica Wang <je...@apache.org>
Authored: Fri Aug 30 15:18:32 2013 -0700
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:29:37 2013 -0700
----------------------------------------------------------------------
ui/scripts/ui-custom/zoneWizard.js | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97cb5f38/ui/scripts/ui-custom/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/zoneWizard.js b/ui/scripts/ui-custom/zoneWizard.js
index a1c5803..695534f 100644
--- a/ui/scripts/ui-custom/zoneWizard.js
+++ b/ui/scripts/ui-custom/zoneWizard.js
@@ -340,11 +340,14 @@
});
if (useNexusDvs == true) {
trafficData.vSwitchType = 'nexusdvs';
+ fields.vSwitchName.defaultValue = 'epp0';
} else {
trafficData.vSwitchType = 'vmwaredvs';
+ fields.vSwitchName.defaultValue = 'dvSwitch0';
}
} else { //useDvs == false
trafficData.vSwitchType = 'vmwaresvs';
+ fields.vSwitchName.defaultValue = 'vSwitch0';
}
}
[19/21] git commit: updated refs/heads/4.2 to 51707d8
Posted by an...@apache.org.
CLOUDSTACK-4585: make run-time datastore folder migration, VM snapshot, bug in root disk controller type carried from previous version work under upgrade situation
(cherry picked from commit 8ccff0472269a7f06e1751ea1640532e52ba55fe)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e9cb0d6f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e9cb0d6f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e9cb0d6f
Branch: refs/heads/4.2
Commit: e9cb0d6f4c06eace030a63c10d34a2058fa9c357
Parents: b269a29
Author: Kelven Yang <ke...@gmail.com>
Authored: Sun Sep 1 07:14:27 2013 -0700
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:32:03 2013 -0700
----------------------------------------------------------------------
.../com/cloud/upgrade/dao/Upgrade410to420.java | 2 +-
.../vmware/resource/VmwareResource.java | 146 +++++++++++--------
.../resource/VmwareStorageLayoutHelper.java | 4 +-
.../hypervisor/vmware/mo/VirtualMachineMO.java | 20 ++-
.../hypervisor/vmware/util/VmwareHelper.java | 50 ++++---
5 files changed, 136 insertions(+), 86 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e9cb0d6f/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 839ab86..8ff07df 100755
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
@@ -772,7 +772,7 @@ public class Upgrade410to420 implements DbUpgrade {
pstmt.close();
} else {
if (hypervisorsListInUse.contains(hypervisorAndTemplateName.getKey())){
- throw new CloudRuntimeException("4.2.0 " + hypervisorAndTemplateName.getKey() + " SystemVm template not found. Cannot upgrade system Vms");
+ // throw new CloudRuntimeException("4.2.0 " + hypervisorAndTemplateName.getKey() + " SystemVm template not found. Cannot upgrade system Vms");
} else {
s_logger.warn("4.2.0 " + hypervisorAndTemplateName.getKey() + " SystemVm template not found. " + hypervisorAndTemplateName.getKey() + " hypervisor is not used, so not failing upgrade");
// Update the latest template URLs for corresponding hypervisor
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e9cb0d6f/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 de6885c..0990b3a 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
@@ -2849,7 +2849,8 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
if (vol.getType() == Volume.Type.ISO)
continue;
- controllerKey = getDiskController(vol, vmSpec, ideControllerKey, scsiControllerKey);
+ VirtualMachineDiskInfo matchingExistingDisk = getMatchingExistingDisk(diskInfoBuilder, vol);
+ controllerKey = getDiskController(matchingExistingDisk, vol, vmSpec, ideControllerKey, scsiControllerKey);
VolumeObjectTO volumeTO = (VolumeObjectTO)vol.getData();
PrimaryDataStoreTO primaryStore = (PrimaryDataStoreTO)volumeTO.getDataStore();
@@ -2858,19 +2859,16 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
VirtualDevice device;
String[] diskChain = syncDiskChain(dcMo, vmMo, vmSpec,
- vol, diskInfoBuilder,
- dataStoresDetails,
- (controllerKey == ideControllerKey) ? true : false,
- 0, // currently only support bus 0
- (controllerKey == ideControllerKey) ? ideUnitNumber : scsiUnitNumber);
+ vol, matchingExistingDisk,
+ dataStoresDetails);
- device = VmwareHelper.prepareDiskDevice(vmMo, controllerKey,
+ device = VmwareHelper.prepareDiskDevice(vmMo, null, controllerKey,
diskChain,
volumeDsDetails.first(),
(controllerKey == ideControllerKey) ? ideUnitNumber++ : scsiUnitNumber++, i + 1);
deviceConfigSpecArray[i].setDevice(device);
- deviceConfigSpecArray[i].setOperation(VirtualDeviceConfigSpecOperation.ADD);
+ deviceConfigSpecArray[i].setOperation(VirtualDeviceConfigSpecOperation.ADD);
if(s_logger.isDebugEnabled())
s_logger.debug("Prepare volume at new device " + _gson.toJson(device));
@@ -3013,55 +3011,37 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
// return the finalized disk chain for startup, from top to bottom
private String[] syncDiskChain(DatacenterMO dcMo, VirtualMachineMO vmMo, VirtualMachineTO vmSpec,
- DiskTO vol, VirtualMachineDiskInfoBuilder diskInfoBuilder,
- HashMap<String ,Pair<ManagedObjectReference, DatastoreMO>> dataStoresDetails,
- boolean ideController, int deviceBusNumber, int deviceUnitNumber) throws Exception {
+ DiskTO vol, VirtualMachineDiskInfo diskInfo,
+ HashMap<String ,Pair<ManagedObjectReference, DatastoreMO>> dataStoresDetails
+ ) throws Exception {
VolumeObjectTO volumeTO = (VolumeObjectTO)vol.getData();
PrimaryDataStoreTO primaryStore = (PrimaryDataStoreTO)volumeTO.getDataStore();
- String deviceBusName;
- if(ideController)
- deviceBusName = String.format("ide%d:%d", deviceBusNumber, deviceUnitNumber);
- else
- deviceBusName = String.format("scsi%d:%d", deviceBusNumber, deviceUnitNumber);
-
Pair<ManagedObjectReference, DatastoreMO> volumeDsDetails = dataStoresDetails.get(primaryStore.getUuid());
if(volumeDsDetails == null)
throw new Exception("Primary datastore " + primaryStore.getUuid() + " is not mounted on host.");
DatastoreMO dsMo = volumeDsDetails.second();
// we will honor vCenter's meta if it exists
- if(diskInfoBuilder != null && diskInfoBuilder.getDiskCount() > 0) {
- // we will always on-disk info from vCenter in this case
- VirtualMachineDiskInfo diskInfo = diskInfoBuilder.getDiskInfoByDeviceBusName(deviceBusName);
- if(diskInfo != null) {
- if(s_logger.isInfoEnabled())
- s_logger.info("Volume " + volumeTO.getId() + " does not seem to exist on datastore. use on-disk chain: " +
- _gson.toJson(diskInfo));
-
- return diskInfo.getDiskChain();
- } else {
- s_logger.warn("Volume " + volumeTO.getId() + " does not seem to exist on datastore. on-disk may be out of sync as well. disk device info: " + deviceBusName);
- }
- }
+ if(diskInfo != null) {
+ // to deal with run-time upgrade to maintain the new datastore folder structure
+ String disks[] = diskInfo.getDiskChain();
+ for(int i = 0; i < disks.length; i++) {
+ DatastoreFile file = new DatastoreFile(disks[i]);
+ if(file.getDir() != null && file.getDir().isEmpty()) {
+ s_logger.info("Perform run-time datastore folder upgrade. sync " + disks[i] + " to VM folder");
+ disks[i] = VmwareStorageLayoutHelper.syncVolumeToVmDefaultFolder(
+ dcMo, vmMo.getName(), dsMo, file.getFileBaseName());
+ }
+ }
+ return disks;
+ }
String datastoreDiskPath = VmwareStorageLayoutHelper.syncVolumeToVmDefaultFolder(
dcMo, vmMo.getName(), dsMo, volumeTO.getPath());
if(!dsMo.fileExists(datastoreDiskPath)) {
- if(s_logger.isInfoEnabled())
- s_logger.info("Volume " + volumeTO.getId() + " does not seem to exist on datastore, out of sync? path: " + datastoreDiskPath);
-
- // last resort, try chain info stored in DB
- if(volumeTO.getChainInfo() != null) {
- VirtualMachineDiskInfo diskInfo = _gson.fromJson(volumeTO.getChainInfo(), VirtualMachineDiskInfo.class);
- if(diskInfo != null) {
- s_logger.info("Use chain info from DB: " + volumeTO.getChainInfo());
- return diskInfo.getDiskChain();
- }
-
- throw new Exception("Volume " + volumeTO.getId() + " does not seem to exist on datastore. Broken disk chain");
- }
+ s_logger.warn("Volume " + volumeTO.getId() + " does not seem to exist on datastore, out of sync? path: " + datastoreDiskPath);
}
return new String[] { datastoreDiskPath };
@@ -3271,21 +3251,80 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
}
}
- private static int getDiskController(DiskTO vol, VirtualMachineTO vmSpec, int ideControllerKey, int scsiControllerKey) {
+ private VirtualMachineDiskInfo getMatchingExistingDisk(VirtualMachineDiskInfoBuilder diskInfoBuilder, DiskTO vol) {
+ if(diskInfoBuilder != null) {
+ VolumeObjectTO volume = (VolumeObjectTO)vol.getData();
+
+ VirtualMachineDiskInfo diskInfo = diskInfoBuilder.getDiskInfoByBackingFileBaseName(volume.getPath());
+ if(diskInfo != null) {
+ s_logger.info("Found existing disk info from volume path: " + volume.getPath());
+ return diskInfo;
+ } else {
+ String chainInfo = volume.getChainInfo();
+ if(chainInfo != null) {
+ VirtualMachineDiskInfo infoInChain = _gson.fromJson(chainInfo, VirtualMachineDiskInfo.class);
+ if(infoInChain != null) {
+ String[] disks = infoInChain.getDiskChain();
+ if(disks.length > 0) {
+ for(String diskPath : disks) {
+ DatastoreFile file = new DatastoreFile(diskPath);
+ diskInfo = diskInfoBuilder.getDiskInfoByBackingFileBaseName(file.getFileBaseName());
+ if(diskInfo != null) {
+ s_logger.info("Found existing disk from chain info: " + diskPath);
+ return diskInfo;
+ }
+ }
+ }
+
+ if(diskInfo == null) {
+ diskInfo = diskInfoBuilder.getDiskInfoByDeviceBusName(infoInChain.getDiskDeviceBusName());
+ if(diskInfo != null) {
+ s_logger.info("Found existing disk from from chain device bus information: " + infoInChain.getDiskDeviceBusName());
+ return diskInfo;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return null;
+ }
+
+ private int getDiskController(VirtualMachineDiskInfo matchingExistingDisk, DiskTO vol,
+ VirtualMachineTO vmSpec, int ideControllerKey, int scsiControllerKey) {
+
int controllerKey;
+ if(matchingExistingDisk != null) {
+ s_logger.info("Chose disk controller based on existing information: " + matchingExistingDisk.getDiskDeviceBusName());
+ if(matchingExistingDisk.getDiskDeviceBusName().startsWith("ide"))
+ return ideControllerKey;
+ else
+ return scsiControllerKey;
+ }
if(vol.getType() == Volume.Type.ROOT) {
- if(vmSpec.getDetails() != null && vmSpec.getDetails().get(VmDetailConstants.ROOK_DISK_CONTROLLER) != null)
+ Map<String, String> vmDetails = vmSpec.getDetails();
+ if(vmDetails != null && vmDetails.get(VmDetailConstants.ROOK_DISK_CONTROLLER) != null)
{
- if(vmSpec.getDetails().get(VmDetailConstants.ROOK_DISK_CONTROLLER).equalsIgnoreCase("scsi"))
+ if(vmDetails.get(VmDetailConstants.ROOK_DISK_CONTROLLER).equalsIgnoreCase("scsi")) {
+ s_logger.info("Chose disk controller for vol " + vol.getType() + " -> scsi, based on root disk controller settings: "
+ + vmDetails.get(VmDetailConstants.ROOK_DISK_CONTROLLER));
controllerKey = scsiControllerKey;
- else
+ }
+ else {
+ s_logger.info("Chose disk controller for vol " + vol.getType() + " -> ide, based on root disk controller settings: "
+ + vmDetails.get(VmDetailConstants.ROOK_DISK_CONTROLLER));
controllerKey = ideControllerKey;
+ }
} else {
+ s_logger.info("Chose disk controller for vol " + vol.getType() + " -> scsi. due to null root disk controller setting");
controllerKey = scsiControllerKey;
}
+
} else {
// DATA volume always use SCSI device
+ s_logger.info("Chose disk controller for vol " + vol.getType() + " -> scsi");
controllerKey = scsiControllerKey;
}
@@ -3296,9 +3335,6 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
int ideControllerKey, int scsiControllerKey) throws Exception {
VirtualMachineDiskInfoBuilder diskInfoBuilder = vmMo.getDiskInfoBuilder();
- int controllerKey;
- int ideUnitNumber = 1; // we always count in IDE device first
- int scsiUnitNumber = 0;
for(DiskTO vol: sortedDisks) {
if (vol.getType() == Volume.Type.ISO)
@@ -3306,15 +3342,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
VolumeObjectTO volumeTO = (VolumeObjectTO)vol.getData();
- controllerKey = getDiskController(vol, vmSpec, ideControllerKey, scsiControllerKey);
-
- String deviceBusName;
- if(controllerKey == ideControllerKey)
- deviceBusName = String.format("ide%d:%d", 0, ideUnitNumber++);
- else
- deviceBusName = String.format("scsi%d:%d", 0, scsiUnitNumber++);
-
- VirtualMachineDiskInfo diskInfo = diskInfoBuilder.getDiskInfoByDeviceBusName(deviceBusName);
+ VirtualMachineDiskInfo diskInfo = getMatchingExistingDisk(diskInfoBuilder, vol);
assert(diskInfo != null);
String[] diskChain = diskInfo.getDiskChain();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e9cb0d6f/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageLayoutHelper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageLayoutHelper.java b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageLayoutHelper.java
index 20544df..24b13c8 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageLayoutHelper.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageLayoutHelper.java
@@ -109,10 +109,10 @@ public class VmwareStorageLayoutHelper {
String[] vmdkFullCloneModePair = getVmdkFilePairDatastorePath(ds, vmName, vmdkName,
VmwareStorageLayoutType.VMWARE, false);
- if(!ds.fileExists(vmdkLinkedCloneModeLegacyPair[0])) {
+ if(!ds.fileExists(vmdkLinkedCloneModeLegacyPair[0]) && !ds.fileExists(vmdkLinkedCloneModePair[0])) {
// To protect against inconsistency caused by non-atomic datastore file management, detached disk may
// be left over in its previous owner VM. We will do a fixup synchronization here by moving it to root
- // again
+ // again.
//
syncVolumeToRootFolder(dcMo, ds, vmdkName);
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e9cb0d6f/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
index 6007bf0..f711859 100644
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
@@ -988,7 +988,7 @@ public class VirtualMachineMO extends BaseMO {
s_logger.trace("vCenter API trace - attachDisk(). target MOR: " + _mor.getValue() + ", vmdkDatastorePath: "
+ new Gson().toJson(vmdkDatastorePathChain) + ", datastore: " + morDs.getValue());
- VirtualDevice newDisk = VmwareHelper.prepareDiskDevice(this, getScsiDeviceControllerKey(),
+ VirtualDevice newDisk = VmwareHelper.prepareDiskDevice(this, null, getScsiDeviceControllerKey(),
vmdkDatastorePathChain, morDs, -1, 1);
VirtualMachineConfigSpec reConfigSpec = new VirtualMachineConfigSpec();
VirtualDeviceConfigSpec deviceConfigSpec = new VirtualDeviceConfigSpec();
@@ -1573,7 +1573,7 @@ public class VirtualMachineMO extends BaseMO {
VirtualMachineConfigSpec vmConfigSpec = new VirtualMachineConfigSpec();
VirtualDeviceConfigSpec deviceConfigSpec = new VirtualDeviceConfigSpec();
- VirtualDevice device = VmwareHelper.prepareDiskDevice(clonedVmMo, -1, disks, morDs, -1, 1);
+ VirtualDevice device = VmwareHelper.prepareDiskDevice(clonedVmMo, null, -1, disks, morDs, -1, 1);
deviceConfigSpec.setDevice(device);
deviceConfigSpec.setOperation(VirtualDeviceConfigSpecOperation.ADD);
@@ -1841,6 +1841,22 @@ public class VirtualMachineMO extends BaseMO {
return null;
}
+ public VirtualDisk getDiskDeviceByDeviceBusName(String deviceBusName) throws Exception {
+ List<VirtualDevice> devices = (List<VirtualDevice>)_context.getVimClient().getDynamicProperty(_mor, "config.hardware.device");
+
+ if(devices != null && devices.size() > 0) {
+ for(VirtualDevice device : devices) {
+ if(device instanceof VirtualDisk) {
+ String deviceNumbering = getDeviceBusName(devices, device);
+ if(deviceNumbering.equals(deviceBusName))
+ return (VirtualDisk)device;
+ }
+ }
+ }
+
+ return null;
+ }
+
public VirtualMachineDiskInfoBuilder getDiskInfoBuilder() throws Exception {
VirtualMachineDiskInfoBuilder builder = new VirtualMachineDiskInfoBuilder();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e9cb0d6f/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareHelper.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareHelper.java b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareHelper.java
index e545c8e..bcf9f14 100644
--- a/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareHelper.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareHelper.java
@@ -264,18 +264,40 @@ public class VmwareHelper {
}
// vmdkDatastorePath: [datastore name] vmdkFilePath
- public static VirtualDevice prepareDiskDevice(VirtualMachineMO vmMo, int controllerKey, String vmdkDatastorePathChain[],
+ public static VirtualDevice prepareDiskDevice(VirtualMachineMO vmMo, VirtualDisk device, int controllerKey, String vmdkDatastorePathChain[],
ManagedObjectReference morDs, int deviceNumber, int contextNumber) throws Exception {
assert(vmdkDatastorePathChain != null);
assert(vmdkDatastorePathChain.length >= 1);
- VirtualDisk disk = new VirtualDisk();
-
- VirtualDiskFlatVer2BackingInfo backingInfo = new VirtualDiskFlatVer2BackingInfo();
- backingInfo.setDatastore(morDs);
+ VirtualDisk disk;
+ VirtualDiskFlatVer2BackingInfo backingInfo;
+ if(device != null) {
+ disk = device;
+ backingInfo = (VirtualDiskFlatVer2BackingInfo)disk.getBacking();
+ } else {
+ disk = new VirtualDisk();
+ backingInfo = new VirtualDiskFlatVer2BackingInfo();
+ backingInfo.setDatastore(morDs);
+ backingInfo.setDiskMode(VirtualDiskMode.PERSISTENT.value());
+ disk.setBacking(backingInfo);
+
+ if(controllerKey < 0)
+ controllerKey = vmMo.getIDEDeviceControllerKey();
+ if(deviceNumber < 0)
+ deviceNumber = vmMo.getNextDeviceNumber(controllerKey);
+
+ disk.setControllerKey(controllerKey);
+ disk.setKey(-contextNumber);
+ disk.setUnitNumber(deviceNumber);
+
+ VirtualDeviceConnectInfo connectInfo = new VirtualDeviceConnectInfo();
+ connectInfo.setConnected(true);
+ connectInfo.setStartConnected(true);
+ disk.setConnectable(connectInfo);
+ }
+
backingInfo.setFileName(vmdkDatastorePathChain[0]);
- backingInfo.setDiskMode(VirtualDiskMode.PERSISTENT.value());
if(vmdkDatastorePathChain.length > 1) {
String[] parentDisks = new String[vmdkDatastorePathChain.length - 1];
for(int i = 0; i < vmdkDatastorePathChain.length - 1; i++)
@@ -284,22 +306,6 @@ public class VmwareHelper {
setParentBackingInfo(backingInfo, morDs, parentDisks);
}
- disk.setBacking(backingInfo);
-
- if(controllerKey < 0)
- controllerKey = vmMo.getIDEDeviceControllerKey();
- if(deviceNumber < 0)
- deviceNumber = vmMo.getNextDeviceNumber(controllerKey);
-
- disk.setControllerKey(controllerKey);
- disk.setKey(-contextNumber);
- disk.setUnitNumber(deviceNumber);
-
- VirtualDeviceConnectInfo connectInfo = new VirtualDeviceConnectInfo();
- connectInfo.setConnected(true);
- connectInfo.setStartConnected(true);
- disk.setConnectable(connectInfo);
-
return disk;
}
[20/21] git commit: updated refs/heads/4.2 to 51707d8
Posted by an...@apache.org.
CLOUDSTACK-4586 Added CIDR validation for SG Egress rules
(cherry picked from commit b99962d27f3ba24f31d5b99bae64c20ea48f13ae)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/fbba6d0e
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/fbba6d0e
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/fbba6d0e
Branch: refs/heads/4.2
Commit: fbba6d0e3e52fc9210fdc9f77d4711dc4a38085e
Parents: e9cb0d6
Author: Jayapal <ja...@apache.org>
Authored: Tue Sep 3 14:17:16 2013 +0530
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:32:45 2013 -0700
----------------------------------------------------------------------
.../user/securitygroup/AuthorizeSecurityGroupIngressCmd.java | 7 -------
.../com/cloud/network/security/SecurityGroupManagerImpl.java | 8 ++++++++
2 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fbba6d0e/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java
index f8cd8c5..13d2133 100644
--- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java
@@ -207,13 +207,6 @@ public class AuthorizeSecurityGroupIngressCmd extends BaseAsyncCmd {
@Override
public void execute() {
- if(cidrList != null){
- for(String cidr : cidrList ){
- if (!NetUtils.isValidCIDR(cidr)){
- throw new ServerApiException(ApiErrorCode.PARAM_ERROR, cidr + " is an Invalid CIDR ");
- }
- }
- }
List<? extends SecurityRule> ingressRules = _securityGroupService.authorizeSecurityGroupIngress(this);
if (ingressRules != null && !ingressRules.isEmpty()) {
SecurityGroupResponse response = _responseGenerator.createSecurityGroupResponseFromSecurityGroupRule(ingressRules);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fbba6d0e/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java b/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java
index 1c189c4..fc95f21 100755
--- a/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java
+++ b/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java
@@ -600,6 +600,14 @@ public class SecurityGroupManagerImpl extends ManagerBase implements SecurityGro
protocol = NetUtils.ALL_PROTO;
}
+ if(cidrList != null){
+ for(String cidr : cidrList ){
+ if (!NetUtils.isValidCIDR(cidr)){
+ throw new InvalidParameterValueException("Invalid cidr " + cidr);
+ }
+ }
+ }
+
if (!NetUtils.isValidSecurityGroupProto(protocol)) {
throw new InvalidParameterValueException("Invalid protocol " + protocol);
}
[18/21] git commit: updated refs/heads/4.2 to 51707d8
Posted by an...@apache.org.
disk resize NPE, if the new disk offering doesn't have tags, then NPE
(cherry picked from commit 21a44e3ed10953b47559f1d8482b0c4aec3f6906)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b269a29f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b269a29f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b269a29f
Branch: refs/heads/4.2
Commit: b269a29f78222d4fbcdf2a6c8c5e74022887fd12
Parents: def926c
Author: Edison Su <su...@gmail.com>
Authored: Fri Aug 30 18:15:20 2013 -0700
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:31:41 2013 -0700
----------------------------------------------------------------------
server/src/com/cloud/storage/VolumeManagerImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b269a29f/server/src/com/cloud/storage/VolumeManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeManagerImpl.java b/server/src/com/cloud/storage/VolumeManagerImpl.java
index 85a19ca..1d6b44f 100644
--- a/server/src/com/cloud/storage/VolumeManagerImpl.java
+++ b/server/src/com/cloud/storage/VolumeManagerImpl.java
@@ -1144,7 +1144,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
}
if (diskOffering.getTags() != null) {
- if (!newDiskOffering.getTags().equals(diskOffering.getTags())) {
+ if (newDiskOffering.getTags() == null || !newDiskOffering.getTags().equals(diskOffering.getTags())) {
throw new InvalidParameterValueException(
"Tags on new and old disk offerings must match");
}
[06/21] git commit: updated refs/heads/4.2 to 51707d8
Posted by an...@apache.org.
Fix the build cause by typo in a un-test check-in!
(cherry picked from commit 2848af8126f47f92ebb90191e62778461193cb9b)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/679aae78
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/679aae78
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/679aae78
Branch: refs/heads/4.2
Commit: 679aae78f3c4e9a94ce50f693e31895a6b254d7e
Parents: d6b19ba
Author: Kelven Yang <ke...@gmail.com>
Authored: Thu Aug 29 16:18:36 2013 -0700
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:16:56 2013 -0700
----------------------------------------------------------------------
.../src/com/cloud/hypervisor/vmware/resource/VmwareResource.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/679aae78/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 97c9acc..96ee201 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
@@ -448,7 +448,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
} else if (clz == GetVmStatsCommand.class) {
answer = execute((GetVmStatsCommand) cmd);
} else if (clz == GetVmDiskStatsCommand.class) {
- answer = execute((GetDiskVmStatsCommand) cmd);
+ answer = execute((GetVmDiskStatsCommand) cmd);
} else if (clz == CheckHealthCommand.class) {
answer = execute((CheckHealthCommand) cmd);
} else if (clz == StopCommand.class) {
[07/21] git commit: updated refs/heads/4.2 to 51707d8
Posted by an...@apache.org.
CLOUDSTACK-4405: fix vm migration during the upgrade to 4.2
(cherry picked from commit 3cca6502a1b48556ca7bb103ed226d44557dc399)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1b684ac2
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1b684ac2
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1b684ac2
Branch: refs/heads/4.2
Commit: 1b684ac23137c598a9cd605e7c43c8c667228125
Parents: 679aae7
Author: Edison Su <su...@gmail.com>
Authored: Thu Aug 29 16:37:45 2013 -0700
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:17:38 2013 -0700
----------------------------------------------------------------------
agent/bindir/libvirtqemuhook.in | 53 ++++++++++++++++++++
packaging/centos63/cloud.spec | 2 +
.../kvm/resource/BridgeVifDriver.java | 19 ++++---
3 files changed, 67 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1b684ac2/agent/bindir/libvirtqemuhook.in
----------------------------------------------------------------------
diff --git a/agent/bindir/libvirtqemuhook.in b/agent/bindir/libvirtqemuhook.in
new file mode 100755
index 0000000..7bf9634
--- /dev/null
+++ b/agent/bindir/libvirtqemuhook.in
@@ -0,0 +1,53 @@
+#!/usr/bin/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.
+import sys
+from xml.dom.minidom import parse
+from cloudutils.configFileOps import configFileOps
+from cloudutils.networkConfig import networkConfig
+def isOldStyleBridge(brName):
+ if brName.find("cloudVirBr") == 0:
+ return True
+ else:
+ return False
+def getGuestNetworkDevice():
+ netlib = networkConfig()
+ cfo = configFileOps("/etc/cloudstack/agent/agent.properties")
+ guestDev = cfo.getEntry("guest.network.device")
+ enslavedDev = netlib.getEnslavedDev(guestDev, 1)
+ return enslavedDev
+def handleMigrateBegin():
+ try:
+ domain = parse(sys.stdin)
+ for interface in domain.getElementsByTagName("interface"):
+ source = interface.getElementsByTagName("source")[0]
+ bridge = source.getAttribute("bridge")
+ if not isOldStyleBridge(bridge):
+ continue
+ vlanId = bridge.replace("cloudVirBr","")
+ phyDev = getGuestNetworkDevice()
+ newBrName="br" + phyDev + "-" + vlanId
+ source.setAttribute("bridge", newBrName)
+ print(domain.toxml())
+ except:
+ pass
+if __name__ == '__main__':
+ if len(sys.argv) != 5:
+ sys.exit(0)
+
+ if sys.argv[2] == "migrate" and sys.argv[3] == "begin":
+ handleMigrateBegin()
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1b684ac2/packaging/centos63/cloud.spec
----------------------------------------------------------------------
diff --git a/packaging/centos63/cloud.spec b/packaging/centos63/cloud.spec
index 01685e3..2b814f8 100644
--- a/packaging/centos63/cloud.spec
+++ b/packaging/centos63/cloud.spec
@@ -287,6 +287,7 @@ install -D agent/target/transformed/environment.properties ${RPM_BUILD_ROOT}%{_s
install -D agent/target/transformed/log4j-cloud.xml ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/agent/log4j-cloud.xml
install -D agent/target/transformed/cloud-setup-agent ${RPM_BUILD_ROOT}%{_bindir}/%{name}-setup-agent
install -D agent/target/transformed/cloudstack-agent-upgrade ${RPM_BUILD_ROOT}%{_bindir}/%{name}-agent-upgrade
+install -D agent/target/transformed/libvirtqemuhook ${RPM_BUILD_ROOT}%{_datadir}/%{name}-agent/lib/libvirtqemuhook
install -D agent/target/transformed/cloud-ssh ${RPM_BUILD_ROOT}%{_bindir}/%{name}-ssh
install -D plugins/hypervisors/kvm/target/cloud-plugin-hypervisor-kvm-%{_maventag}.jar ${RPM_BUILD_ROOT}%{_datadir}/%name-agent/lib/cloud-plugin-hypervisor-kvm-%{_maventag}.jar
cp plugins/hypervisors/kvm/target/dependencies/* ${RPM_BUILD_ROOT}%{_datadir}/%{name}-agent/lib
@@ -555,6 +556,7 @@ fi
%config(noreplace) %{_sysconfdir}/%{name}/agent
%dir %{_localstatedir}/log/%{name}/agent
%attr(0644,root,root) %{_datadir}/%{name}-agent/lib/*.jar
+%attr(0755,root,root) %{_datadir}/%{name}-agent/lib/libvirtqemuhook
%dir %{_datadir}/%{name}-agent/plugins
%{_defaultdocdir}/%{name}-agent-%{version}/LICENSE
%{_defaultdocdir}/%{name}-agent-%{version}/NOTICE
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1b684ac2/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
index 195cf40..e3779a7 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
@@ -45,6 +45,7 @@ public class BridgeVifDriver extends VifDriverBase {
private static final Object _vnetBridgeMonitor = new Object();
private String _modifyVlanPath;
+ private String bridgeNameSchema;
@Override
public void configure(Map<String, Object> params) throws ConfigurationException {
@@ -60,6 +61,8 @@ public class BridgeVifDriver extends VifDriverBase {
networkScriptsDir = "scripts/vm/network/vnet";
}
+ bridgeNameSchema = (String) params.get("network.bridge.name.schema");
+
String value = (String) params.get("scripts.timeout");
_timeout = NumbersUtil.parseInt(value, 30 * 60) * 1000;
@@ -144,13 +147,15 @@ public class BridgeVifDriver extends VifDriverBase {
}
private String setVnetBrName(String pifName, String vnetId) {
- String brName = "br" + pifName + "-"+ vnetId;
- String oldStyleBrName = "cloudVirBr" + vnetId;
-
- String cmdout = Script.runSimpleBashScript("brctl show | grep " + oldStyleBrName);
- if (cmdout != null && cmdout.contains(oldStyleBrName)) {
- s_logger.info("Using old style bridge name for vlan " + vnetId + " because existing bridge " + oldStyleBrName + " was found");
- brName = oldStyleBrName;
+ String brName = null;
+ if (bridgeNameSchema != null) {
+ if (bridgeNameSchema.equalsIgnoreCase("3.0")) {
+ brName = "cloudVirBr" + vnetId;
+ } else if (bridgeNameSchema.equalsIgnoreCase("4.0")) {
+ brName = "br" + pifName + "-"+ vnetId;
+ }
+ } else {
+ brName = "br" + pifName + "-"+ vnetId;
}
return brName;
[12/21] git commit: updated refs/heads/4.2 to 51707d8
Posted by an...@apache.org.
CLOUDSTACK-4362: always honor vCenter on-disk meta data to work with live migration better
(cherry picked from commit e362f51f37b718466f2d80d9193e58e1fafcb8fb)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/92f2360f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/92f2360f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/92f2360f
Branch: refs/heads/4.2
Commit: 92f2360f6109492cdebb247cf6da35dc513e0fbd
Parents: ae00118
Author: Kelven Yang <ke...@gmail.com>
Authored: Fri Aug 30 11:10:56 2013 -0700
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:25:02 2013 -0700
----------------------------------------------------------------------
.../vmware/resource/VmwareResource.java | 34 ++++++++++----------
1 file changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/92f2360f/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 96ee201..de6885c 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
@@ -3031,27 +3031,27 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
throw new Exception("Primary datastore " + primaryStore.getUuid() + " is not mounted on host.");
DatastoreMO dsMo = volumeDsDetails.second();
+ // we will honor vCenter's meta if it exists
+ if(diskInfoBuilder != null && diskInfoBuilder.getDiskCount() > 0) {
+ // we will always on-disk info from vCenter in this case
+ VirtualMachineDiskInfo diskInfo = diskInfoBuilder.getDiskInfoByDeviceBusName(deviceBusName);
+ if(diskInfo != null) {
+ if(s_logger.isInfoEnabled())
+ s_logger.info("Volume " + volumeTO.getId() + " does not seem to exist on datastore. use on-disk chain: " +
+ _gson.toJson(diskInfo));
+
+ return diskInfo.getDiskChain();
+ } else {
+ s_logger.warn("Volume " + volumeTO.getId() + " does not seem to exist on datastore. on-disk may be out of sync as well. disk device info: " + deviceBusName);
+ }
+ }
+
String datastoreDiskPath = VmwareStorageLayoutHelper.syncVolumeToVmDefaultFolder(
- dcMo, vmMo.getName(), dsMo, volumeTO.getPath());
-
+ dcMo, vmMo.getName(), dsMo, volumeTO.getPath());
if(!dsMo.fileExists(datastoreDiskPath)) {
if(s_logger.isInfoEnabled())
s_logger.info("Volume " + volumeTO.getId() + " does not seem to exist on datastore, out of sync? path: " + datastoreDiskPath);
- if(diskInfoBuilder != null && diskInfoBuilder.getDiskCount() > 0) {
- // we will always on-disk info from vCenter in this case
- VirtualMachineDiskInfo diskInfo = diskInfoBuilder.getDiskInfoByDeviceBusName(deviceBusName);
- if(diskInfo != null) {
- if(s_logger.isInfoEnabled())
- s_logger.info("Volume " + volumeTO.getId() + " does not seem to exist on datastore. use on-disk chain: " +
- _gson.toJson(diskInfo));
-
- return diskInfo.getDiskChain();
- } else {
- s_logger.warn("Volume " + volumeTO.getId() + " does not seem to exist on datastore. on-disk may be out of sync as well. disk device info: " + deviceBusName);
- }
- }
-
// last resort, try chain info stored in DB
if(volumeTO.getChainInfo() != null) {
VirtualMachineDiskInfo diskInfo = _gson.fromJson(volumeTO.getChainInfo(), VirtualMachineDiskInfo.class);
@@ -3061,7 +3061,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
}
throw new Exception("Volume " + volumeTO.getId() + " does not seem to exist on datastore. Broken disk chain");
- }
+ }
}
return new String[] { datastoreDiskPath };
[17/21] git commit: updated refs/heads/4.2 to 51707d8
Posted by an...@apache.org.
kvm upgrade issue from 2.2.14: 1. the uuid passed by mgt server is malformat, libvirt can't start vm. 2. the template path on primary storage is incorrect, which contains absolute path
(cherry picked from commit ffc53e81e0de998f15a91b90eb05104402c4538c)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/def926ca
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/def926ca
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/def926ca
Branch: refs/heads/4.2
Commit: def926ca5e0253ba2b8e6ad95312b98fa6de2484
Parents: 97cb5f3
Author: Edison Su <su...@gmail.com>
Authored: Fri Aug 30 18:06:08 2013 -0700
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:31:22 2013 -0700
----------------------------------------------------------------------
.../kvm/resource/LibvirtComputingResource.java | 20 +++++++++++++++++++-
.../kvm/storage/KVMStorageProcessor.java | 4 ++++
.../resource/LibvirtComputingResourceTest.java | 15 +++++++++++++++
3 files changed, 38 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/def926ca/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 67819bc..3ee811f 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
@@ -3374,10 +3374,28 @@ ServerResource {
}
}
+ protected String getUuid(String uuid) {
+ if (uuid == null) {
+ uuid = UUID.randomUUID().toString();
+ } else {
+ try {
+ UUID uuid2 = UUID.fromString(uuid);
+ String uuid3 = uuid2.toString();
+ if (!uuid3.equals(uuid)) {
+ uuid = UUID.randomUUID().toString();
+ }
+ } catch (IllegalArgumentException e) {
+ uuid = UUID.randomUUID().toString();
+ }
+ }
+ return uuid;
+ }
protected LibvirtVMDef createVMFromSpec(VirtualMachineTO vmTO) {
LibvirtVMDef vm = new LibvirtVMDef();
vm.setDomainName(vmTO.getName());
- vm.setDomUUID(vmTO.getUuid());
+ String uuid = vmTO.getUuid();
+ uuid = getUuid(uuid);
+ vm.setDomUUID(uuid);
vm.setDomDescription(vmTO.getOs());
GuestDef guest = new GuestDef();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/def926ca/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
index 8482a8d..99ea04f 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java
@@ -289,6 +289,10 @@ public class KVMStorageProcessor implements StorageProcessor {
if (primaryPool.getType() == StoragePoolType.CLVM) {
vol = templateToPrimaryDownload(templatePath, primaryPool);
} else {
+ if (templatePath.contains("/mnt")) {
+ //upgrade issue, if the path contains path, need to extract the volume uuid from path
+ templatePath = templatePath.substring(templatePath.lastIndexOf(File.separator) + 1);
+ }
BaseVol = storagePoolMgr.getPhysicalDisk(primaryStore.getPoolType(), primaryStore.getUuid(), templatePath);
vol = storagePoolMgr.createDiskFromTemplate(BaseVol, UUID.randomUUID().toString(), BaseVol.getPool());
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/def926ca/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java b/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java
index 3640030..d6e8dc2 100644
--- a/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java
+++ b/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java
@@ -24,11 +24,13 @@ import com.cloud.template.VirtualMachineTemplate.BootloaderType;
import com.cloud.utils.Pair;
import com.cloud.vm.VirtualMachine;
+import junit.framework.Assert;
import org.apache.commons.lang.SystemUtils;
import org.junit.Assume;
import org.junit.Test;
import java.util.Random;
+import java.util.UUID;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -195,4 +197,17 @@ public class LibvirtComputingResourceTest {
Pair<Double, Double> stats = LibvirtComputingResource.getNicStats("lo");
assertNotNull(stats);
}
+
+ @Test
+ public void testUUID() {
+ String uuid = "1";
+ LibvirtComputingResource lcr = new LibvirtComputingResource();
+ uuid =lcr.getUuid(uuid);
+ Assert.assertTrue(!uuid.equals("1"));
+
+ String oldUuid = UUID.randomUUID().toString();
+ uuid = oldUuid;
+ uuid = lcr.getUuid(uuid);
+ Assert.assertTrue(uuid.equals(oldUuid));
+ }
}
[02/21] git commit: updated refs/heads/4.2 to 51707d8
Posted by an...@apache.org.
CLOUDSTACK-1192: GetVmDiskStatsCommand return null as disk I/O statistics does not support xen/vmware
(cherry picked from commit 3121133c03c4db30c9bc0a3a5546e19678b2ee76)
Signed-off-by: animesh <an...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e3eefdf5
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e3eefdf5
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e3eefdf5
Branch: refs/heads/4.2
Commit: e3eefdf5a8839ea8aacd57c332b215adf7d47e3c
Parents: dced972
Author: Wei Zhou <w....@leaseweb.com>
Authored: Thu Aug 29 23:14:42 2013 +0200
Committer: animesh <an...@apache.org>
Committed: Tue Sep 3 16:12:46 2013 -0700
----------------------------------------------------------------------
.../com/cloud/hypervisor/vmware/resource/VmwareResource.java | 8 ++++++++
.../cloud/hypervisor/xen/resource/CitrixResourceBase.java | 8 ++++++++
2 files changed, 16 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e3eefdf5/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 16b829a..97c9acc 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
@@ -91,6 +91,8 @@ import com.cloud.agent.api.GetHostStatsAnswer;
import com.cloud.agent.api.GetHostStatsCommand;
import com.cloud.agent.api.GetStorageStatsAnswer;
import com.cloud.agent.api.GetStorageStatsCommand;
+import com.cloud.agent.api.GetVmDiskStatsAnswer;
+import com.cloud.agent.api.GetVmDiskStatsCommand;
import com.cloud.agent.api.GetVmStatsAnswer;
import com.cloud.agent.api.GetVmStatsCommand;
import com.cloud.agent.api.GetVncPortAnswer;
@@ -445,6 +447,8 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
answer = execute((GetHostStatsCommand) cmd);
} else if (clz == GetVmStatsCommand.class) {
answer = execute((GetVmStatsCommand) cmd);
+ } else if (clz == GetVmDiskStatsCommand.class) {
+ answer = execute((GetDiskVmStatsCommand) cmd);
} else if (clz == CheckHealthCommand.class) {
answer = execute((CheckHealthCommand) cmd);
} else if (clz == StopCommand.class) {
@@ -3808,6 +3812,10 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
return answer;
}
+ protected Answer execute(GetVmDiskStatsCommand cmd) {
+ return new GetVmDiskStatsAnswer(cmd, null, null, null);
+ }
+
protected Answer execute(CheckHealthCommand cmd) {
if (s_logger.isInfoEnabled()) {
s_logger.info("Executing resource CheckHealthCommand: " + _gson.toJson(cmd));
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e3eefdf5/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index 4de9ab9..815299b 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -56,6 +56,8 @@ import com.cloud.agent.api.GetHostStatsAnswer;
import com.cloud.agent.api.GetHostStatsCommand;
import com.cloud.agent.api.GetStorageStatsAnswer;
import com.cloud.agent.api.GetStorageStatsCommand;
+import com.cloud.agent.api.GetVmDiskStatsAnswer;
+import com.cloud.agent.api.GetVmDiskStatsCommand;
import com.cloud.agent.api.GetVmStatsAnswer;
import com.cloud.agent.api.GetVmStatsCommand;
import com.cloud.agent.api.GetVncPortAnswer;
@@ -489,6 +491,8 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
return execute((GetHostStatsCommand) cmd);
} else if (clazz == GetVmStatsCommand.class) {
return execute((GetVmStatsCommand) cmd);
+ } else if (clazz == GetVmDiskStatsCommand.class) {
+ return execute((GetVmDiskStatsCommand) cmd);
} else if (clazz == CheckHealthCommand.class) {
return execute((CheckHealthCommand) cmd);
} else if (clazz == StopCommand.class) {
@@ -2757,6 +2761,10 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
return vmResponseMap;
}
+ protected GetVmDiskStatsAnswer execute(GetVmDiskStatsCommand cmd) {
+ return new GetVmDiskStatsAnswer(cmd, null, null, null);
+ }
+
protected Object[] getRRDData(Connection conn, int flag) {
/*