<div>Hi Tony,</div><div> </div><div>I do not have an environment at hand to verify. So I was replying based on what I understood.</div><div>However I dig a little further and found out there is indeed some alignment between nova AZ and cinder AZ.</div><div> </div><div><a href="https://docs.openstack.org/nova/latest/admin/availability-zones.html#resource-affinity">https://docs.openstack.org/nova/latest/admin/availability-zones.html#resource-affinity</a></div><div>More specifically <a href="https://docs.openstack.org/nova/latest/configuration/config.html#cinder.cross_az_attach">https://docs.openstack.org/nova/latest/configuration/config.html#cinder.cross_az_attach</a></div><div> </div><div>And also this helped me a lot in understanding the whole picture : <a href="https://www.mirantis.com/blog/the-first-and-final-word-on-openstack-availability-zones/">https://www.mirantis.com/blog/the-first-and-final-word-on-openstack-availability-zones/</a></div><div> </div><div>Hope it helps.</div><div> </div><div>Thanks,</div><div>Zang, Rui</div><div> </div><div> </div><div>25.02.2020, 16:56, "Tony Pearce" <tony.pearce@cinglevue.com>:</div><blockquote><div>Hi Rui, thank you for the reply. I did find that link previously but I was unable to get it working. Because I am unable to get it working, I tried to use the `cinder_img_volume_type` in the glance image metadata to select a backend (which is also not working - bug:  <a href="https://bugs.launchpad.net/cinder/+bug/1864616">https://bugs.launchpad.net/cinder/+bug/1864616</a>)<div><div><div><div><div><div><p><br />When I try and use the RESKEY:availability_zones in the volume type it does not work for me and what is happening is that the volume type of `__DEFAULT__` is being selected. </p><p>I peformed these steps to test, are these steps correct? </p><p>1. create the 2 cinder backends<br />2. create 2 volume types (one for each backend). <br />3. add the RESKEY:availability_zones extra specs to the volume type, like: <br /> RESKEY:availability_zones="host1" for the first volume type<br />and<br /> RESKEY:availability_zones="host2" for the 2nd volume type<br />4. create 2 host aggrigates with AZ "host1" and "host2" for each host1 / host2 and assign a host to host1<br />5. try to launch an instance and choose the availability zone "host1" from the dropdown</p><p>6. result = instance goes error state<br />volume goes into in-use<br />volume shows "host" as storage@backend and the "backend" is incorrectly chosen<br />In addition to that, the "volume type" selected (which I expected to be host1) is showing as __DEFAUT__ </p><p> </p><p>At this point I am not sure if I am doing something incorrect and this is the reason why it is not working, or, I have correct config and this is a bug experience. </p><p> </p><p>I'd be grateful if you or anyone else that reads this could confirm. </p><p> </p><p>Thanks and regards</p><p> </p><p><strong><span style="color:black;font-family:'arial' , sans-serif;font-size:10pt">Tony Pearce</span></strong><span style="color:black;font-family:'arial' , sans-serif;font-size:9pt">   |  </span><strong><span style="color:#0070c0;font-family:'arial' , sans-serif;font-size:9pt">Senior Network Engineer / Infrastructure Lead</span><br /><span style="color:#0070c0;font-family:'arial' , sans-serif;font-size:10pt"><a href="https://www.cinglevue.com/">Cinglevue International</a></span></strong></p><p> </p><p><span style="color:black;font-family:'arial' , sans-serif;font-size:10pt">Email: </span><span style="font-family:'arial' , sans-serif"><a href="mailto:tony.pearce@cinglevue.com" style="color:rgb( 17 , 85 , 204 );font-size:10pt">tony.pearce@cinglevue.com</a></span><br /><span style="color:black;font-family:'arial' , sans-serif;font-size:10pt">Web: </span><span style="color:#1155cc;font-family:'arial' , sans-serif;font-size:10pt"><a href="http://www.cinglevue.com/">http://www.cinglevue.com</a></span><strong><span style="color:#264278;font-family:'arial' , sans-serif;font-size:9pt"> </span></strong></p><p> </p><p><strong><span style="color:black;font-family:'arial' , sans-serif;font-size:10pt">Australia</span></strong><span style="font-family:'arial' , sans-serif"><font color="#000000"><span style="font-size:10pt"> </span></font></span><br /><span style="color:black;font-family:'arial' , sans-serif;font-size:10pt">1 Walsh Loop, Joondalup, WA 6027 Australia.</span></p><p> </p><p><span style="color:black;font-family:'arial' , sans-serif;font-size:10pt">Direct: </span><span style="color:#1155cc;font-family:'arial' , sans-serif;font-size:10pt">+61 8 6202 0036</span><span style="color:black;font-family:'arial' , sans-serif;font-size:10pt"> | Main: </span><span style="color:#1155cc;font-family:'arial' , sans-serif;font-size:10pt">+61 8 6202 0024</span></p><p><span style="color:black;font-family:'arial' , sans-serif;font-size:10pt">Note: This email and all attachments are the sole property of Cinglevue International Pty Ltd. (or any of its subsidiary entities), and the information contained herein must be considered confidential, unless specified otherwise.   If you are not the intended recipient, you must not use or forward the information contained in these documents.   If you have received this message in error, please delete the email and notify the sender.</span></p><p> </p><p> </p></div></div></div></div></div><br /> </div></div> <div><div>On Tue, 25 Feb 2020 at 10:24, rui zang <<a href="mailto:rui.zang@yandex.com">rui.zang@yandex.com</a>> wrote:</div><blockquote style="border-left-color:rgb( 204 , 204 , 204 );border-left-style:solid;border-left-width:1px;margin:0px 0px 0px 0.8ex;padding-left:1ex"><div>I don't think there is auto-alignment between nova az and cinder az.</div><div>Probably you may want to look at this <a href="https://docs.openstack.org/cinder/rocky/admin/blockstorage-availability-zone-type.html">https://docs.openstack.org/cinder/rocky/admin/blockstorage-availability-zone-type.html</a></div><div>Cinder AZ can be associated with volume types. When you create a VM, you can specify the VM nova az (eg. host1), volume type (cinder az, eg, also host1), thus by aligning nova az and cinder az manually, maybe your goal can be achieved.  I believe there are also other similar configuration ways to make it work like this.</div><div> </div><div>Thanks,<br />Zang, Rui</div><div> </div><div>24.02.2020, 16:53, "Tony Pearce" <<a href="mailto:tony.pearce@cinglevue.com">tony.pearce@cinglevue.com</a>>:</div><blockquote><div><div><div><p style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"> </p><p style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">Apologies in advance if this seems trivial but I am looking for some direction on this and I may have found a bug while testing also.</span></p> <p style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">Some background - I have 2 physical hosts which I am testing with (host1, host2) and I have 2 separate cinder backends (backend1, backend2). Backend1 can only be utilised by host1. Same for backend2 - it can only be utilised by host2. So they are paired together like: host1:backend1 host2:backend2</span></p> <p style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">So I wanted to select a Cinder storage back-end based on nova availability zone and to do this when creating an instance through horizon (not creating a volume directly). Also I wanted to avoid the use of metadata input on each instance create or by using metadata from images (such as cinder_img_volume_type) [2] . Because I can foresee a necessity to then have a number of images which reference each AZ or backend individually. </span></p> <p style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"> </p><ul><li><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">Is it possible to select a backend based on nova AZ? If so, could anyone share any resources to me that could help me understand how to achieve it? </span></li></ul><p> </p><p style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">Because I failed at achieving the above, I then decided to use one way which had worked for me in the past, which was to use the image metadata "cinder_img_volume_type". However I find that this is not working. The “default” volume type is selected (if cinder.conf has it) or if no default, then `__DEFAULT__` is being selected. The link at [2] states that first, a volume type is used based on the volume type selected and if not chosen/set then the 2nd method is "cinder_img_volume_type" from the image metadata and then the 3rd and final is the default from cinder.conf.</span></p><p style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"> </p><p style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">I have tested with fresh deployment using Kayobe as well as RDO’s packstack. </span></p><p style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">Openstack version is <strong>Train</strong></span><br /> </p><p style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">Steps to reproduce:<br />1. Install packstack</span></p><p style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">2. Update cinder.conf with enabled_backends and the [backend]</span></p><p style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">3. Add the volume type to reference the backend (for reference, I call this volume type `number-1`)</span></p><p style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">4. Upload an image and add metadata `cinder_img_volume_type` and the name as mentioned in step 3: number-1</span></p><p style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">5. Try and create an instance using horizon. Source = image and create new volume</span></p><p style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">6. Result = volume type / backend as chosen in the image metadata is not used and instance goes into error status. </span></p> <p style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">After fresh-deploying the RDO Packstack, I enabled debug logs and tested again. In the cinder-api.log I see “"volume_type": null,” and then the next debug log immediately after logged as “Create volume request body:” has “volume_type': None”. </span></p> <p style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">I was searching for a list of the supported image metadata, in case it had changed but the pages seem empty one rocky/stein/train [3] or not yet updated. </span></p> <p style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">Selecting backend based on nova AZ:: </span></p> <p style="line-height:1.38;margin-bottom:0pt;margin-top:0pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">I was searching how to achieve this and I came across this video on the subject of AZs [1]. Although it seems only in the context of creating volumes (not with creating instances with volume from an image, for example). </span></p><p style="line-height:1.38;margin-bottom:12pt;margin-top:12pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">I have tried creating a host aggregate in nova, with AZ name `host1az`. I've also created a backend in Cinder (cinder.conf) with `backend_availability_zone = host1az`. But this does not appear to achieve the desired result, either and the cinder api logs are showing “"availability_zone": null” during the volume create part of the launch instance from Horizon.</span></p><p style="line-height:1.38;margin-bottom:12pt;margin-top:12pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">I also tried setting RESKEY [3] in the volume type, but again similar situation seen; although I dont think this option is the correct context for what I am attempting. </span></p> <p style="line-height:1.38;margin-bottom:12pt;margin-top:12pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">Could anyone please nudge me in the right direction on this? Any pointers appreciated at this point. Thanks in advance.</span></p><p style="line-height:1.38;margin-bottom:12pt;margin-top:12pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">References: </span></p><p style="line-height:1.38;margin-bottom:12pt;margin-top:12pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">[1] </span><a href="https://www.youtube.com/watch?v=a5332_Ew9JA" style="text-decoration:none"><u style="background-color:transparent;font-family:'arial';font-size:11pt;text-decoration:underline;vertical-align:baseline;white-space:pre-wrap">https://www.youtube.com/watch?v=a5332_Ew9JA</u></a></p><p style="line-height:1.38;margin-bottom:12pt;margin-top:12pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">[2] </span><a href="https://docs.openstack.org/cinder/latest/cli/cli-manage-volumes.html" style="text-decoration:none"><u style="background-color:transparent;font-family:'arial';font-size:11pt;text-decoration:underline;vertical-align:baseline;white-space:pre-wrap">https://docs.openstack.org/cinder/latest/cli/cli-manage-volumes.html</u></a><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap"> </span></p><p style="line-height:1.38;margin-bottom:12pt;margin-top:12pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">[3] </span><a href="https://docs.openstack.org/cinder/train/contributor/api/cinder.api.schemas.volume_image_metadata.html" style="text-decoration:none"><u style="background-color:transparent;font-family:'arial';font-size:11pt;text-decoration:underline;vertical-align:baseline;white-space:pre-wrap">https://docs.openstack.org/cinder/train/contributor/api/cinder.api.schemas.volume_image_metadata.html</u></a><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap"> </span></p><p style="line-height:1.38;margin-bottom:12pt;margin-top:12pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">[4] </span><a href="https://docs.openstack.org/cinder/rocky/admin/blockstorage-availability-zone-type.html" style="text-decoration:none"><u style="background-color:transparent;font-family:'arial';font-size:11pt;text-decoration:underline;vertical-align:baseline;white-space:pre-wrap">https://docs.openstack.org/cinder/rocky/admin/blockstorage-availability-zone-type.html</u></a><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap"> </span></p> <p style="line-height:1.38;margin-bottom:12pt;margin-top:12pt"><span style="background-color:transparent;color:#000000;font-family:'arial';font-size:11pt;vertical-align:baseline;white-space:pre-wrap">Regards,</span></p><p style="line-height:1.38;margin-bottom:12pt;margin-top:12pt"><strong style="background-color:transparent;color:#000000;font-family:'arial';font-size:10pt;font-weight:700;vertical-align:baseline;white-space:pre-wrap">Tony Pearce</strong></p><div><div><div><div><div><p> </p></div></div></div></div></div></div></div></div></blockquote></blockquote></div></blockquote>