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

  1. 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 }]'
  2. 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 }]'
  3. 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
  4. From inside the virtual machine do a graceful shutdown. Shutdown each updated virtual machine one by one.
  5. Power on the virtual machine:

    $ `virtctl start <VM>` to power on the virtual machine.
    • Replace <VM> with the name of your virtual machine.

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

  1. Add or update the additionalDisks parameter 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: Filesystem
  2. Apply the patch:

    $ oc patch -n openstack osctlplane overcloud --patch-file controller_add_data_disk1.yaml
  3. 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"
      }
    ]
  4. From inside the virtual machine do a graceful shutdown. Shutdown each updated virtual machine one by one.
  5. Power on the virtual machine:

    $ `virtctl start <VM>` to power on the virtual machine.
    • Replace <VM> with the name of your virtual machine.