You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2016/11/25 07:50:14 UTC
[1/5] git commit: updated refs/heads/4.9 to 50f80cc
Repository: cloudstack
Updated Branches:
refs/heads/4.9 e59897bad -> 50f80cc2a
CLOUDSTACK-9451
Honor the forced parameter to stop virtual machine api call.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/53fd4a79
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/53fd4a79
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/53fd4a79
Branch: refs/heads/4.9
Commit: 53fd4a7997034478f422f6b996644ca9a0ea7919
Parents: 9eb8b2e
Author: Nathan Johnson <nj...@ena.com>
Authored: Thu Aug 11 07:52:05 2016 -0500
Committer: Nathan Johnson <nj...@ena.com>
Committed: Fri Sep 9 13:00:17 2016 -0500
----------------------------------------------------------------------
engine/api/src/com/cloud/vm/VirtualMachineManager.java | 2 ++
.../engine/cloud/entity/api/VirtualMachineEntity.java | 6 ++++++
.../src/com/cloud/vm/VirtualMachineManagerImpl.java | 12 ++++++++++++
.../engine/cloud/entity/api/VMEntityManager.java | 2 ++
.../engine/cloud/entity/api/VMEntityManagerImpl.java | 6 ++++++
.../cloud/entity/api/VirtualMachineEntityImpl.java | 5 +++++
server/src/com/cloud/vm/UserVmManagerImpl.java | 7 ++++++-
7 files changed, 39 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/53fd4a79/engine/api/src/com/cloud/vm/VirtualMachineManager.java
----------------------------------------------------------------------
diff --git a/engine/api/src/com/cloud/vm/VirtualMachineManager.java b/engine/api/src/com/cloud/vm/VirtualMachineManager.java
index 8b22656..a389e13 100644
--- a/engine/api/src/com/cloud/vm/VirtualMachineManager.java
+++ b/engine/api/src/com/cloud/vm/VirtualMachineManager.java
@@ -90,6 +90,8 @@ public interface VirtualMachineManager extends Manager {
void stop(String vmUuid) throws ResourceUnavailableException;
+ void stopForced(String vmUuid) throws ResourceUnavailableException;
+
void expunge(String vmUuid) throws ResourceUnavailableException;
void registerGuru(VirtualMachine.Type type, VirtualMachineGuru guru);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/53fd4a79/engine/api/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntity.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntity.java b/engine/api/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntity.java
index 37501f0..1c3af62 100644
--- a/engine/api/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntity.java
+++ b/engine/api/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntity.java
@@ -115,6 +115,12 @@ public interface VirtualMachineEntity extends CloudStackEntity {
boolean stop(String caller) throws ResourceUnavailableException, CloudException;
/**
+ * Stop the virtual machine, by force if necessary
+ *
+ */
+ boolean stopForced(String caller) throws ResourceUnavailableException, CloudException;
+
+ /**
* Cleans up after any botched starts. CloudStack Orchestration Platform
* will attempt a best effort to actually shutdown any resource but
* even if it cannot, it releases the resource from its database.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/53fd4a79/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
index 2136f8e..18c2beb 100644
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -1239,6 +1239,18 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
} catch (final ConcurrentOperationException e) {
throw new CloudRuntimeException("Unable to stop vm because of a concurrent operation", e);
}
+
+ }
+
+ @Override
+ public void stopForced(String vmUuid) throws ResourceUnavailableException {
+ try {
+ advanceStop(vmUuid, true);
+ } catch (final OperationTimedoutException e) {
+ throw new AgentUnavailableException("Unable to stop vm because the operation to stop timed out", e.getAgentId(), e);
+ } catch (final ConcurrentOperationException e) {
+ throw new CloudRuntimeException("Unable to stop vm because of a concurrent operation", e);
+ }
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/53fd4a79/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManager.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManager.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManager.java
index 3145314..0c357ca 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManager.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManager.java
@@ -44,5 +44,7 @@ public interface VMEntityManager {
boolean stopvirtualmachine(VMEntityVO vmEntityVO, String caller) throws ResourceUnavailableException;
+ boolean stopvirtualmachineforced(VMEntityVO vmEntityVO, String caller) throws ResourceUnavailableException;
+
boolean destroyVirtualMachine(VMEntityVO vmEntityVO, String caller) throws AgentUnavailableException, OperationTimedoutException, ConcurrentOperationException;
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/53fd4a79/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
index 829ed10..a944b93 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
@@ -255,6 +255,12 @@ public class VMEntityManagerImpl implements VMEntityManager {
}
@Override
+ public boolean stopvirtualmachineforced(VMEntityVO vmEntityVO, String caller) throws ResourceUnavailableException {
+ _itMgr.stopForced(vmEntityVO.getUuid());
+ return true;
+ }
+
+ @Override
public boolean destroyVirtualMachine(VMEntityVO vmEntityVO, String caller) throws AgentUnavailableException, OperationTimedoutException, ConcurrentOperationException {
VMInstanceVO vm = _vmDao.findByUuid(vmEntityVO.getUuid());
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/53fd4a79/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityImpl.java
index 706748f..2f4de36 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityImpl.java
@@ -218,6 +218,11 @@ public class VirtualMachineEntityImpl implements VirtualMachineEntity {
}
@Override
+ public boolean stopForced(String caller) throws ResourceUnavailableException {
+ return manager.stopvirtualmachineforced(this.vmEntityVO, caller);
+ }
+
+ @Override
public void cleanup() {
// TODO Auto-generated method stub
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/53fd4a79/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 cc007d9..e205f2c 100644
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -3866,7 +3866,12 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
boolean status = false;
try {
VirtualMachineEntity vmEntity = _orchSrvc.getVirtualMachine(vm.getUuid());
- status = vmEntity.stop(Long.toString(userId));
+
+ if(forced) {
+ status = vmEntity.stopForced(Long.toString(userId));
+ } else {
+ status = vmEntity.stop(Long.toString(userId));
+ }
if (status) {
return _vmDao.findById(vmId);
} else {
[5/5] git commit: updated refs/heads/4.9 to 50f80cc
Posted by bh...@apache.org.
Merge branch '4.8' into 4.9
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/50f80cc2
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/50f80cc2
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/50f80cc2
Branch: refs/heads/4.9
Commit: 50f80cc2a0e1a26f23bedb044b0d6824201828ca
Parents: e59897b 5811d33
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Fri Nov 25 13:03:04 2016 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Fri Nov 25 13:03:04 2016 +0530
----------------------------------------------------------------------
engine/api/src/com/cloud/vm/VirtualMachineManager.java | 2 ++
.../engine/cloud/entity/api/VirtualMachineEntity.java | 6 ++++++
.../src/com/cloud/vm/VirtualMachineManagerImpl.java | 12 ++++++++++++
.../engine/cloud/entity/api/VMEntityManager.java | 2 ++
.../engine/cloud/entity/api/VMEntityManagerImpl.java | 6 ++++++
.../cloud/entity/api/VirtualMachineEntityImpl.java | 5 +++++
.../networkservice/BaremetalPxeManagerImpl.java | 2 +-
server/src/com/cloud/vm/UserVmManagerImpl.java | 7 ++++++-
8 files changed, 40 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/50f80cc2/engine/api/src/com/cloud/vm/VirtualMachineManager.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/50f80cc2/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --cc engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
index 9523b92,18c2beb..2ddf8c2
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@@ -1239,13 -1239,25 +1239,25 @@@ public class VirtualMachineManagerImpl
} catch (final ConcurrentOperationException e) {
throw new CloudRuntimeException("Unable to stop vm because of a concurrent operation", e);
}
+
+ }
+
+ @Override
+ public void stopForced(String vmUuid) throws ResourceUnavailableException {
+ try {
+ advanceStop(vmUuid, true);
+ } catch (final OperationTimedoutException e) {
+ throw new AgentUnavailableException("Unable to stop vm because the operation to stop timed out", e.getAgentId(), e);
+ } catch (final ConcurrentOperationException e) {
+ throw new CloudRuntimeException("Unable to stop vm because of a concurrent operation", e);
+ }
}
-
- protected boolean getExecuteInSequence(final HypervisorType hypervisorType) {
- if (HypervisorType.KVM == hypervisorType || HypervisorType.LXC == hypervisorType || HypervisorType.XenServer == hypervisorType) {
+ @Override
+ public boolean getExecuteInSequence(final HypervisorType hypervisorType) {
+ if (HypervisorType.KVM == hypervisorType || HypervisorType.XenServer == hypervisorType || HypervisorType.Hyperv == hypervisorType || HypervisorType.LXC == hypervisorType) {
return false;
- } else if(HypervisorType.VMware == hypervisorType) {
+ } else if (HypervisorType.VMware == hypervisorType) {
final Boolean fullClone = HypervisorGuru.VmwareFullClone.value();
return fullClone;
} else {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/50f80cc2/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
[4/5] git commit: updated refs/heads/4.9 to 50f80cc
Posted by bh...@apache.org.
Merge pull request #1635 from myENA/feature/honor_force_stop_vm
CLOUDSTACK-9451https://issues.apache.org/jira/browse/CLOUDSTACK-9451
Re-doing against 4.8 since this is a bug, not a feature.
* pr/1635:
CLOUDSTACK-9451
Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5811d336
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5811d336
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5811d336
Branch: refs/heads/4.9
Commit: 5811d33658fe1651e43dcca67c35c712f9ba4107
Parents: 020606e 53fd4a7
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Fri Nov 25 12:56:23 2016 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Fri Nov 25 12:56:23 2016 +0530
----------------------------------------------------------------------
engine/api/src/com/cloud/vm/VirtualMachineManager.java | 2 ++
.../engine/cloud/entity/api/VirtualMachineEntity.java | 6 ++++++
.../src/com/cloud/vm/VirtualMachineManagerImpl.java | 12 ++++++++++++
.../engine/cloud/entity/api/VMEntityManager.java | 2 ++
.../engine/cloud/entity/api/VMEntityManagerImpl.java | 6 ++++++
.../cloud/entity/api/VirtualMachineEntityImpl.java | 5 +++++
server/src/com/cloud/vm/UserVmManagerImpl.java | 7 ++++++-
7 files changed, 39 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
[2/5] git commit: updated refs/heads/4.9 to 50f80cc
Posted by bh...@apache.org.
CLOUDSTACK-9566 instance-id metadata for baremetal VM returns ID
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/759a92d2
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/759a92d2
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/759a92d2
Branch: refs/heads/4.9
Commit: 759a92d2516a99b90b59dc096f23e2e903d0673b
Parents: 5a2a2f4
Author: Sudharma Jain <su...@accelerite.com>
Authored: Thu Oct 27 13:50:39 2016 +0530
Committer: Sudharma Jain <su...@accelerite.com>
Committed: Thu Oct 27 13:50:39 2016 +0530
----------------------------------------------------------------------
.../cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/759a92d2/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java
index ea3245c..22f9395 100644
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java
@@ -200,7 +200,7 @@ public class BaremetalPxeManagerImpl extends ManagerBase implements BaremetalPxe
cmd.addVmData("metadata", "local-hostname", StringUtils.unicodeEscape(vm.getInstanceName()));
cmd.addVmData("metadata", "public-ipv4", nic.getIPv4Address());
cmd.addVmData("metadata", "public-hostname", StringUtils.unicodeEscape(vm.getInstanceName()));
- cmd.addVmData("metadata", "instance-id", String.valueOf(vm.getId()));
+ cmd.addVmData("metadata", "instance-id", String.valueOf(vm.getUuid()));
cmd.addVmData("metadata", "vm-id", String.valueOf(vm.getInstanceName()));
cmd.addVmData("metadata", "public-keys", null);
String cloudIdentifier = _configDao.getValue("cloud.identifier");
[3/5] git commit: updated refs/heads/4.9 to 50f80cc
Posted by bh...@apache.org.
Merge pull request #1738 from SudharmaJain/cs-9566
CLOUDSTACK-9566 instance-id metadata for baremetal VM returns IDThere is difference in instance-id metadata across baremetal and other hypervisors.
On Baremetal
[root@ip-172-17-0-144 ~]# curl http://8.37.203.221/latest/meta-data/instance-id
6021
on Xen
[root@ip-172-17-2-103 ~]# curl http://172.17.0.252/latest/meta-data/instance-id
cbeb517a-e833-4a0c-b1e8-9ed70200fbbf
In both cases it should be vm's uuid.
* pr/1738:
CLOUDSTACK-9566 instance-id metadata for baremetal VM returns ID
Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/020606ec
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/020606ec
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/020606ec
Branch: refs/heads/4.9
Commit: 020606ec31173e9e0502d1c33a40bf90d63ec337
Parents: 445d36c 759a92d
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Fri Nov 25 12:52:10 2016 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Fri Nov 25 12:52:10 2016 +0530
----------------------------------------------------------------------
.../cloud/baremetal/networkservice/BaremetalPxeManagerImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------