Chapter 16. Change resources on virtual machines using director Operator
To change the CPU, RAM, and disk resources of a OpenStackVMSet use the OpenStackControlPlane.
16.1. Change the CPU or RAM of an OpenStackVMSet Copy linkLink copied to clipboard!
You can use the OpenStackControlPlane to change the CPU or RAM of an OpenStackVMSet.
Procedure
Change the number of Controller virtualMachineRole cores to 8:
$ oc patch -n openstack osctlplane overcloud --type='json' -p='[{"op": "add", "path": "/spec/virtualMachineRoles/controller/cores", "value": 8 }]'Change the Controller virtualMachineRole RAM size to 22GB:
$ oc patch -n openstack osctlplane overcloud --type='json' -p='[{"op": "add", "path": "/spec/virtualMachineRoles/controller/memory", "value": 22 }]'Validate the virtualMachineRole resource:
$ oc get osvmset NAME CORES RAM DESIRED READY STATUS REASON controller 8 22 1 1 Provisioned All requested VirtualMachines have been provisioned- From inside the virtual machine do a graceful shutdown. Shutdown each updated virtual machine one by one.
Power on the virtual machine:
$ `virtctl start <VM>` to power on the virtual machine.-
Replace
<VM>with the name of your virtual machine.
-
Replace
16.2. Add additional disks to an OpenStackVMSet Copy linkLink copied to clipboard!
You can use the OpenStackControlPlane to add additional disks to a virtual machine by editing the additionalDisks property.
Procedure
Add or update the
additionalDisksparameter in the OpenStackControlPlane object:spec: ... virtualMachineRoles: Controller: ... additionalDisks: - baseImageVolumeName: openstack-base-img dedicatedIOThread: false diskSize: 10 name: "data-disk1" storageAccessMode: ReadWriteMany storageClass: host-nfs-storageclass storageVolumeMode: FilesystemApply the patch:
$ oc patch -n openstack osctlplane overcloud --patch-file controller_add_data_disk1.yamlValidate the virtualMachineRole resource:
$ oc get osvmset controller -o json | jq .spec.additionalDisks [ { "baseImageVolumeName": "openstack-base-img", "dedicatedIOThread": false, "diskSize": 10, "name": "data-disk1", "storageAccessMode": "ReadWriteMany", "storageClass": "host-nfs-storageclass", "storageVolumeMode": "Filesystem" } ]- From inside the virtual machine do a graceful shutdown. Shutdown each updated virtual machine one by one.
Power on the virtual machine:
$ `virtctl start <VM>` to power on the virtual machine.-
Replace
<VM>with the name of your virtual machine.
-
Replace