rohityadavcloud commented on code in PR #7312:
URL: https://github.com/apache/cloudstack/pull/7312#discussion_r1126046897
##########
engine/storage/src/main/java/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java:
##########
@@ -318,6 +319,35 @@ protected EndPoint findEndpointForImageStorage(DataStore
store) {
return RemoteHostEndPoint.getHypervisorHostEndPoint(host);
}
+ protected Host getVmwareHostFromVolumeToDelete(VolumeInfo volume) {
+ VirtualMachine vm = volume.getAttachedVM();
+ if (vm == null) {
Review Comment:
If the volume isn't attached to a VM - would it be removed by GC (if not by
this code) then?
##########
engine/storage/src/main/java/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java:
##########
@@ -318,6 +319,35 @@ protected EndPoint findEndpointForImageStorage(DataStore
store) {
return RemoteHostEndPoint.getHypervisorHostEndPoint(host);
}
+ protected Host getVmwareHostFromVolumeToDelete(VolumeInfo volume) {
+ VirtualMachine vm = volume.getAttachedVM();
+ if (vm == null) {
+ return null;
+ }
+ Long hostId = vm.getHostId() != null ? vm.getHostId() :
vm.getLastHostId();
+ if (hostId == null) {
+ return null;
+ }
+ HostVO host = hostDao.findById(hostId);
Review Comment:
question - should we find host which has access to the storage pool (not
always the vm's host ID or the last host ID?) to be responsible for deleting
the volume?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]