[
https://issues.apache.org/jira/browse/CLOUDSTACK-10157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16286124#comment-16286124
]
ASF GitHub Bot commented on CLOUDSTACK-10157:
---------------------------------------------
rhtyd closed pull request #2337: CLOUDSTACK-10157: Wrong notification while
migration.
URL: https://github.com/apache/cloudstack/pull/2337
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java
b/server/src/com/cloud/resource/ResourceManagerImpl.java
index 9feb9b7f683..33c36de2f8e 100755
--- a/server/src/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/com/cloud/resource/ResourceManagerImpl.java
@@ -29,6 +29,10 @@
import javax.inject.Inject;
import javax.naming.ConfigurationException;
+import org.apache.commons.lang.ObjectUtils;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.command.admin.cluster.AddClusterCmd;
import org.apache.cloudstack.api.command.admin.cluster.DeleteClusterCmd;
@@ -44,9 +48,7 @@
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
import org.apache.cloudstack.utils.identity.ManagementServerNode;
-import org.apache.commons.lang.ObjectUtils;
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
+import org.apache.commons.collections.CollectionUtils;
import com.cloud.agent.AgentManager;
import com.cloud.agent.api.Answer;
@@ -2755,8 +2757,15 @@ public boolean isGPUDeviceAvailable(final long hostId,
final String groupName, f
@Override
public GPUDeviceTO getGPUDevice(final long hostId, final String groupName,
final String vgpuType) {
- final HostGpuGroupsVO gpuDevice = listAvailableGPUDevice(hostId,
groupName, vgpuType).get(0);
- return new GPUDeviceTO(gpuDevice.getGroupName(), vgpuType, null);
+ final List<HostGpuGroupsVO> gpuDeviceList =
listAvailableGPUDevice(hostId, groupName, vgpuType);
+
+ if (CollectionUtils.isEmpty(gpuDeviceList)) {
+ final String errorMsg = "Host " + hostId + " does not have
required GPU device or out of capacity. GPU group: " + groupName + ", vGPU
Type: " + vgpuType;
+ s_logger.error(errorMsg);
+ throw new CloudRuntimeException(errorMsg);
+ }
+
+ return new GPUDeviceTO(gpuDeviceList.get(0).getGroupName(), vgpuType,
null);
}
@Override
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Wrong notification while migration
> ----------------------------------
>
> Key: CLOUDSTACK-10157
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10157
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Components: API
> Affects Versions: 4.11.0.0
> Reporter: Nitin Kumar Maharana
> Labels: GPU
> Fix For: 4.11.0.0
>
>
> RETRO STEPS:
> 1. Had three hosts in one cluster, two of them with GPU cards NVIDIA GRID K1
> and K2 and one normal host.
> 2. Deployed a VM with K2 vgpu.
> 3. Stopped the VM and tried starting it on a different host. (Expected it to
> fail as there is only one host supporting that particular vgpu type)
> 4. The log showed it as failed operation, VM remained in the stopped state,
> yet the notification showed "Start Instance" as successful and no error
> message was displayed.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)