VIO Changing allocation ratios
search cancel

VIO Changing allocation ratios

book

Article ID: 339886

calendar_today

Updated On:

Products

VMware VMware Integrated OpenStack

Issue/Introduction

Symptoms:

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.


Environment

VMware Integrated OpenStack 6.x
VMware Integrated Openstack 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-684b7fb449-nz577                                1/1     Running             7          95d
openstack            nova-api-osapi-cb5bcb5b7-knbcl                                    2/2     Running             6          95d


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


[root@nova-api-osapi-cb5bcb5b7-knbcl /]# grep -i allocation_ratio /etc/nova/nova.conf
cpu_allocation_ratio = 10
ram_allocation_ratio = 1.5
[root@nova-api-osapi-cb5bcb5b7-knbcl /]#
 
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 | a3067051-af36-4f37-b088-69a4caaf6dbf | VCPU=3/40,MEMORY_MB=1536/36862,DISK_GB=3/699 |
| 2 | MEMORY_MB=2048,VCPU=1,DISK_GB=20 | bf194dc9-aee1-4526-9ed6-2a48ebb110f7 | VCPU=0/80,MEMORY_MB=0/73725,DISK_GB=0/699 |
+---+----------------------------------+--------------------------------------+----------------------------------------------+

[root@vioadmin1-vioshim-6dbdb59f56-mq7lb /]# openstack resource provider list
+--------------------------------------+-------------------------------------------------+------------+
| uuid | name | generation |
+--------------------------------------+-------------------------------------------------+------------+
| bf194dc9-aee1-4526-9ed6-2a48ebb110f7 | domain-c20.4b5b07bd-3fb5-4f03-a7d5-a38280f3cc3b | 6 |
| a3067051-af36-4f37-b088-69a4caaf6dbf | domain-c8.5e82ed7a-604f-4f1b-91de-0997fe708fff | 14 |

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

[root@
vioadmin1-vioshim-6dbdb59f56-mq7lb /]# openstack resource provider inventory list a3067051-af36-4f37-b088-69a4caaf6dbf
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 |
+----------------+------------------+----------+----------+-----------+----------+-------+