Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 16. Change resources on virtual machines using director Operator
To change the CPU, RAM, and disk resources of an OpenStackVMSet
custom resource (CR), use the OpenStackControlPlane
CRD.
16.1. Change the CPU or RAM of an OpenStackVMSet
CR
You can use the OpenStackControlPlane
CRD to change the CPU or RAM of an OpenStackVMSet
custom resource (CR).
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
CR
You can use the OpenStackControlPlane
CRD to add additional disks to a virtual machine by editing the additionalDisks
property.
Procedure
Add or update the
additionalDisks
parameter in theOpenStackControlPlane
object:spec: ... virtualMachineRoles: Controller: ... additionalDisks: - baseImageVolumeName: openstack-base-img dedicatedIOThread: false diskSize: 10 name: "data-disk1" storageAccessMode: ReadWriteMany storageClass: host-nfs-storageclass storageVolumeMode: Filesystem
Apply the patch:
$ oc patch -n openstack osctlplane overcloud --patch-file controller_add_data_disk1.yaml
Validate 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