You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ha...@apache.org on 2020/11/23 08:05:09 UTC

[cloudstack] branch RecoverVMBug4462 updated (80ce495 -> 426e347)

This is an automated email from the ASF dual-hosted git repository.

harikrishna pushed a change to branch RecoverVMBug4462
in repository https://gitbox.apache.org/repos/asf/cloudstack.git.


 discard 80ce495  Fix for the issue of recover VM not able to attach the data disks which are there before destroy in case of VMware
 discard 30cdc6a  Fix migrateVMwithVolumes API in case of VMware to address the case when only volume is tried to migrate along with VM.
     add 1692df4  cks: Fix destroying k8s cluster on shared networks (#4461)
     add a3f2ee4  Fixing misleading HostMetricsResponse param description (#4485)
     add 1398dff  createkubertetesbinariesiso: Saving images in network and dashboard yaml (#4459)
     add 584fc3a  accountresponse: Fix domainpath description (#4487)
     add daec77f  Fix k8s cluster upgrade in shared networks (#4458)
     add 4fd2b74  Merge branch '4.14'
     add a368ba9  VR: fix logging is not working and logs are not appended to /var/log/cloud.log (#4466)
     add d79d242  Adding memoryallocatedpercentage & memoryallocatedbytes to HostsResponse & HostsForMigrationResponse (#4478)
     add 4929622  Merge branch '4.14'
     add 51034be  Fix migrateVMwithVolumes API in case of multiple volumes on VMware (#4480)
     add 2ad60d0  ui: Fixed double slash in secret breaking db insert (#4392)
     add 75fdb07  vpc: fix ips on wrong interfaces after rebooting vpc vrs (#4467)
     add d3f18ef  Merge remote-tracking branch 'origin/4.14'
     add dfa09fc  server: Setting snapshot removed on timeout (#4425)
     add 0a2a54a  api: Display VPC name to which the network belongs to (#4483)
     add aa67f9c  api: Add event for VM recovery operation (#4486)
     new 426e347  Fix for the issue of recover VM not able to attach the data disks which are there before destroy in case of VMware

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (80ce495)
            \
             N -- N -- N   refs/heads/RecoverVMBug4462 (426e347)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 api/src/main/java/com/cloud/event/EventTypes.java  |  1 +
 .../cloudstack/api/response/AccountResponse.java   |  6 ++--
 .../api/response/HostForMigrationResponse.java     | 17 +++++++++++
 .../cloudstack/api/response/HostResponse.java      | 17 +++++++++++
 .../cloudstack/api/response/NetworkResponse.java   | 12 ++++++++
 .../storage/snapshot/SnapshotServiceImpl.java      |  1 +
 .../KubernetesClusterDestroyWorker.java            | 10 ++++++-
 .../KubernetesClusterUpgradeWorker.java            |  2 +-
 .../cloudstack/response/HostMetricsResponse.java   |  6 ++--
 scripts/util/create-kubernetes-binaries-iso.sh     | 24 +++++++++++----
 .../main/java/com/cloud/api/ApiResponseHelper.java |  1 +
 .../com/cloud/api/query/dao/HostJoinDaoImpl.java   | 12 ++++++--
 .../VpcVirtualNetworkApplianceManagerImpl.java     | 14 +++++++--
 .../main/java/com/cloud/vm/UserVmManagerImpl.java  |  1 +
 systemvm/debian/opt/cloud/bin/configure.py         |  4 ---
 systemvm/debian/opt/cloud/bin/cs/CsRedundant.py    |  2 +-
 systemvm/debian/opt/cloud/bin/cs/__init__.py       |  9 ++++++
 systemvm/debian/opt/cloud/bin/setup/bootstrap.sh   |  3 ++
 systemvm/debian/opt/cloud/bin/update_config.py     |  2 --
 .../test_multiple_subnets_in_isolated_network.py   | 34 ++++++++++++++++++++++
 ...est_multiple_subnets_in_isolated_network_rvr.py | 34 ++++++++++++++++++++++
 .../component/test_multiple_subnets_in_vpc.py      | 33 +++++++++++++++++++++
 .../component/test_multiple_subnets_in_vpc_rvr.py  | 33 +++++++++++++++++++++
 ui/scripts/sharedFunctions.js                      |  3 +-
 24 files changed, 253 insertions(+), 28 deletions(-)


[cloudstack] 01/01: Fix for the issue of recover VM not able to attach the data disks which are there before destroy in case of VMware

Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

harikrishna pushed a commit to branch RecoverVMBug4462
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 426e347a238caa5dcef4fa8f101d426db7526243
Author: Harikrishna Patnala <ha...@gmail.com>
AuthorDate: Mon Nov 23 13:31:58 2020 +0530

    Fix for the issue of recover VM not able to attach the data disks which are there before destroy in case of VMware
---
 .../cloudstack/engine/orchestration/VolumeOrchestrator.java       | 7 +++++++
 server/src/main/java/com/cloud/vm/UserVmManagerImpl.java          | 8 +-------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
index e4cb893..3e86cea 100644
--- a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
+++ b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
@@ -38,6 +38,7 @@ import com.cloud.storage.dao.VMTemplateDetailsDao;
 import com.cloud.utils.StringUtils;
 import com.cloud.vm.SecondaryStorageVmVO;
 import com.cloud.vm.UserVmDetailVO;
+import com.cloud.vm.VMInstanceVO;
 import com.cloud.vm.VmDetailConstants;
 import com.cloud.vm.dao.SecondaryStorageVmDao;
 import com.cloud.vm.dao.UserVmDetailsDao;
@@ -220,6 +221,8 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
     UserVmDetailsDao userVmDetailsDao;
     @Inject
     private SecondaryStorageVmDao secondaryStorageVmDao;
+    @Inject
+    VolumeApiService _volumeApiService;
 
     private final StateMachine2<Volume.State, Volume.Event, Volume> _volStateMachine;
     protected List<StoragePoolAllocator> _storagePoolAllocators;
@@ -1038,6 +1041,10 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
                         if (s_logger.isDebugEnabled()) {
                             s_logger.debug("Detaching " + vol);
                         }
+                        VMInstanceVO vm = _userVmDao.findById(vmId);
+                        if (vm.getHypervisorType().equals(HypervisorType.VMware)) {
+                            _volumeApiService.detachVolumeViaDestroyVM(vmId, vol.getId());
+                        }
                         _volsDao.detachVolume(vol.getId());
                     }
                 }
diff --git a/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java b/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
index 3d447c6..7877d547 100644
--- a/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
@@ -2946,13 +2946,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
 
         stopVirtualMachine(vmId, VmDestroyForcestop.value());
 
-        if (vm.getHypervisorType() == HypervisorType.VMware) {
-            List<VolumeVO> allVolumes = _volsDao.findByInstance(vm.getId());
-            allVolumes.removeIf(vol -> vol.getVolumeType() == Volume.Type.ROOT);
-            detachVolumesFromVm(allVolumes);
-        } else {
-            detachVolumesFromVm(volumesToBeDeleted);
-        }
+        detachVolumesFromVm(volumesToBeDeleted);
 
         UserVm destroyedVm = destroyVm(vmId, expunge);
         if (expunge) {