.. _Managing Virtual Networks:

Managing Virtual Networks
-------------------------

In the compute cluster, you can create and manage two types of virtual networks: 

-  Private. These virtual networks can be used for intercommunication between VMs. They are isolated from each other and from physical networks. You can create private virtual networks with arbitrary IP ranges and not worry about possible IP address conflicts.

-  External. These virtual networks can be used to access the Internet. They connect to the existing physical networks, therefore their IP ranges and allocation pools must comply with the physical network infrustructure.
   
   .. note:: One physical network can be integrated only with one external virtual network.

Both private and external virtual networks are listed on the **VIRTUAL NETWORKS** tab. 

The next subsections describe how to add, view, edit, and delete virtual networks.

.. _Creating Virtual Networks:

Creating Virtual Networks
~~~~~~~~~~~~~~~~~~~~~~~~~

To add a new virtual network, do the following:

#. On the **COMPUTE** > **VIRTUAL NETWORKS** tab, click **Add virtual network**.

#. In the **Network configuration** section, configure the network parameters:

   -  Choose network type.
   -  Specify a network name.
   -  For an external network, choose a corresponding physical network with the **VM external** traffic type from the **Physical network** drop-down menu.
   -  Specify network's IPv4 address range in **Subnet CIDR**. (This will be done automatically for external virtual networks.)
   -  Optionally, specify a gateway. If you leave the **Gateway** field blank, the first IP address of the specified range will be used as a gateway.

      .. note:: For external virtual networks, you need to specify a physical gateway.

   Click **Next**.

   .. image:: ../../../images/stor_image82_1.png
      :align: center
      :class: align-center

#. In the **DCHP and DNS** section, set the DHCP server and specify one or more allocation pools and DNS servers: 

   -  With the DHCP server enabled, virtual NICs will be automatically assigned IP addresses from the virtual network IP range or allocation pools. With the DHCP server disabled, virtual NICs will automatically be allocated IP addresses, but you will have to manually assign them inside VMs.
   -  If you do not specify allocation pools, IP addresses will be allocated from the entire IP range of the virtual network.
   -  DNS servers can be specified only if the DHCP server is enabled.

   Click **Next**.

   .. image:: ../../../images/stor_image82_2.png
      :align: center
      :class: align-center

#. In the **Summary** section, review the the virtual network configuration and click  **Add virtual network**.

   .. image:: ../../../images/stor_image82_3.png
      :align: center
      :class: align-center

.. _Editing Virtual Networks Parameters:

Editing Virtual Networks Parameters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To view and edit parameters of a virtual network, click it on the **VIRTUAL NETWORKS** tab. A panel with the virtual network details will open.

.. image:: ../../../images/stor_image83.png
   :align: center
   :class: align-center

On this panel, you can change the virtual network name, gateway, DHCP settings, allocation pools, and DNS servers. To do this, click the pencil icon, enter a new value, and click the tick icon to confirm.

.. _Deleting Virtual Networks:

Deleting Virtual Networks
~~~~~~~~~~~~~~~~~~~~~~~~~

.. important:: Before deleting a virtual network, make sure no VMs are connected to it.

To delete one or more virtual networks, do the following:

#. On the **VIRTUAL NETWORKS** tab, either:

   -  select networks and click **Delete** above the list, or
   -  click the ellipsis icon next to the network and select **Delete**, or
   -  click a network to open its details and click **Delete** on the top toolbar.

#. In the **Delete networks** window, confirm the action by clicking **Delete**.
