Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACS tries to delete a root disk in zone wide primary storage #3340

Closed
PaulAngus opened this issue May 20, 2019 · 5 comments
Closed

ACS tries to delete a root disk in zone wide primary storage #3340

PaulAngus opened this issue May 20, 2019 · 5 comments

Comments

@PaulAngus
Copy link
Member

ISSUE TYPE
  • Bug Report
COMPONENT NAME
vSphere - Zone wide storage
CLOUDSTACK VERSION
4.9, 4.11, 4.12, master
CONFIGURATION

vSphere with zone-wide storage

OS / ENVIRONMENT

N/A

SUMMARY

Transferred from Jira :
https://issues.apache.org/jira/browse/CLOUDSTACK-9991

A VM is running and the disk is migrated from cluster to zone wide primary storage. The root disk for that VM is now seen in all clusters and ACS tries to delete it. This fails, fortunately but only because it is in use. ACS should not try to delete the disk.

STEPS TO REPRODUCE


EXPECTED RESULTS
Migrate the root disk of a running VM from cluster-wide to zone wide storage.
ACTUAL RESULTS

message seen:
Cannot delete file [Perf06_ix_stor_003] i-93-8549-VM/ROOT-8549-delta.vmdk

It looks like this message
private void deleteUnregisteredVmFiles(VirtualMachineFileLayoutEx vmFileLayout, DatacenterMO dcMo, boolean deleteDisks) throws Exception { s_logger.debug("Deleting files associated with an existing VM that was unregistered");

from here:

private void deleteUnregisteredVmFiles(VirtualMachineFileLayoutEx vmFileLayout, DatacenterMO dcMo, boolean deleteDisks) throws Exception {
s_logger.debug("Deleting files associated with an existing VM that was unregistered");

because the start is reading this:

// Since VM was successfully powered-on, if there was an existing VM in a different cluster that was unregistered, delete all the files associated with it.
if (existingVmName != null && existingVmFileLayout != null) {
deleteUnregisteredVmFiles(existingVmFileLayout, dcMo, true);
}

// Since VM was successfully powered-on, if there was an existing VM in a different cluster that was unregistered, delete all the files associated with it.
if (existingVmName != null && existingVmFileLayout != null)

{ deleteUnregisteredVmFiles(existingVmFileLayout, dcMo, true); }


@shwstppr
Copy link
Contributor

shwstppr commented Jul 5, 2019

Code on master checks for files on zone-wide datastores. This should cover the case mentioned, https://github.com/apache/cloudstack/blob/master/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java#L2277-L2283
Need to test this with master
@PaulAngus @rhtyd

@rohityadavcloud
Copy link
Member

cc @borisstoyanov

@borisstoyanov
Copy link
Contributor

having a look

@borisstoyanov
Copy link
Contributor

Cannot reproduce this, I'm running 2 storage pools (cluster and zone scoped) when migrating the volume to the zone one I cannot see in the its logs trying to delete it.

@borisstoyanov
Copy link
Contributor

@PaulAngus is there any time period for this job to kick in, since I've been trying to do this on 4.11.3 4.9.3 and master and could not reproduce, I've replicated the exact storage circumstances and simply could not see such message in the logs. Env are running with root volume on zonewide storage pool for more than hour?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants