<commit_before>.. _config_index:

=============
Configuration
=============

In addition to the Nova config options, compute-hyperv has a few extra
configuration options. For a sample configuration file, refer to
:ref:`config_sample`.


Driver configuration
--------------------

In order to use the compute-hyperv Nova driver, the following configuration
option will have to be set in the ``nova.conf`` file:

.. code-block:: ini

    [DEFAULT]
    compute_driver = compute_hyperv.driver.HyperVDriver

And for Hyper-V Clusters, the following:

.. code-block:: ini

    [DEFAULT]
    compute_driver = compute_hyperv.cluster.driver.HyperVClusterDriver
    instances_path = path\to\cluster\wide\storage\location
    sync_power_state_interval = -1

    [workarounds]
    handle_virt_lifecycle_events = False

By default, the OpenStack Hyper-V installer will configure the ``nova-compute``
service to use the ``compute_hyperv.driver.HyperVDriver`` driver.


Storage configuration
---------------------

When spawning instances, ``nova-compute`` will create the VM related files (
VM configuration file, ephemerals, configdrive, console.log, etc.) in the
location specified by the ``instances_path`` configuration option, even if
the instance is volume-backed.

It is not recommended for Nova and Cinder to use the same storage location, as
that can create scheduling and disk overcommitment issues.


Nova instance files location
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

By default, the OpenStack Hyper-V installer will configure ``nova-compute`` to
use the following path as the ``instances_path``:

.. code-block:: ini

    [DEFAULT]
    instances_path = C:\OpenStack\Instances

``instances_path`` can be set to an SMB share, mounted or unmounted:

.. code-block:: ini

    [DEFAULT]
    # in this case, X is a persistently mounted SMB share.
    instances_path = X:\OpenStack\Instances

    # or
    instances_path = \\SMB_SERVER\share_name\OpenStack\Instances

Alternatively, CSVs can be used:

.. code-block:: ini

    [DEFAULT]
    instances_path = C:\ClusterStorage\Volume1\OpenStack\Instances


Block Storage (Cinder) configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This section describes Nova configuration options that handle the way in which
Cinder volumes are consumed.

When having multiple paths connecting the host to the storage backend,<commit_msg>Document image cache manager limitation<commit_after>.. _config_index:

=============
Configuration
=============

In addition to the Nova config options, compute-hyperv has a few extra
configuration options. For a sample configuration file, refer to
:ref:`config_sample`.


Driver configuration
--------------------

In order to use the compute-hyperv Nova driver, the following configuration
option will have to be set in the ``nova.conf`` file:

.. code-block:: ini

    [DEFAULT]
    compute_driver = compute_hyperv.driver.HyperVDriver

And for Hyper-V Clusters, the following:

.. code-block:: ini

    [DEFAULT]
    compute_driver = compute_hyperv.cluster.driver.HyperVClusterDriver
    instances_path = path\to\cluster\wide\storage\location
    sync_power_state_interval = -1

    [workarounds]
    handle_virt_lifecycle_events = False

By default, the OpenStack Hyper-V installer will configure the ``nova-compute``
service to use the ``compute_hyperv.driver.HyperVDriver`` driver.


Storage configuration
---------------------

When spawning instances, ``nova-compute`` will create the VM related files (
VM configuration file, ephemerals, configdrive, console.log, etc.) in the
location specified by the ``instances_path`` configuration option, even if
the instance is volume-backed.

It is not recommended for Nova and Cinder to use the same storage location, as
that can create scheduling and disk overcommitment issues.


Nova instance files location
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

By default, the OpenStack Hyper-V installer will configure ``nova-compute`` to
use the following path as the ``instances_path``:

.. code-block:: ini

    [DEFAULT]
    instances_path = C:\OpenStack\Instances

``instances_path`` can be set to an SMB share, mounted or unmounted:

.. code-block:: ini

    [DEFAULT]
    # in this case, X is a persistently mounted SMB share.
    instances_path = X:\OpenStack\Instances

    # or
    instances_path = \\SMB_SERVER\share_name\OpenStack\Instances

Alternatively, CSVs can be used:

.. code-block:: ini

    [DEFAULT]
    instances_path = C:\ClusterStorage\Volume1\OpenStack\Instances

When the compute hosts are using different CSVs, Nova must be configured not
to delete unused images since its image caching mechanism can't properly track
the image file usage in this case.

.. code-block:: ini

    [image_cache]
    remove_unused_base_images = False


Block Storage (Cinder) configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This section describes Nova configuration options that handle the way in which
Cinder volumes are consumed.

When having multiple paths connecting the host to the storage backend,
{'fraction_non_alphanumeric': 0.12010391686650679, 'fraction_numerical': 0.0007993605115907274, 'mean_word_length': 4.06066734074823, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4918918', 'n_tokens_mistral': 1378, 'n_tokens_neox': 1305, 'n_words': 520}