Hi Hector,
thanks so much for your post. This clarifies a lot!!!
And because you mentioned a manual edit of deployment file:
I recently tried to edit deployment files manually (actually because of another issue) and could not figure out how I should actually do it without having OpenNebula write a new deyployment file and change it back to the original contents (iterations of file deployment.0 deployment.1 .2… after shutting off and on the VM)
I don’t have a system at hand at the moment to try it out again, but may I ask you to confirm that it should work in this order:
First, edit the currently used deployment.X file, then destroy the original one vm:
then recover the failed vm (using which version of recover? --retry?):
onevm recover --????? one-xxx
And BTW do you know where exactely the deployment.X file is coming from?
Obviously it is once generated from information in the onetemplate, oneimage, etc., ok.
Is it then copied into the database? And on every fresh VM start/define it is pulled from the database and depyloyment.X is regenerated from there?
It is definitely never again pulled out of the onetemplate, etc informations again. That’s what I already found out.
Maybe you can shed some light on this as well. I am curious.
I recently tried to edit deployment files manually (actually because of another issue) and could not figure out how I should actually do it without having OpenNebula write a new deyployment file and change it back to the original contents (iterations of file deployment.0 deployment.1 .2… after shutting off and on the VM)
Right… The quick-dirty way I have thought of to achieve a fix without needing manual intervention every time would be to patch the remote/vmm/xen/deploy script and do a sed -i in the deployment file right before the xl create command is called. This would be a way to fix the deployment file every time it is used to create the VMs which does not require the recompile OpenNebula and can be distributed easily (onehost sync --force if I remember well). I haven’t tried it though, it’s just a solution I have in mind.
And BTW do you know where exactely the deployment.X file is coming from?
From XenDriver.cc (deployment_description()) function it seems. If you feel like rolling out your own custom-built OpenNebula, then you can change the relevant line on that file to make all context disks in HVM writeable.
I don’t have a system at hand at the moment to try it out again, but may I ask you to confirm that it should work in this order:
I haven’t used virsh in a long time, and OpenNebula Xen drivers use xl or xm directly. They run xl create path/to/deployment.X but this fails, so the manual fix is editing deployment.X and then running xl create manually. Then onevm recover $id --success for the VM, which then turns from FAILED to RUNNING state correctly.
sorry for the confusion, actually i tried editing deployment files by hand on a kvm system recently! that’s why I mentioned the virsh commands. my experience though was that after the recovery of the vm the settings in the deployment file where changed back to the original state. perhaps I should experiment with this once more and also use the --success option.
thanks for the hint to the xendriver function, i will try to find the similar function in the kvm driver.
I actually did a lot of testing with Xen Hypervisors but then found a way to migrate my customers existing xen vms to kvm with minimal effort and decided to go this way. that’s why i am mixing things up a little here
Hi Anton,
I’ll read your code later today! Thanks!