Chapter 6. Configuring Compute service storage Warning The content for this feature is available in this release as a Documentation Preview , and therefore is not fully verified by Red Hat. Use it only for testing, and do not use in a production environment. You create an instance from a base image, which the Compute service (nova) copies from the Image (glance) service, and caches locally on the Compute nodes. This base image contains the instance disk, which is the back end for the instance. You can configure the Compute service to store ephemeral instance disk data locally on the host Compute node or remotely on either an NFS share or Ceph cluster. Alternatively, you can configure the Compute service to store instance disk data in persistent storage in a volume provided by the Block Storage (cinder) service. You can configure image caching for your environment, and configure the performance and security of the instance disks. When the Image service (glance) uses Red Hat Ceph RADOS Block Device (RBD) as the back end and the Compute service (nova) uses local file-based ephemeral storage, then the Compute service can download images directly from the RBD image repository without using the Image service API. Additional resources Configuring persistent storage . Integrating Ceph Storage in Configuring persistent storage . 6.1. Configuring the maximum number of storage devices to attach to one instance By default, you can attach an unlimited number of storage devices to a single instance. Attaching a large number of disk devices to an instance can degrade performance on the instance. You can tune the maximum number of devices that can be attached to an instance based on the boundaries of what your environment can support. The number of storage disks supported by an instance depends on the bus that the disk uses. For example, the IDE disk bus is limited to 4 attached devices. You can attach a maximum of 500 disk devices to instances with machine type Q35. Note Q35 is the default machine type, which uses PCIe ports. You can manage the number of PCIe port devices by adding the [libvirt] parameter num_pcie_ports to the nova-extra-config ConfigMap CR. The number of devices that can attach to a PCIe port is fewer than instances running on versions. If you want to use more devices, you must use the hw_disk_bus=scsi or hw_scsi_model=virtio-scsi image property. For more information, see Metadata properties for virtual hardware . Warning Changing the value of the [compute] parameter max_disk_devices_to_attach in the nova-extra-config ConfigMap CR on a Compute node with active instances can cause rebuilds to fail if the maximum number is lower than the number of devices already attached to instances. For example, if instance A has 26 devices attached and you change max_disk_devices_to_attach to 20, a request to rebuild instance A will fail. During cold migration, the configured maximum number of storage devices is enforced only on the source for the instance that you want to migrate. The destination is not checked before the move. This means that if Compute node A has 26 attached disk devices, and Compute node B has a configured maximum of 20 attached disk devices, a cold migration of an instance with 26 attached devices from Compute node A to Compute node B succeeds. However, a subsequent request to rebuild the instance in Compute node B fails because 26 devices are already attached which exceeds the configured maximum of 20. Note The configured maximum number of storage devices is not enforced on shelved offloaded instances, as they have no Compute node. Prerequisites The oc command line tool is installed on your workstation. You are logged in to Red Hat OpenStack Services on OpenShift (RHOSO) as a user with cluster-admin privileges. You have selected the OpenStackDataPlaneNodeSet CR that defines which nodes you can configure the maximum number of storage devices to attach to one instance. For more information about creating an OpenStackDataPlaneNodeSet CR, see Creating an OpenStackDataPlaneNodeSet CR with pre-provisioned nodes in the Deploying Red Hat OpenStack Services on OpenShift guide. Procedure Create or update the ConfigMap CR named nova-extra-config and set the values of the parameters under [compute]: For more information about creating ConfigMap objects, see Creating and using config maps in Nodes . Create a new OpenStackDataPlaneDeployment CR to configure the services on the data plane nodes and deploy the data plane. Save the CR to a file named compute_storage_devices_deploy.yaml on your workstation: In the compute_storage_devices_deploy.yaml , specify nodeSets to include all the OpenStackDataPlaneNodeSet CRs you want to deploy. Ensure that you include the OpenStackDataPlaneNodeSet CR that you selected as a prerequisite. That OpenStackDataPlaneNodeSet CR defines the nodes that you want to configure the maximum number of storage devices to attach to one instance. Warning You cannot reconfigure a subset of the nodes within a node set. If you need to do this, you must scale the node set down, and create a new node set from the previously removed nodes. Warning If your deployment has more than one node set, changes to the nova-extra-config.yaml ConfigMap might directly affect more than one node set, depending on how the node sets and the DataPlaneServices are configured. To check if a node set uses the nova-extra-config ConfigMap and therefore will be affected by the reconfiguration, complete the following steps: Check the services list of the node set and find the name of the DataPlaneService that points to nova. Ensure that the value of the edpmServiceType field of the DataPlaneService is set to nova . If the dataSources list of the DataPlaneService contains a configMapRef named nova-extra-config , then this node set uses this ConfigMap and therefore will be affected by the configuration changes in this ConfigMap . If some of the node sets that are affected should not be reconfigured, you must create a new DataPlaneService pointing to a separate ConfigMap for these node sets and use that custom service in the required node sets instead. Replace <nodeSet_name> with the names of the `OpenStackDataPlaneNodeSet`CRs that you want to include in your data plane deployment. Save the compute_storage_devices_deploy.yaml deployment file. Deploy the data plane: Verify that the data plane is deployed: Access the remote shell for openstackclient and verify that the deployed Compute nodes are visible on the control plane: 6.2. Configuring shared instance storage By default, when you launch an instance, the instance disk is stored as a file in the instance directory, /var/lib/nova/instances. You can configure an NFS storage backend for the Compute service to store these instance files on shared NFS storage. To configure shared instance storage on NFS, you enable NFS on the data plane and set the location of the NFS share. Prerequisites You must be using NFSv4 or later. Red Hat OpenStack Services on OpenShift (RHOSO) does not support earlier versions of NFS. For more information, see the Red Hat Knowledgebase solution RHOS NFSv4-Only Support Notes . The oc command line tool is installed on your workstation. You are logged in to Red Hat OpenStack Services on OpenShift (RHOSO) as a user with cluster-admin privileges. Procedure Open the OpenStackDataPlaneNodeSet CR definition file for the node set you want to update, for example, my_data_plane_node_set.yaml . Add the required configuration or modify the existing configuration under ansibleVars : Replace <nfs_path>` with the path to the NFS. For example, 192.168.122.1:/home/nfs/nova. Optional: The default mount SELinux context for NFS storage when NFS backend storage is enabled is context=system_u:object_r:nfs_t:s0 . Add the following parameter to amend the mount options for the NFS instance file storage mount point: Replace <additional_nfs_mount_options>` with a comma-separated list of the mount options you want to use for NFS instance file storage. For more information on the available mount options, see the mount man page: Save the OpenStackDataPlaneNodeSet CR definition file. Apply the updated OpenStackDataPlaneNodeSet CR configuration: Verify that the data plane resource has been updated: Sample output: Create a file on your workstation to define the OpenStackDataPlaneDeployment CR, for example, my_data_plane_deploy.yaml : Tip Give the definition file and the OpenStackDataPlaneDeployment CR a unique and descriptive name that indicates the purpose of the modified node set. Add the OpenStackDataPlaneNodeSet CR that you modified: Save the OpenStackDataPlaneDeployment CR deployment file. Deploy the modified OpenStackDataPlaneNodeSet CR: You can view the Ansible logs while the deployment executes: Verify that the modified OpenStackDataPlaneNodeSet CR is deployed: Example: Sample output: Repeat the oc get command until you see the NodeSet Ready message: Example Sample output: For information on the meaning of the returned status, see Data plane conditions and states in the Deploying Red Hat OpenStack Services on OpenShift . 6.3. Configuring image downloads directly from Red Hat Ceph RADOS Block Device (RBD) When the Image service (glance) uses Red Hat Ceph RADOS Block Device (RBD) as the back end, and the Compute service (nova) uses local file-based ephemeral storage, you can configure the Compute service to download images directly from the RBD image repository without using the Image service API. This reduces the time it takes to download an image to the Compute node image cache at instance boot time, which improves instance launch time. Prerequisites The Image service back end is a Red Hat Ceph RADOS Block Device (RBD). The Compute service is using a local file-based ephemeral store for the image cache and instance disks. The oc command line tool is installed on your workstation. You are logged in to Red Hat OpenStack Services on OpenShift (RHOSO) as a user with cluster-admin privileges. You have selected the OpenStackDataPlaneNodeSet CR that defines which nodes you want to configure image downloads directly from RBD. For more information about creating an OpenStackDataPlaneNodeSet CR, see Creating an OpenStackDataPlaneNodeSet CR with pre-provisioned nodes in the Deploying Red Hat OpenStack Services on OpenShift guide. Procedure Create or update the ConfigMap CR named nova-extra-config and set the values of the parameters under [glance] to specify the Image service RBD back end, and the maximum length of time that the Compute service waits to connect to the Image service RBD back end, in seconds: For more information about creating ConfigMap objects, see Creating and using config maps in Nodes . Create a new OpenStackDataPlaneDeployment CR to configure the services on the data plane nodes and deploy the data plane, and save it to a file named compute_image_rbd_deploy.yaml on your workstation: In the compute_image_rbd_deploy.yaml CR, specify nodeSets to include all the OpenStackDataPlaneNodeSet CRs you want to deploy. Ensure that you include the OpenStackDataPlaneNodeSet CR that you selected as a prerequisite, which defines the nodes that you want to configure image downloads directly from RBD. Warning You cannot reconfigure a subset of the nodes within a node set. If you need to do this, you must scale the node set down and create a new node set from the previously removed nodes. Warning If your deployment has more than one node set, changes to the nova-extra-config.yaml ConfigMap might directly affect more than one node set, depending on how the node sets and the DataPlaneServices are configured. To check if a node set uses the nova-extra-config ConfigMap and therefore will be affected by the reconfiguration, complete the following steps: Check the services list of the node set and find the name of the DataPlaneService that points to nova. Ensure that the value of the edpmServiceType field of the DataPlaneService is set to nova . If the dataSources list of the DataPlaneService contains a configMapRef named nova-extra-config , then this node set uses this ConfigMap and therefore will be affected by the configuration changes in this ConfigMap . If some of the node sets that are affected should not be reconfigured, you must create a new DataPlaneService pointing to a separate ConfigMap for these node sets and use that custom service in the required node sets instead. Replace <nodeSet_name> with the names of the `OpenStackDataPlaneNodeSet`CRs that you want to include in your data plane deployment. Save the compute_image_rbd_deploy.yaml deployment file. Deploy the data plane: Verify that the data plane is deployed: Access the remote shell for openstackclient and verify that the deployed Compute nodes are visible on the control plane:

Commands:
apiVersion: v1 kind: ConfigMap metadata: name: nova-extra-config namespace: openstack data: 31-nova-max-storage-devices.conf: | [compute] max_disk_devices_to_attach = <max_device_limit>
apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneDeployment metadata: name: compute-storage-devices
apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneDeployment metadata: name: compute-storage-devices spec: nodeSets: - openstack-edpm - compute-storage-devices - - <nodeSet_name>
oc create -f compute_storage_devices_deploy.yaml
oc get openstackdataplanenodeset NAME STATUS MESSAGE compute-storage-devices True Deployed
oc rsh -n openstack openstackclient openstack hypervisor list
apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneNodeSet metadata: name: my-data-plane-node-set spec: nodeTemplate: ansible: ansibleVars: edpm_extra_mounts: | [ { "path": "/var/lib/nova/instances", "src": "<nfs_path>", "opts": "context=system_u:object_r:nfs_t:s0", "fstype": "nfs4", } ]
[compute] nfs_mount_options = 'context=system_u:object_r:nfs_t:s0,<additional_nfs_mount_options>'
man 8 mount
oc apply -f my_data_plane_node_set.yaml -n openstack
oc get openstackdataplanenodeset
NAME STATUS MESSAGE my-data-plane-node-set False Deployment not started
apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneDeployment metadata: name: my-data-plane-deploy
spec: nodeSets: - my-data-plane-node-set
oc create -f my_data_plane_deploy.yaml -n openstack
oc get pod -l app=openstackansibleee -n openstack -w oc logs -l app=openstackansibleee -n openstack -f --max-log-requests 10
oc get openstackdataplanedeployment -n openstack
NAME STATUS MESSAGE my-data-plane-node-set True Setup Complete
oc get openstackdataplanenodeset -n openstack
NAME STATUS MESSAGE my-data-plane-node-set True NodeSet Ready
apiVersion: v1 kind: ConfigMap metadata: name: nova-extra-config namespace: openstack data: 33-nova-image-rbd.conf: | [glance] enable_rbd_download=True rbd_user=openstack rbd_pool=images rbd_ceph_conf=/etc/ceph/ceph.conf rbd_connect_timeout=5
apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneDeployment metadata: name: compute-image-rbd
apiVersion: dataplane.openstack.org/v1beta1 kind: OpenStackDataPlaneDeployment metadata: name: compute-image-rbd spec: nodeSets: - openstack-edpm - compute-image-rbd - - <nodeSet_name>
oc create -f compute_image_rbd_deploy.yaml
oc get openstackdataplanenodeset NAME STATUS MESSAGE compute-image-rbd True Deployed
oc rsh -n openstack openstackclient openstack hypervisor list