Changing allocation ratios
search cancel

Changing allocation ratios

book

Article ID: 339886

calendar_today

Updated On:

Products

VMware Integrated OpenStack

Issue/Introduction

OpenStack allows you to overcommit CPU and RAM and DISK on compute nodes. This allows you to increase the number of instances running on your cloud at the cost of reducing the performance of the instances.

Note:

  • You must select the appropriate CPU and RAM and DISK allocation ratio for your particular use case. 
  • Openstack assumes storage is thick provisioned.  There is no way to change this.  

 

Environment

7.x

Resolution

  1. SSH to primary
  2. Run the following command to open up vi and the virtual nova configuration file which is in YAML format. After the change is performed in the nova CR make sure to run the same steps in nova-compute:
viocli update nova
  1. Add a new section header called DEFAULT and add the specific allocation ratio under it.
Note:  Formatting matters so here is what the file will look like with this addition
 
conf:
  nova:
    DEFAULT:
cpu_allocation_ratio: 10
ram_allocation_ratio: 1.5

disk_allocation_ratio: 1.5
    neutron:
      metadata_proxy_shared_secret: .Secret:managedencryptedpasswords:data.metadata_proxy_shared_secret
    vmware:
      passthrough: true
      tenant_vdc: true
  1. Save the file.
Note:  Saving the file will trigger LCM to update the nova services.  You can observe by tailing the tiller log (kubectl -n kube-system logs -f -lapp=helm) and running pods to watch the destruction of the old pods and creation of the updated pods.  The changes should be applied in less than a few minutes.
  1. Run the following to check deployment is in running status.
viocli get deployment

root@oms [ ~ ]# viocli get deployment
PUBLIC VIP      PRIVATE VIP       HIGH AVAILABILITY
...
OpenStack Deployment State: RUNNING
  1. Once the changes have been applied we can view them by exec-ing into the nova-api-osapi* pod and checking /etc/nova/nova.conf.
pods | grep -i nova-api
root@oms [ ~ ]# pods | grep -i nova-api
openstack            nova-api-metadata-######                                1/1     Running             7          95d
openstack            nova-api-osapi-#####                                    2/2     Running             6          95d


root@oms [ ~ ]# osctl exec -it nova-api-osapi-##### /bin/bash
Defaulting container name to nova-osapi.
Use 'kubectl describe pod/nova-api-osapi-##### -n openstack' to see all of the containers in this pod.
[root@nova-api-osapi-##### /]#


[root@nova-api-osapi-##### /]# grep -i allocation_ratio /etc/nova/nova.conf
cpu_allocation_ratio = 10
ram_allocation_ratio = 1.5
[root@nova-api-osapi-##### /]#
 
Note:  If the changes aren’t applied, check the status of the osdeployment pod. If it is in init state for more than 15 or so seconds it may need to be destroyed manually (ie osdel po osdeployment-osdeployment1).



Additional Information

The default allocation ratios are as follows.
cpu_allocation_ratio = 10
ram_allocation_ratio = 1.5
disk_allocation_ratio = 1

openstack allocation candidate list --os-placement-api-version 1.10 --resource VCPU=1 --resource MEMORY_MB=2048 --resource DISK_GB=20
+---+----------------------------------+--------------------------------------+----------------------------------------------+
| # | allocation | resource provider | inventory used/capacity |
+---+----------------------------------+--------------------------------------+----------------------------------------------+
| 1 | VCPU=1,MEMORY_MB=2048,DISK_GB=20 | ########-####-####-####-############ | VCPU=3/40,MEMORY_MB=1536/36862,DISK_GB=3/699 |
+---+----------------------------------+--------------------------------------+----------------------------------------------+

[root@vioadmin1-vioshim-6dbdb59f56-mq7lb /]# openstack resource provider list
+--------------------------------------+-------------------------------------------------+------------+
| uuid | name | generation |
+--------------------------------------+-------------------------------------------------+------------+
| ########-####-####-####-############ | domain-c20.########-####-####-####-############ | 6

+--------------------------------------+-------------------------------------------------+------------+

[root@
vioadmin1-vioshim-6dbdb59f56-mq7lb /]# openstack resource provider inventory list ########-####-####-####-############
Password:
+----------------+------------------+----------+----------+-----------+----------+-------+
| resource_class | allocation_ratio | max_unit | reserved | step_size | min_unit | total |
+----------------+------------------+----------+----------+-----------+----------+-------+
| VCPU           |             10.0 |        8 |        0 |         1 |        1 |    16 |
| MEMORY_MB      |              1.5 |    20479 |        0 |         1 |        1 | 40958 |
| DISK_GB        |              1.0 |      670 |        0 |         1 |        1 |  1199 |
+----------------+------------------+----------+----------+-----------+----------+-------+