<font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2"><div><div style="font-size: small;">Hi everyone,</div><div style="font-size: small;"><br></div><div style="font-size: small;">In my current pre-production deployment we were looking for a method to live extend attached volumes to an instance. This was one of the requirements for deployment. I've worked with libvirt hypervisors before so it didn't take long to find a workable solution. However I'm not sure how transferable this will be across deployment models. Our deployment model is using libvirt for nova and ceph for backend storage. This means obviously libvirt is using rdb to connect to volumes.<br><br>Currently the method I use is:</div><div style="font-size: small;"><br></div><div style="font-size: small;">- Force cinder to run an extend operation.</div><div style="font-size: small;"><span style="font-size: 14.3999996185303px;">- Tell Libvirt that the attached disk has been extended.</span></div><div style="font-size: small;"><br></div><div style="font-size: small;">It would be worth discussing if this can be ported to upstream such that the API can handle the leg work, rather than this current manual method.</div><div style="font-size: small;"><br></div><div style="font-size: small;">Detailed instructions.</div><div style="font-size: small;">You will need: volume-id of volume you want to resize, hypervisor_hostname and instance_name from instance volume is attached to.</div><div style="font-size: small;"><br></div><div style="font-size: small;">Example: extending volume f9fa66ab-b29a-40f6-b4f4-e9c64a155738 attached to instance-00000012 on node-6 to 100GB</div><div style="font-size: small;"><br></div><div style="font-size: small;">$ cinder reset-state --state available <span style="font-size: 14.3999996185303px;">f9fa66ab-b29a-40f6-b4f4-e9c64a155738</span></div><div style="font-size: small;">$ cinder extend <span style="font-size: 14.3999996185303px;">f9fa66ab-b29a-40f6-b4f4-e9c64a155738 100</span></div><div style="font-size: small;"><span style="font-size: 14.3999996185303px;">$ cinder reset-state --state in-use </span><span style="font-size: 14.3999996185303px;">f9fa66ab-b29a-40f6-b4f4-e9c64a155738</span></div><div style="font-size: small;"><span style="font-size: 14.3999996185303px;"><br></span></div><div style="font-size: small;"><span style="font-size: 14.3999996185303px;">$ssh node-6</span></div><div style="font-size: small;">node-6$ virsh qemu-monitor-command instance-00000012 --hmp "info block" | grep f9fa66ab-b29a-40f6-b4f4-e9c64a155738</div><div style="font-family: 'Sans Serif', Verdana, Arial, Helvetica, sans-serif; font-size: small;"><font face="Verdana, Arial, Helvetica, sans-serif">drive-virtio-disk1: removable=0 io-status=ok file=rbd:volumes-slow/volume-f9fa66ab-b29a-40f6-b4f4-e9c64a155738:id=cinder:key=<keyhere>==:auth_supported=cephx\\;none:mon_host=10.1.226.64\\:6789\\;10.1.226.65\\:6789\\;10.1.226.66\\:6789 ro=0 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0</font></div><div style="font-family: 'Sans Serif', Verdana, Arial, Helvetica, sans-serif; font-size: small;"><font face="Verdana, Arial, Helvetica, sans-serif"><br></font></div><div style="font-family: 'Sans Serif', Verdana, Arial, Helvetica, sans-serif; font-size: small;"><font face="Verdana, Arial, Helvetica, sans-serif">This will get you the disk-id, which in this case is drive-virtio-disk1.</font></div><div style="font-family: 'Sans Serif', Verdana, Arial, Helvetica, sans-serif; font-size: small;"><font face="Verdana, Arial, Helvetica, sans-serif"><br></font></div><div style="font-family: 'Sans Serif', Verdana, Arial, Helvetica, sans-serif; font-size: small;"><font face="Verdana, Arial, Helvetica, sans-serif">node-6$ virsh qemu-monitor-command instance-00000012 --hmp "block_resize drive-virtio-disk1 100G"</font></div><div style="font-family: 'Sans Serif', Verdana, Arial, Helvetica, sans-serif; font-size: small;"><font face="Verdana, Arial, Helvetica, sans-serif"><br></font></div><div style="font-family: 'Sans Serif', Verdana, Arial, Helvetica, sans-serif; font-size: small;"><font face="Verdana, Arial, Helvetica, sans-serif">Finally, you need to perform a drive rescan on the actual instance and resize and extend the file-system. This will be OS specific.</font></div><div style="font-family: 'Sans Serif', Verdana, Arial, Helvetica, sans-serif; font-size: small;"><br></div><div style="font-family: 'Sans Serif', Verdana, Arial, Helvetica, sans-serif; font-size: small;">I've tested this a few times and it seems very reliable.</div></div><div><br></div><div><br><font size="2" face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif"><font size="2" face="Arial,Default Sans Serif,Verdana,Arial,Helvetica,sans-serif"><strong><font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif"><font color="#000099">Taylor Bertie<br></font></font>Enterprise Support Infrastructure Engineer<br><br></strong><font color="#4f4f4f" size="2" face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif">Mobile +64 27 952 3949</font><br><font color="#4f4f4f" size="2" face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif">Phone +64 4 462 5030</font><br><font color="#4f4f4f" size="2" face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif">Email <a href="mailto:taylor.bertie@solnet.co.nz" target="blank">taylor.bertie@solnet.co.nz</a></font><br><br><font color="#4f4f4f" size="2" face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif"><strong>Solnet Solutions Limited</strong></font><font color="#4f4f4f" size="2" face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif"><br>Level 12, Solnet House</font><br><font color="#4f4f4f" size="2" face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif">70 The Terrace, Wellington 6011<br>PO Box 397, Wellington 6140</font><br><br><a href="http://www.solnet.co.nz/" target="_blank"><font color="#000099" size="2" face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif"><strong>www.solnet.co.nz</strong></font></a><font color="#999999" size="2" face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif"> </font></font></font></div></font>Attention:
This email may contain information intended for the sole use of
the original recipient. Please respect this when sharing or
disclosing this email's contents with any third party. If you
believe you have received this email in error, please delete it
and notify the sender or postmaster@solnetsolutions.co.nz as
soon as possible. The content of this email does not necessarily
reflect the views of Solnet Solutions Ltd.