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 2014/12/05 13:05:57 UTC
[1/3] git commit: updated refs/heads/4.3 to 14287f7
Repository: cloudstack
Updated Branches:
refs/heads/4.3 f412e07d7 -> 14287f7d3
Fix build regression from 08e5993a45c54926f8707e86b1ffad94b3e29a51
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/48377a3f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/48377a3f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/48377a3f
Branch: refs/heads/4.3
Commit: 48377a3f124542bd3b60adbbb6db0d3530c9781a
Parents: f412e07
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Fri Dec 5 17:33:31 2014 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Fri Dec 5 17:33:31 2014 +0530
----------------------------------------------------------------------
.../com/cloud/storage/VolumeApiServiceImpl.java | 1 +
server/src/com/cloud/vm/UserVmManagerImpl.java | 48 +++++++++-----------
server/test/com/cloud/vm/UserVmManagerTest.java | 13 ++++++
3 files changed, 35 insertions(+), 27 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/48377a3f/server/src/com/cloud/storage/VolumeApiServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
index fe3f241..80c3b0e 100644
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@ -984,6 +984,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
hosts = new long[] {userVm.getLastHostId()};
}
+ final String errorMsg = "The VM must be stopped or the disk detached in order to resize with the XenServer Hypervisor.";
StoragePoolVO storagePool = _storagePoolDao.findById(volume.getPoolId());
if (storagePool.isManaged() && storagePool.getHypervisor() == HypervisorType.Any && hosts != null && hosts.length > 0) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/48377a3f/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 c5e4286..4f7fc30 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -5028,35 +5028,29 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
throw ex;
}
- VolumeVO root = rootVols.get(0);
- if ( !Volume.State.Allocated.equals(root.getState()) || newTemplateId != null ){
- Long templateId = root.getTemplateId();
- boolean isISO = false;
- if (templateId == null) {
- // Assuming that for a vm deployed using ISO, template ID is set to NULL
- isISO = true;
- templateId = vm.getIsoId();
- }
+ // If target VM has associated VM snapshots then don't allow restore of VM
+ List<VMSnapshotVO> vmSnapshots = _vmSnapshotDao.findByVm(vmId);
+ if (vmSnapshots.size() > 0) {
+ throw new InvalidParameterValueException("Unable to restore VM, please remove VM snapshots before restoring VM");
+ }
- // If target VM has associated VM snapshots then don't allow restore of VM
- List<VMSnapshotVO> vmSnapshots = _vmSnapshotDao.findByVm(vmId);
- if (vmSnapshots.size() > 0) {
- throw new InvalidParameterValueException("Unable to restore VM, please remove VM snapshots before restoring VM");
- }
+ VolumeVO root = rootVols.get(0);
+ Long templateId = root.getTemplateId();
+ boolean isISO = false;
+ if(templateId == null) {
+ // Assuming that for a vm deployed using ISO, template ID is set to NULL
+ isISO = true;
+ templateId = vm.getIsoId();
+ }
- VMTemplateVO template = null;
- //newTemplateId can be either template or ISO id. In the following snippet based on the vm deployment (from template or ISO) it is handled accordingly
- if (newTemplateId != null) {
- template = _templateDao.findById(newTemplateId);
- _accountMgr.checkAccess(caller, null, true, template);
- if (isISO) {
- if (!template.getFormat().equals(ImageFormat.ISO)) {
- throw new InvalidParameterValueException("Invalid ISO id provided to restore the VM ");
- }
- } else {
- if (template.getFormat().equals(ImageFormat.ISO)) {
- throw new InvalidParameterValueException("Invalid template id provided to restore the VM ");
- }
+ VMTemplateVO template = null;
+ //newTemplateId can be either template or ISO id. In the following snippet based on the vm deployment (from template or ISO) it is handled accordingly
+ if(newTemplateId != null) {
+ template = _templateDao.findById(newTemplateId);
+ _accountMgr.checkAccess(caller, null, true, template);
+ if (isISO) {
+ if (!template.getFormat().equals(ImageFormat.ISO)) {
+ throw new InvalidParameterValueException("Invalid ISO id provided to restore the VM ");
}
} else {
if (template.getFormat().equals(ImageFormat.ISO)) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/48377a3f/server/test/com/cloud/vm/UserVmManagerTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vm/UserVmManagerTest.java b/server/test/com/cloud/vm/UserVmManagerTest.java
index 34090ef..854d95e 100755
--- a/server/test/com/cloud/vm/UserVmManagerTest.java
+++ b/server/test/com/cloud/vm/UserVmManagerTest.java
@@ -32,9 +32,12 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.lang.reflect.Field;
+import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
+import com.cloud.vm.snapshot.VMSnapshotVO;
+import com.cloud.vm.snapshot.dao.VMSnapshotDao;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
@@ -99,6 +102,7 @@ public class UserVmManagerTest {
@Mock UserDao _userDao;
@Mock UserVmDao _vmDao;
@Mock VMInstanceDao _vmInstanceDao;
+ @Mock VMSnapshotDao _vmSnapshotDao;
@Mock VMTemplateDao _templateDao;
@Mock VolumeDao _volsDao;
@Mock RestoreVMCmd _restoreVMCmd;
@@ -123,6 +127,7 @@ public class UserVmManagerTest {
_userVmMgr._vmDao = _vmDao;
_userVmMgr._vmInstanceDao = _vmInstanceDao;
+ _userVmMgr._vmSnapshotDao = _vmSnapshotDao;
_userVmMgr._templateDao = _templateDao;
_userVmMgr._volsDao = _volsDao;
_userVmMgr._itMgr = _itMgr;
@@ -323,6 +328,10 @@ public class UserVmManagerTest {
when(_vmInstanceDao.findById(anyLong())).thenReturn(_vmInstance);
+ List<VMSnapshotVO> vmSnapshots = new ArrayList<VMSnapshotVO>();
+ vmSnapshots.add(new VMSnapshotVO());
+ when(_vmSnapshotDao.findByVm(anyLong())).thenReturn(vmSnapshots);
+
// UserContext.current().setEventDetails("Vm Id: "+getId());
Account account = new AccountVO("testaccount", 1L, "networkdomain", (short) 0, "uuid");
UserVO user = new UserVO(1, "testuser", "password", "firstname", "lastName", "email", "timezone", UUID.randomUUID().toString());
@@ -356,6 +365,10 @@ public class UserVmManagerTest {
when(_vmInstanceDao.findById(anyLong())).thenReturn(_vmInstance);
+ List<VMSnapshotVO> vmSnapshots = new ArrayList<VMSnapshotVO>();
+ vmSnapshots.add(new VMSnapshotVO());
+ when(_vmSnapshotDao.findByVm(anyLong())).thenReturn(vmSnapshots);
+
doReturn(Hypervisor.HypervisorType.XenServer).when(_vmInstance).getHypervisorType();
doReturn(VirtualMachine.State.Running).when(_vmInstance).getState();
[2/3] git commit: updated refs/heads/4.3 to 14287f7
Posted by bh...@apache.org.
Revert "CLOUDSTACK-7959: fixed 'qemu-img convert' compat issue"
This reverts commit f412e07d715428b3b7d911e3cd0c71cd79949962.
Until we decide, we should keep the same 4.3 systemvm build scripts to avoid
changes in the qemu image conversion logic.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/16f50c28
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/16f50c28
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/16f50c28
Branch: refs/heads/4.3
Commit: 16f50c2862dcd524d4b788803460fd877fff9aa4
Parents: 48377a3
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Fri Dec 5 17:33:54 2014 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Fri Dec 5 17:33:54 2014 +0530
----------------------------------------------------------------------
tools/appliance/build.sh | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/16f50c28/tools/appliance/build.sh
----------------------------------------------------------------------
diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh
index d5fc134..a9c0a0a 100755
--- a/tools/appliance/build.sh
+++ b/tools/appliance/build.sh
@@ -90,14 +90,7 @@ set -e
# Export for KVM
vboxmanage internalcommands converttoraw -format vdi "$hdd_path" raw.img
-set +e
-qemu-img convert -o compat=0.10 -f raw -c -O qcow2 raw.img $appliance-$build_date-$branch-kvm.qcow2
-local qemuresult=$?
-set -e
-if [ ${qemuresult} != 0 ]; then
- log INFO "'qemu-img convert' failed, trying without compat option"
- qemu-img convert -f raw -c -O qcow2 raw.img $appliance-$build_date-$branch-kvm.qcow2
-fi
+qemu-img convert -f raw -c -O qcow2 raw.img $appliance-$build_date-$branch-kvm.qcow2
rm raw.img
bzip2 $appliance-$build_date-$branch-kvm.qcow2
echo "$appliance exported for KVM: dist/$appliance-$build_date-$branch-kvm.qcow2.bz2"
[3/3] git commit: updated refs/heads/4.3 to 14287f7
Posted by bh...@apache.org.
CHANGES: update changes file
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/14287f7d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/14287f7d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/14287f7d
Branch: refs/heads/4.3
Commit: 14287f7d3696fd023de3c197a3aaaf25f14064c6
Parents: 16f50c2
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Fri Dec 5 17:35:39 2014 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Fri Dec 5 17:35:39 2014 +0530
----------------------------------------------------------------------
CHANGES.md | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/14287f7d/CHANGES.md
----------------------------------------------------------------------
diff --git a/CHANGES.md b/CHANGES.md
index 80dfedd..b22b898 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -112,6 +112,8 @@ This is a bug fix release. The following issues were fixed:
CLOUDSTACK-5685: reboot VR if a out-of-band power-on event is detected
CLOUDSTACK-7994: Network rules are not configured in VR after out-of-band movement due to host crash
CLOUDSTACK-5923: CS doesn't do master switch for XS any more, CS will depend on XS HA to do master switch, XS HA needs to be enabled.
+ CLOUDSTACK-7688, CLOUDSTACK-7747: restricted various operations for VM with VM snapshots which breaks VM snapshots.
+ CLOUDSTACK-7950: AttachIsoCmd shoud give correct messge when trying to attach vmwaretools installer iso on non supported guestvm deployed by ISO
Version 4.3.1
-------------