As a potential workaround, the cloud operator can update the resource provider inventory database entries for allocation ratios like this:
# list each hypervisor and it's provider uuid
openstack resource provider list
# show current totals and allocation ratios for the given provider
openstack resource provider inventory list <provider uuid>
# update the allocation_ratio for VCPU, MEMORY_MB, or DISK_GB "class" for a given provider
openstack resource provider inventory class set --allocation_ratio $NEW_RATIO --total $CURRENT_TOTAL --max_unit $CURRENT_TOTAL <provider uuid> $CLASS
Unfortunately, --total must be updated while changing allocation_ratio for any class.
If you wanted to change RAM allocation_ratio across all hypervisors, for instance, you might use a loop such as:
new_ratio=0.9
resource_class=MEMORY_MB
reserved_size=512
for prov_uuid in $(openstack resource provider list -f value -c uuid); do
current_total=$(openstack resource provider inventory show -f value -c total $prov_uuid $resource_class)
openstack resource provider inventory class set --allocation_ratio $new_ratio --total $current_total --max_unit $current_total --reserved $reserved_size $prov_uuid $resource_class
done
This blueprint seems to suggest this may be reverted periodically, so use this workaround wisely and with caution.
As a potential workaround, the cloud operator can update the resource provider inventory database entries for allocation ratios like this:
# list each hypervisor and it's provider uuid
openstack resource provider list
# show current totals and allocation ratios for the given provider
openstack resource provider inventory list <provider uuid>
# update the allocation_ratio for VCPU, MEMORY_MB, or DISK_GB "class" for a given provider
openstack resource provider inventory class set --allocation_ratio $NEW_RATIO --total $CURRENT_TOTAL --max_unit $CURRENT_TOTAL <provider uuid> $CLASS
Unfortunately, --total must be updated while changing allocation_ratio for any class.
If you wanted to change RAM allocation_ratio across all hypervisors, for instance, you might use a loop such as:
new_ratio=0.9 class=MEMORY_ MB total=$ (openstack resource provider inventory show -f value -c total $prov_uuid $resource_class)
resource_
reserved_size=512
for prov_uuid in $(openstack resource provider list -f value -c uuid); do
current_
openstack resource provider inventory class set --allocation_ratio $new_ratio --total $current_total --max_unit $current_total --reserved $reserved_size $prov_uuid $resource_class
done
This blueprint seems to suggest this may be reverted periodically, so use this workaround wisely and with caution.
https:/ /specs. openstack. org/openstack/ nova-specs/ specs/stein/ implemented/ initial- allocation- ratios. html#manually- set-placement- allocation- ratios- are-overwritten