borisstoyanov opened a new issue #3290: KVM: if a volume is detached before OS has boot and migrated, admin not able to attach back URL: https://github.com/apache/cloudstack/issues/3290 <!-- Verify first that your issue/request is not already reported on GitHub. Also test if the latest release and master branch are affected too. Always add information AFTER of these HTML comments, but no need to delete the comments. --> ##### ISSUE TYPE <!-- Pick one below and delete the rest --> * Bug Report ##### COMPONENT NAME <!-- Categorize the issue, e.g. API, VR, VPN, UI, etc. --> ~~~ Volumes, VM deployment ~~~ ##### CLOUDSTACK VERSION <!-- New line separated list of affected versions, commit ID for issues on master branch. --> ~~~ 4.11 ~~~ ##### CONFIGURATION <!-- Information about the configuration if relevant, e.g. basic network, advanced networking, etc. N/A otherwise --> ##### OS / ENVIRONMENT <!-- Information about the environment if relevant, N/A otherwise --> Observed with KVM. ##### SUMMARY <!-- Explain the problem/feature briefly --> When a user creates a VM without starting it, and then start and detach the volume before the guest OS has booted, post migration the volume cannot be attached back. ##### STEPS TO REPRODUCE <!-- For bugs, show exactly how to reproduce the problem, using a minimal test-case. Use Screenshots if accurate. For new features, show how the feature would be used. --> <!-- Paste example playbooks or commands between quotes below --> ~~~ 1. Create a VM with a data disk without starting it 2. Start the VM 3. Before the VM has booted, detach the disk 4. Migrate the data disk to another storage pool 5. Try to attach back the volume to the same VM ~~~ <!-- You can also paste gist.github.com links for larger files --> ##### EXPECTED RESULTS <!-- What did you expect to happen when running the steps above? --> ~~~ Volume being attached ~~~ ##### ACTUAL RESULTS <!-- What actually happened? --> <!-- Paste verbatim command output between quotes below --> ~~~ Failed to attach volume test to VM VM-827b8faf-4ed6-414b-9c4f-29c7dcefd06c; org.libvirt.LibvirtException: XML error: target 'vdb' duplicated for disk sources '/mnt/610e0939-6665-311d-9401-bdcd354a275c/96912f59-95a5-458b-81c2-3e91c0687799' and '/mnt/610e0939-6665-311d-9401-bdcd354a275c/21d022d9-a2ba-4db0-acb4-e8f3044239c0' ~~~ It seems that the old record is not properly cleaned up when the volume is detached, and post migration we got a new path which creates a conflict and cloudstack is not able to attach the volume. Workaround: This could be escaped if the user waits enough for the Guest OS to boot. After that detaching seems to be cleaning properly the records. Another way if the VM is already messed is to Stop and Start the VM, after that user is able to attach 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
