Hello guys,

I can control my logic that will separating AZ to Cinder for each Department by using 
@Alan Bishop  method, but we need create a new volume and adding metadata as key="RESKEY:availability_zones" and value="az_name"; and key="volume_backend_name" and value="your backend in AZ"

Thanks All for helping.

Nguyen Huu Khoi



On Wed, Jan 4, 2023 at 11:32 PM Nguyễn Hữu Khôi <nguyenhuukhoinw@gmail.com> wrote:
Thanks, I'll check them out. 

On Wed, Jan 4, 2023, 8:51 PM Alan Bishop <abishop@redhat.com> wrote:


On Wed, Jan 4, 2023 at 1:09 AM Sa Pham <saphi070@gmail.com> wrote:
You have to run cinder-volume service for each AZ. And in your configuration of cinder-volume you need to specify storage_availability_zone for that zone. 

Alternatively, you can run a single cinder-volume service with multiple backends, and use the backend_availability_zone option [1] to specify each backend's AZ. The backend_availability_zone overrides the storage_availability_zone for that backend.


Alan


With nova-compute, you have to create a host aggregate with an availability zone option for these compute nodes.



On Wed, Jan 4, 2023 at 3:42 PM Nguyễn Hữu Khôi <nguyenhuukhoinw@gmail.com> wrote:
Ok, thanks for the clarification. :)
Nguyen Huu Khoi


On Wed, Jan 4, 2023 at 3:03 PM Rajat Dhasmana <rdhasman@redhat.com> wrote:


On Wed, Jan 4, 2023 at 1:01 PM Nguyễn Hữu Khôi <nguyenhuukhoinw@gmail.com> wrote:
Thanks for the answer. 
But I cannot find the way to configure the storage backend per AZ, Would you give me some suggestions?

It totally depends on the deployment method you're using. It could be either tripleo, ansible etc and every deployment method should provide a way to set an availability zone for a volume backend. I'm not a deployment expert but a specific deployment team needs to be consulted for the same.
 
Nguyen Huu Khoi


On Wed, Jan 4, 2023 at 1:53 PM Rajat Dhasmana <rdhasman@redhat.com> wrote:
Hi,

From the description, I'm assuming the instances will be boot from volume. In that case, you will need to create a volume type for each backend and you can use 'extra_specs' properties in the volume type to assign a volume type to a particular AZ. In this case, if you're already creating one backend per AZ then a volume type linked to that backend should be good.
Now you will need to create a bootable volume and launch an instance with it. Again, the instance should be launched in the AZ as used in the volume type to support your use case.
Also if you want to restrict volumes of a particular AZ to be attached to the instance of the same AZ, you can use the config option cross_az_attach[1] which will allow/disallow cross AZ attachments.
Hope that helps.


Thanks
Rajat Dhasmana

On Wed, Jan 4, 2023 at 7:31 AM Nguyễn Hữu Khôi <nguyenhuukhoinw@gmail.com> wrote:
Hello guys.
I took time to search for this question but I can't find the answer.

I have an Openstack private cloud and I use an  AZ to a department. 
For example,
AZ-IT for IT department
AZ-Sale for Sale department...

I will prepare 2 storage backends for each AZ.

My goal is that when users launch an instance by choosing AZ then It will use only the backend for this AZ.

Would Openstack support my goal?

Thanks for reading my email.

Nguyen Huu Khoi


--
Sa Pham Dang
Skype: great_bn
Phone/Telegram: 0986.849.582