mirror of https://github.com/apache/cloudstack.git
Merge release branch 4.9 to master
* 4.9: CLOUDSTACK-8830: Fix for vm snapshots in Vmware, could not create vm snapshot until 12 minutes after vm creation due to vCenter sent null name on snpashot recent task
This commit is contained in:
commit
becec33c2e
|
|
@ -1184,7 +1184,8 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager {
|
|||
for (ManagedObjectReference taskMor : tasks) {
|
||||
TaskInfo info = (TaskInfo)(context.getVimClient().getDynamicProperty(taskMor, "info"));
|
||||
|
||||
if (info.getEntityName().equals(cmd.getVmName()) && info.getName().equalsIgnoreCase("CreateSnapshot_Task")) {
|
||||
if (info.getEntityName().equals(cmd.getVmName()) && StringUtils.isNotBlank(info.getName()) &&
|
||||
info.getName().equalsIgnoreCase("CreateSnapshot_Task")) {
|
||||
if (!(info.getState().equals(TaskInfoState.SUCCESS) || info.getState().equals(TaskInfoState.ERROR))) {
|
||||
s_logger.debug("There is already a VM snapshot task running, wait for it");
|
||||
context.getVimClient().waitForTask(taskMor);
|
||||
|
|
@ -1403,7 +1404,8 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager {
|
|||
for (ManagedObjectReference taskMor : tasks) {
|
||||
TaskInfo info = (TaskInfo)(context.getVimClient().getDynamicProperty(taskMor, "info"));
|
||||
|
||||
if (info.getEntityName().equals(cmd.getVmName()) && info.getName().equalsIgnoreCase("RevertToSnapshot_Task")) {
|
||||
if (info.getEntityName().equals(cmd.getVmName()) && StringUtils.isNotBlank(info.getName()) &&
|
||||
info.getName().equalsIgnoreCase("RevertToSnapshot_Task")) {
|
||||
s_logger.debug("There is already a VM snapshot task running, wait for it");
|
||||
context.getVimClient().waitForTask(taskMor);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue