You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ra...@apache.org on 2017/03/30 08:20:59 UTC
[1/2] git commit: updated refs/heads/master to 0f0d908
Repository: cloudstack
Updated Branches:
refs/heads/master 525c45c1e -> 0f0d90829
CLOUDSTACK-9851 travis CI build failure after merge of PR#1953
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/7348f941
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/7348f941
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/7348f941
Branch: refs/heads/master
Commit: 7348f9412a20ecff2f7a9f26633013e06e5394dd
Parents: 525c45c
Author: Sudharma Jain <su...@accelerite.com>
Authored: Tue Mar 28 17:57:28 2017 +0530
Committer: Sudharma Jain <su...@accelerite.com>
Committed: Thu Mar 30 09:22:58 2017 +0530
----------------------------------------------------------------------
server/src/com/cloud/storage/VolumeApiServiceImpl.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7348f941/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 c073d5f..57804a7 100644
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@ -1433,7 +1433,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
// that supported by hypervisor
if (deviceId == null || deviceId.longValue() != 0) {
List<VolumeVO> existingDataVolumes = _volsDao.findByInstanceAndType(vmId, Volume.Type.DATADISK);
- int maxAttachableDataVolumesSupported = getMaxDataVolumesSupported(vm) - 2; //IDs: 0 (ROOT) and 3 (CD-ROM) are reserved
+ int maxAttachableDataVolumesSupported = getMaxDataVolumesSupported(vm);
if (existingDataVolumes.size() >= maxAttachableDataVolumesSupported) {
throw new InvalidParameterValueException("The specified VM already has the maximum number of data disks (" + maxAttachableDataVolumesSupported + ") attached. Please specify another VM.");
}
@@ -2634,11 +2634,12 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
private Long getDeviceId(UserVmVO vm, Long deviceId) {
// allocate deviceId
- int maxDeviceId = getMaxDataVolumesSupported(vm) - 1;
+ int maxDevices = getMaxDataVolumesSupported(vm) + 2; // add 2 to consider devices root volume and cdrom
+ int maxDeviceId = maxDevices - 1;
List<VolumeVO> vols = _volsDao.findByInstance(vm.getId());
if (deviceId != null) {
- if (deviceId.longValue() <= 0 || deviceId.longValue() > maxDeviceId || deviceId.longValue() == 3) {
- throw new RuntimeException("deviceId should be 1,2,4-" + maxDeviceId);
+ if (deviceId.longValue() < 0 || deviceId.longValue() > maxDeviceId || deviceId.longValue() == 3) {
+ throw new RuntimeException("deviceId should be 0,1,2,4-" + maxDeviceId);
}
for (VolumeVO vol : vols) {
if (vol.getDeviceId().equals(deviceId)) {
[2/2] git commit: updated refs/heads/master to 0f0d908
Posted by ra...@apache.org.
Merge pull request #2019 from Accelerite/cs-9850
CLOUDSTACK-9851 travis CI build failure after merge of PR#1953 & CLOUDSTACK-9850Fixed travis CI failures happening after merge of PR#1953.
Also fixed root volume detach that was broken after merge of PR#1953.
I found following logs with root volume attach.
`
2017-03-24 23:19:48,380 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] (API-Job-Executor-27:ctx-7c53d1bc job-44) (logid:f3b54257) Executing AsyncJobVO {id:44, userId: 2, accountId: 2, instanceType: Volume, instanceId: 3, cmd: org.apache.cloudstack.api.command.admin.volume.AttachVolumeCmdByAdmin, cmdInfo: {"apiKey":"PYHMg5HhOkmTQvlmZSe1dIDfTxl8uwreeFoqfj0a4zPCC-1XTuwH7H5I8Ac9fyvPbtNO1eN9THi72q8ATfs8hg","signature":"DD+ljbVWpWQw6FCl1tCDSYe5Ui0\u003d","httpmethod":"GET","deviceid":"0","ctxAccountId":"2","uuid":"2db57cd8-c96c-48f9-83c5-b9a79c852cc5","cmdEventType":"VOLUME.ATTACH","virtualmachineid":"9cb6a944-8775-4e11-961b-0e8dbdebf5a7","response":"json","ctxUserId":"2","ctxStartEventId":"117","id":"2db57cd8-c96c-48f9-83c5-b9a79c852cc5","ctxDetails":"{\"interface com.cloud.vm.VirtualMachine\":\"9cb6a944-8775-4e11-961b-0e8dbdebf5a7\",\"interface com.cloud.storage.Volume\":\"2db57cd8-c96c-48f9-83c5-b9a79c852cc5\"}"}, cmdVersion: 0, status: IN_PROGRESS, processStatus: 0, resultCode: 0, result: nul
l, initMsid: 4278190080, completeMsid: null, lastUpdated: null, lastPolled: null, created: null }
2017-03-24 23:19:50,160 ERROR [c.c.v.VmWorkJobHandlerProxy] (Work-Job-Executor-15:ctx-489eb1dd job-44/job-45 ctx-cce17070) (logid:f3b54257) Invocation exception, caused by: java.lang.RuntimeException: deviceId should be 1,2,4-5
`
* pr/2019:
CLOUDSTACK-9851 travis CI build failure after merge of PR#1953
Signed-off-by: Rajani Karuturi <ra...@accelerite.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/0f0d9082
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/0f0d9082
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/0f0d9082
Branch: refs/heads/master
Commit: 0f0d9082929cac74b3f2554e7346a992bbe655b7
Parents: 525c45c 7348f94
Author: Rajani Karuturi <ra...@accelerite.com>
Authored: Thu Mar 30 13:48:47 2017 +0530
Committer: Rajani Karuturi <ra...@accelerite.com>
Committed: Thu Mar 30 13:48:48 2017 +0530
----------------------------------------------------------------------
server/src/com/cloud/storage/VolumeApiServiceImpl.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------