# Compute Service Advanced Configuration

You may occasionally need to adjust the default Compute Service configuration to enable or disable specific settings. This document describes the steps to do that.

## What is nova\_override.conf

`nova_override.conf` is the configuration file used by <code class="expression">space.vars.product\_name</code> compute service to store all the default configuration values.

You can use this override file to:

* Adjust logging levels or enabling more verbose logging by enabling debug mode. (Mostly commonly used case).
* Customize compute driver options.
* Modify quota defaults for specific tenants.

The `nova_override.conf` file is located in the following directory.

{% tabs %}
{% tab title="Bash" %}

```bash
/opt/pf9/etc/nova/conf.d/nova_override.conf
```

{% endtab %}
{% endtabs %}

## What to know before

* Updating nova\_override.conf file is an **advance operation and should only be performed by Administrators** with complete understanding of the property being edited and the possible impact. We highly recommend that you do this **only under guidance from the Platform9 support** or solution architect teams.
* Any changes made to the config file persist across upgrades to <code class="expression">space.vars.product\_name</code>, ensuring that your customized settings remain intact across upgrades.
* Any change to the config file requires service restart for the changes to take effect.
* The `nova_override` file **must be edited on** **each hypervisor host** to ensure that the changes to apply consistently across all hosts.

{% hint style="danger" %}
**Important**

Updating nova\_override.conf file is an **advance operation** and must only be performed by Administrators. We highly recommend **doing this only under Platform9 support guidance**.
{% endhint %}

## Restart Service

After editing the `nova_override.conf` file, you must restart the compute service for the changes to take effect. Run the following command on the host:

{% tabs %}
{% tab title="Bash" %}

```bash
systemctl restart pf9-ostackhost
```

{% endtab %}
{% endtabs %}

## Common Settings

For a complete list of Compute Service configuration options, refer to [nova.conf](https://docs.openstack.org/ocata/config-reference/compute/config-options.html).

Below we have some common scenarios and configurations options you may wish to edit.

### Enable Debug Logging

This is the most commonly used option. You can turn this on when troubleshooting issues with VM creation or VM volume attachment. Note that enabling this will generate highly verbose logs and may exhaust disk space on the host. We recommend disabling it in production after troubleshooting.

{% tabs %}
{% tab title="Bash" %}

```bash
[DEFAULT]
debug = true  # Enable detailed logging (useful for troubleshooting)
log_dir = /var/log/nova  # Log file storage location
```

{% endtab %}
{% endtabs %}

### Scheduler Configuration

This parameter determines the number of times the virtual machine scheduler will try to provision a virtual machine instance before failing. Only adjust this under specific guidance from Platform9 support team.

{% tabs %}
{% tab title="Bash" %}

```bash
[scheduler]
max_attempts = 5  # Number of retries for scheduling instances
```

{% endtab %}
{% endtabs %}

### Resource Over-Provisioning

`cpu_allocation_ratio` and `ram_allocation_ratio` define the CPU and memory over commitment ratios at the hypervisor host level. The defaults are 1:5 for RAM and 1:16 for CPU over commitment.

{% tabs %}
{% tab title="Bash" %}

```bash
[DEFAULT]
cpu_allocation_ratio = 16.0  # Overcommit CPU resources (Default: 16)
ram_allocation_ratio = 1.5  # Overcommit RAM resources (Default: 1.5)
```

{% endtab %}
{% endtabs %}

### Reserving Resources for System Overhead

You can reserve CPU and Memory resources at each hypervisor level that will not be allocated to virtual machines that get provisioned on that hypervisor. This is crucial for production environments to ensure that the hypervisor remains functional even when the virtual machines provisioned on it may be under heavy load. \_\_`reserved_host_memory_mb` represents memory in MB to be reserved for system overhead and `reserved_host_memory_mb` represents host cpus to be reserved. The default values for these are 512 for memory and 0 for CPU.

{% tabs %}
{% tab title="Bash" %}

```bash
reserved_host_memory_mb = 512  # host memory to reserve for system overhead 
reserved_host_cpus = 0 # host cpus to reserve for system overhead
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Info**

Kernel-level overcommit checks during VM creation are disabled by setting `/proc/sys/vm/overcommit_memory` to `1`. This enables dynamic VM creation and hotplug operations. After host upgrades, the file is automatically reset to `1` even if it was manually modified.
{% endhint %}

## Advance Settings

{% hint style="warning" %}
**Warning**

These settings impact VM operations and performance. Modify only if necessary and test changes in a non-production environment.
{% endhint %}

### Compute Driver Configuration

{% tabs %}
{% tab title="Bash" %}

```bash
[DEFAULT]
compute_driver = nova.virt.libvirt.LibvirtDriver
```

{% endtab %}
{% endtabs %}

Do not change unless you are configuring a different virtualization technology (e.g., VMware, Xen, KVM).

### Networking Configuration

{% tabs %}
{% tab title="Bash" %}

```bash
[neutron]
service_plugins = router,metering
```

{% endtab %}
{% endtabs %}

Changing networking parameters without proper testing may break VM connectivity.

### Disk & Storage Settings

{% tabs %}
{% tab title="Bash" %}

```bash
[libvirt]
images_type = qcow2  # Default disk image format
live_migration_flag = VIR_MIGRATE_LIVE
```

{% endtab %}
{% endtabs %}

Modify only if you are implementing specific storage optimizations.

### CPU Mode and Model Configuration

{% tabs %}
{% tab title="Bash" %}

```bash
[libvirt]
# Specifies the CPU mode for virtual machine instances.
cpu_mode = custom
# Defines the custom CPU model(s) to be used with the hypervisor.
cpu_models = Broadwell-noTSX-IBRS
```

{% endtab %}
{% endtabs %}

This configuration is typically used when you need consistent CPU features across different hypervisors.

### Enable Storage Multipath

1. Make sure that service `multipathd` is running on all hosts.
2. Use the following config option to enable storage multipath support.

{% tabs %}
{% tab title="Bash" %}

```bash
volume_use_multipath = True
```

{% endtab %}
{% endtabs %}

### Configure PMEM Namespace

Use the following parameters to configure what Persistent Memory namespaces should be available for virtual machines to use when utilizing the vPMEM feature.

**Pre-requisites:**

* The PMEM namespaces must be precreated for this configuration to work.

Syntax to follow:

```bash
"$LABEL:$NSNAME[|$NSNAME][,$LABEL:$NSNAME[|$NSNAME]]"
```

* `$NSNAME` is the name of the PMEM namespace.
* `$LABEL` represents one specific resource class of PMEM memory that you wish to create and make available to your virtual machines, this is then used to generate the resource class name as `CUSTOM_PMEM_NAMESPACE_$LABEL`.

The configuration syntax allows the admin to associate one or more namespace `$NSNAME`s with an arbitrary `$LABEL` that can subsequently be used in a flavor to request one of those namespaces. It is recommended, but not required, for namespaces under a single `$LABEL` to be the same size.

The example below creates two resource classes of PMEM memory, 6GB and LARGE. It maps the class 6GB to namespaces ns0, ns1, ns2 and class LARGE to namespace ns3.

{% tabs %}
{% tab title="Bash" %}

```bash
[libvirt]
# pmem_namespaces=$LABEL:$NSNAME[|$NSNAME][,$LABEL:$NSNAME[|$NSNAME]]
pmem_namespaces = 6GB:ns0|ns1|ns2,LARGE:ns3
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.platform9.com/private-cloud-director/virtualized-clusters/nova-override.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
