// Module included in the following assemblies:
//
// * machine_management/creating_machinesets/creating-machineset-azure.adoc
// * machine_management/control_plane_machine_management/cpmso_provider_configurations/cpmso-config-options-azure.adoc

ifeval::["{context}" == "creating-machineset-azure"]
:compute:
endif::[]
ifeval::["{context}" == "cpmso-supported-features-azure"]
:cpmso:
endif::[]

:_mod-docs-content-type: PROCEDURE
[id="machineset-azure-enabling-accelerated-networking-existing_{context}"]
= Enabling Accelerated Networking on an existing {azure-full} cluster

[role="_abstract"]
You can enable Accelerated Networking on {azure-full} by adding `acceleratedNetworking` to your machine set YAML file. Accelerated Networking uses SR-IOV to help improve network performance for new nodes.

.Prerequisites

* Have an existing {azure-short} cluster where the Machine API is operational.

.Procedure
////
//Trying to move towards a more streamlined approach, but leaving this in in case needed
. List the compute machine sets in your cluster by running the following command:
+
[source,terminal]
----
$ oc get machinesets -n openshift-machine-api
----
+
The compute machine sets are listed in the form of `<cluster-id>-worker-<region>`.
+
.Example output
[source,terminal]
----
NAME                                DESIRED   CURRENT   READY   AVAILABLE   AGE
jmywbfb-8zqpx-worker-centralus1     1         1         1       1           15m
jmywbfb-8zqpx-worker-centralus2     1         1         1       1           15m
jmywbfb-8zqpx-worker-centralus3     1         1         1       1           15m
----

. For each compute machine set:

.. Edit the custom resource (CR) by running the following command:
+
[source,terminal]
----
$ oc edit machineset <machine-set-name>
----

.. Add the following to the `providerSpec` field:
////
* Add the following to the `providerSpec` field:
+
[source,yaml]
----
providerSpec:
  value:
    acceleratedNetworking: true
    vmSize: <azure-vm-size>
----
+
where:

`providerSpec.value.acceleratedNetworking`:: Enables Accelerated Networking.
`providerSpec.value.vmSize`:: Specifies an {azure-short} VM size that includes at least four vCPUs. For information about VM sizes, see the {azure-full} documentation link:https://docs.microsoft.com/en-us/azure/virtual-machines/sizes[Sizes for virtual machines in {azure-short}].

ifdef::compute[]
.Next steps

* To enable the feature on currently running nodes, you must replace each existing machine. This can be done for each machine individually, or by scaling the replicas down to zero, and then scaling back up to your desired number of replicas.
endif::compute[]

.Verification

* On the {azure-full} portal, review the *Networking* settings page for a machine provisioned by the machine set, and verify that the `Accelerated networking` field is set to `Enabled`.

ifeval::["{context}" == "creating-machineset-azure"]
:!compute:
endif::[]
ifeval::["{context}" == "cpmso-supported-features-azure"]
:!cpmso:
endif::[]
