<div dir="ltr">Thanks, for the heads up. Added a issue for 4.6 to look at this<div><br></div><div><a href="http://dev.opennebula.org/issues/2658">http://dev.opennebula.org/issues/2658</a><br></div><div><br></div><div>Cheers</div>
<div><br></div><div>Ruben</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jan 13, 2014 at 5:28 PM, Gareth Bult <span dir="ltr"><<a href="mailto:gareth@linux.co.uk" target="_blank">gareth@linux.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:12pt;font-family:trebuchet ms,sans-serif"><div>Ok, sounds good .. could I also draw your attention to the "deploy" script, which is the other<br>
</div><div>script I need to modify .. my version looks like this;</div><div><p><span style="font-family:'courier new',courier,monaco,monospace,sans-serif">--</span></p><p><span style="font-family:'courier new',courier,monaco,monospace,sans-serif">mkdir -p `dirname $domain`</span><br>
<span style="font-family:'courier new',courier,monaco,monospace,sans-serif">cat > $domain</span><br><span style="font-family:'courier new',courier,monaco,monospace,sans-serif"></span><span style="font-family:'courier new',courier,monaco,monospace,sans-serif"></span></p>
<p><span style="font-family:'courier new',courier,monaco,monospace,sans-serif">logger "DEPLOY :: /var/lib/one/remotes/hooks/vdc/deploy.py $domain"</span><br><span style="font-family:'courier new',courier,monaco,monospace,sans-serif">/var/lib/one/remotes/hooks/vdc/deploy.py $domain</span></p>
<p><span style="font-family:'courier new',courier,monaco,monospace,sans-serif">data=`virsh --connect $LIBVIRT_URI create $domain`</span></p><p><span style="font-family:'courier new',courier,monaco,monospace,sans-serif">--</span></p>
<p>Deploy does three relatively critical things you may wish to consider;</p><p>a. adds the "sharable" flag to the libvirt config - without this libvirt won't live migrate (on the latest versions of libvirt)<br>
b. adds "error_policy=stop" to ensure the VM pauses in the case of an IO error, which lets you fix the IO issue, then unpause it<br>c. adds "discard=unmap", which you need in order for KVM to support TRIM requests properly<br>
(we use TRIM to allow a VM to pass references to unused space to the back-end storage so it can be released back to the OS)</p><p>If it's of any use, you're more than welcome to use my deploy.py script .. for what it does it seems fairly concise .. :)</p>
<p><span style="font-family:'courier new',courier,monaco,monospace,sans-serif">#!/usr/bin/python</span></p><p><span style="font-family:'courier new',courier,monaco,monospace,sans-serif">import xml.etree.ElementTree as ET</span><br>
<span style="font-family:'courier new',courier,monaco,monospace,sans-serif">from sys import argv</span></p><p><span style="font-family:'courier new',courier,monaco,monospace,sans-serif">original = ET.parse(argv[1])</span><br>
<span style="font-family:'courier new',courier,monaco,monospace,sans-serif">params = original.findall(".//disk")</span><br><span style="font-family:'courier new',courier,monaco,monospace,sans-serif">for p in params:</span><br>
<span style="font-family:'courier new',courier,monaco,monospace,sans-serif"> if p.get('device') == 'disk': p.insert(0,ET.Element("shareable",{}))</span></p><p><span style="font-family:'courier new',courier,monaco,monospace,sans-serif">params = original.findall(".//driver")</span><br>
<span style="font-family:'courier new',courier,monaco,monospace,sans-serif">for p in params:</span><br><span style="font-family:'courier new',courier,monaco,monospace,sans-serif"> if p.get('type') == 'raw':</span><br>
<span style="font-family:'courier new',courier,monaco,monospace,sans-serif"> p.set("error_policy","stop")</span><br><span style="font-family:'courier new',courier,monaco,monospace,sans-serif"> p.set("discard","unmap")</span></p>
<p><span style="font-family:'courier new',courier,monaco,monospace,sans-serif">original.write(argv[1])</span></p><p>Regards,<br>Gareth.</p><p><br></p></div><div><span name="x"></span><div><div><span size="2" style="font-size:small">--</span></div>
<div><table><tbody><tr><td><img></td><td><div><b style="font-family:verdana,Helvetica,sans-serif;font-size:11px;line-height:14px">Gareth Bult</b><br><span color="#666666" style="color:#666666"><span face="verdana, Helvetica, sans-serif" style="font-family:verdana,Helvetica,sans-serif"><span style="font-size:11px;line-height:14px">“The odds of hitting your target go up dramatically when you aim at it.”</span></span></span><span color="#666666" style="color:#666666"><br>
</span><span color="#666666" style="color:#666666"><span style="color:#666666;font-family:verdana,Helvetica,sans-serif;font-size:11px;line-height:14px">See the status of my current project at <a href="http://vdc-store.com" target="_blank">http://vdc-store.com</a></span></span></div>
<div><span color="#666666" style="color:#666666"><span face="verdana, Helvetica, sans-serif" style="font-family:verdana,Helvetica,sans-serif"><span style="font-size:11px;line-height:14px"><br></span></span></span></div></td>
</tr></tbody></table></div></div><span name="x"></span><br></div><hr><div style="font-size:12pt;font-style:normal;font-family:Helvetica,Arial,sans-serif;text-decoration:none;font-weight:normal"><b>From: </b>"Ruben S. Montero" <<a href="mailto:rsmontero@opennebula.org" target="_blank">rsmontero@opennebula.org</a>><br>
<b>To: </b>"Gareth Bult" <<a href="mailto:gareth@linux.co.uk" target="_blank">gareth@linux.co.uk</a>><br><b>Cc: </b><a href="mailto:dev@lists.opennebula.org" target="_blank">dev@lists.opennebula.org</a><br>
<b>Sent: </b>Monday, 13 January, 2014 3:41:50 PM<br><b>Subject: </b>Re: [one-dev] Live migration / recovery<br><div><br></div><div dir="ltr">Totally agree, in fact we've seen this in the past.<div><br></div><div>This is fairly easy to add, one_vmm_exec.rb includes a pseudo-dsl to specify the actions, each action includes a fail action. Looking at the code we have also to roll-back the networking configuration on the target host.</div>
<div><br></div><div>Added a new issue for this. In the meantime we can just use the previous workaround.</div><div><br></div><div><a href="http://dev.opennebula.org/issues/2633" target="_blank">http://dev.opennebula.org/issues/2633</a><br>
</div><div><br></div></div><div class="gmail_extra"><br><div><br></div><div class="gmail_quote">On Mon, Jan 13, 2014 at 2:59 PM, Gareth Bult <span dir="ltr"><<a href="mailto:gareth@linux.co.uk" target="_blank">gareth@linux.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:12pt;font-family:trebuchet ms,sans-serif"><div>Ok, this almost seems too easy ... :)<br></div>
<div><br></div><div>What I was trying to avoid was more tweaking of ON files when installing VDC.</div><div><br></div><div>The issue I see is that each time someone upgraded ON, they will potentially have a chain of</div>
<div>small patches to apply ... if I supply a few small patches based on "if <vdc installed> - do something extra"</div><div>would you include these in the stock scripts??</div><div><br></div><div>Gareth.</div>
<div><br></div><div><span></span><div><div><span style="font-size:small">--</span></div><div><table><tbody><tr><td><img></td><td><div><b style="font-family:verdana,Helvetica,sans-serif;font-size:11px;line-height:14px">Gareth Bult</b><br>
<span style="color:#666666"><span style="font-family:verdana,Helvetica,sans-serif"><span style="font-size:11px;line-height:14px">“The odds of hitting your target go up dramatically when you aim at it.”</span></span></span><span style="color:#666666"><br>
</span><span style="color:#666666"><span style="color:#666666;font-family:verdana,Helvetica,sans-serif;font-size:11px;line-height:14px">See the status of my current project at <a href="http://vdc-store.com" target="_blank">http://vdc-store.com</a></span></span></div>
<div><span style="color:#666666"><span style="font-family:verdana,Helvetica,sans-serif"><span style="font-size:11px;line-height:14px"><br></span></span></span></div></td>
</tr></tbody></table></div></div><span></span><br></div><hr><div style="font-size:12pt;font-style:normal;font-family:Helvetica,Arial,sans-serif;text-decoration:none;font-weight:normal"><b>From: </b>"Ruben S. Montero" <<a href="mailto:rsmontero@opennebula.org" target="_blank">rsmontero@opennebula.org</a>><br>
<b>To: </b>"Gareth Bult" <<a href="mailto:gareth@linux.co.uk" target="_blank">gareth@linux.co.uk</a>><br><b>Cc: </b><a href="mailto:dev@lists.opennebula.org" target="_blank">dev@lists.opennebula.org</a><br>
<b>Sent: </b>Sunday, 12 January, 2014 10:36:30 PM<br><b>Subject: </b>Re: [one-dev] Live migration / recovery<br><div><br></div><div dir="ltr">Hi Gareth<div><br></div><div>As the migrate script can be easily updated we do not provide any hook for that. I'd go to kvm/migrate, and do a simple if [ $? ... after the virsh command to kill the cache on the target host.</div>
<div><br></div><div>Cheers</div><div><br></div><div>Ruben </div><div class="gmail_extra"><br><div><br></div><div class="gmail_quote">On Thu, Dec 19, 2013 at 12:54 PM, Gareth Bult <span dir="ltr"><<a href="mailto:gareth@linux.co.uk" target="_blank">gareth@linux.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:12pt;font-family:trebuchet ms,sans-serif"><div>Hi,</div><div><br></div><div>I implemented live migration for the VDC driver a few weeks back and on the whole it seems to work</div>
<div>quite well. The "premigrate" script creates a cache instance on the target server and puts the source</div><div>cache into proxy mode, then the "postmigrate" script kills the original cache instance.</div>
<div><br></div><div>Problem :: if the migration fails, I'm left with a running cache on both the source and target servers, with</div><div>the source cache in proxy mode. I have a 1-line CLI command to revert the issue, but I need to hook into</div>
<div>the system in order to call it. </div><div><br></div><div><span style="font-size:12pt">How to do I </span><span style="font-size:12pt">do this, I guess effectively I need something like "postmigrate_fail" .. ???</span></div>
<div><br></div><div>tia</div><div>Gareth.</div><div><br></div><div><span></span><div><div><span style="font-size:small">--</span></div><div><span><span style="color:#888888"></span></span><table>
<tbody><tr><td><img></td><td><b style="font-family:verdana,Helvetica,sans-serif;font-size:11px;line-height:14px">Gareth Bult</b><br><span style="color:#666666"><span style="font-family:verdana,Helvetica,sans-serif"><span style="font-size:11px;line-height:14px">“The odds of hitting your target go up dramatically when you aim at it.”</span></span></span><span style="color:#666666"><br>
</span><span style="color:#666666"><br></span><span style="color:#666666"><br></span></td></tr></tbody></table></div></div><span></span><br></div></div></div><br>_______________________________________________<br>
Dev mailing list<br>
<a href="mailto:Dev@lists.opennebula.org" target="_blank">Dev@lists.opennebula.org</a><br>
<a href="http://lists.opennebula.org/listinfo.cgi/dev-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/dev-opennebula.org<span><span color="#888888" style="color:#888888"><br clear="all"><div><br>
</div>-- <br>
</span></span></a><span><span color="#888888" style="color:#888888"><div dir="ltr"><a href="http://lists.opennebula.org/listinfo.cgi/dev-opennebula.org" target="_blank"><div>
<div>-- <br></div></div>Ruben S. Montero, PhD<br>Project co-Lead and Chief Architect</a><div><a href="http://lists.opennebula.org/listinfo.cgi/dev-opennebula.org" target="_blank">OpenNebula - Flexible Enterprise Cloud Made Simple<br>
</a><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:rsmontero@opennebula.org" target="_blank">rsmontero@opennebula.org</a> | @OpenNebula</div></div>
</span></span></blockquote></div></div></div>
</div><div><br></div></div></div></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div><div>-- <br></div></div>Ruben S. Montero, PhD<br>Project co-Lead and Chief Architect<div>
OpenNebula - Flexible Enterprise Cloud Made Simple<br>
<a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:rsmontero@opennebula.org" target="_blank">rsmontero@opennebula.org</a> | @OpenNebula</div></div>
</font></span></div>
</div><div><br></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div><div>-- <br></div></div>Ruben S. Montero, PhD<br>Project co-Lead and Chief Architect<div>OpenNebula - Flexible Enterprise Cloud Made Simple<br>
<a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:rsmontero@opennebula.org" target="_blank">rsmontero@opennebula.org</a> | @OpenNebula</div></div>
</div>