---
title: "Deploying the vNIOS for OpenStack Instances Using Cloud-Init"
canonical: "https://docs.infoblox.com/space/vniosopstack/1098285073/Deploying%20the%20vNIOS%20for%20OpenStack%20Instances%20Using%20Cloud-Init"
format: markdown
---
NIOS allows you to automatically provision and deploy Grid Master and Grid members using the cloud-init utility. Ensure that you understand how to compose user data files for provisioning the Grid Master and Grid members. A user data file includes configuration details such as enabling the remote console, installing licenses, defining network settings, and validating the certificate and token required for authenticating the member. For information about how to create a user data file, see *[Defining User Data Settings for vNIOS Instances](#User_data_settinngs_OpenStack_Instances)*. For more information about cloud-init, see *[cloud-init Configuration in vNIOS for OpenStack](https://infoblox-docs.atlassian.net/wiki/spaces/vniosopstack/pages/1929216016)*.

Before you deploy vNIOS for OpenStack instances using the cloud-init utility, ensure that you have the necessary feature licenses for each of your instances.

# Deploying the Grid Master and Grid Members

To set up the Grid Master and begin deploying vNIOS for OpenStack Grid members in OpenStack by using cloud-init, complete the following steps:

1. Deploy the Grid Master in OpenStack as defined in *[Deploying the Grid Master](#Deploying_Grid_Master)*.
2. In Infoblox NIOS Grid Manager, create offline Grid members that you plan to join to the Grid, pre-provision them, and generate a token for each member and use the token in the user data file of each member. For more information, see the *Pre-Provisioning NIOS and vNIOS Appliances* topic in the *[Infoblox NIOS Documentation](https://docs.infoblox.com/space/NIOS/35400616/NIOS)*.
3. Deploy Grid members in OpenStack as defined in *[Deploying Grid Members](#Deploying_Grid_Members)*.  
If for any reason the use of cloud-init to join members to a Grid does not function properly, you can use the CLI commands defined in the *Joining Pre-Provisioned Members to a Grid* topic in the *[Infoblox NIOS Documentation](https://docs.infoblox.com/space/NIOS/35400616/NIOS)* to join the members to the Grid.

## > Macro (anchor)

Deploying the Grid Master

1. Sign in to OpenStack and compose the user data file for the Grid Master using the vi editor. You can also compose the data file locally and move it to the OpenStack node later.  
For examples of user data files, see *[cloud-init Configuration in vNIOS for OpenStack](https://infoblox-docs.atlassian.net/wiki/spaces/vniosopstack/pages/1929216016)*.
2. Run the `openstack port-create` command to create port IDs for the network interfaces (MGMT, LAN1, and/or HA).
  - For the vNIOS appliance to run in OpenStack, you must specify at least two networks, MGMT and LAN1.
  - If you need to create a LAN2 port, then you must create an HA port.
  - To set up high availability (HA) with vNIOS, you must specify three network interfaces, MGMT, LAN1, and HA on each node of the HA pair.  
Ensure that the LAN 1 and HA interfaces are in the same subnet.
  - For HA pairs, you must also run the `allowed-address-pairs` option to define the VIP port for the HA configuration, using the VRRP MAC address and the Virtual Router ID.  
Following is an example:  
`$ openstack port-create VIP –-allowed-address-pairs list=true mac_address= 00:00:5e:00:01:c8 ip_address=10.0.0.22`  
  
Note that you can use the `security-group` option to associate the vNIOS instance with one or more security groups that you have created. For more information, see the *[Setting Up Security Groups](https://infoblox-docs.atlassian.net/wiki/spaces/vniosopstack/pages/1098055742)* section. Optionally, you can associate the vNIOS instance with a security group when you run the `openstack server create` command.  
Example:  
`$ openstack port-create --security-group <name of the security group>`
3. For an HA pair configuration only: Ensure that you set `allow_duplicate_networks=true` in the nova.conf file to remove the restriction of allowing only one interface for each network in OpenStack.
4. Run the `openstack port list` command to view the network and port IDs generated for all network interfaces. You can copy and paste the Port IDs into the `openstack server create` command.
5. Run the `openstack server create` command in OpenStack to spin up the Grid Master VM.  
Note: Use the custom name that you used when creating flavors.  
Following is an example:
  - For Red Hat OpenStack Platform, use the command:  
`openstack server create <instance_name> --config-drive=True --flavor=<flavor_name> --image=<image_name> --nic port-id=<mgmt_port_id> --nic port-id=<lan1_port_id> --nic port-id=<ha_port_id> --nic port-id=<lan2_port_id> --user-data <user_data_file_name>`
  - For Ubuntu, use the command:  
`openstack server create <instance_name> --config-drive True --flavor <flavor_name> --image <image_name> --network <network_name_mgmt> --network <network_name_lan1> --network <network_name_ha> --network <network_name_lan2> --user-data <user_data_file_name>`  
For information about user data files, see the *Defining User Data Settings for vNIOS Instances* section below.
    Parameter description:
    - `config-drive` determines whether to use the virtual CD-ROM drive transport mechanism for the user data file. Set it to `True` to enable the use of virtual drive.
    - `image` defines the name of the software package you downloaded. For information about supported vNIOS for OpenStack models, see *[vNIOS for OpenStack X6 Series](https://docs.infoblox.com/space/vniosspec/1488322601/vNIOS+for+OpenStack+X6+Series)* and *[vNIOS for OpenStack X5 Series](https://docs.infoblox.com/space/vniosspec/1488846894/vNIOS+for+OpenStack+X5+Series)*.
    - `flavor` specifies the flavors of the vNIOS for OpenStack instance. For information about how to define flavors, see *[Setting up the OpenStack Flavors for vNIOS](https://infoblox-docs.atlassian.net/wiki/spaces/vniosopstack/pages/1098055742)*.
    - `nic port-id` specifies the port ID of the MGMT, LAN1, LAN2, or HA interface.
    - `network` specifies the name of the network in which the port must reside.
    - `user-data` specifies the name of the user data file.

To remove networks, use the `openstack net-delete` command. If some of the networks remain, use OpenStack Horizon to manually remove them.  
The vNIOS for OpenStack instance automatically spins up after the `openstack server create` command is run.

## > Macro (anchor)

Deploying the Grid Members

1. Sign in to OpenStack and compose a user data file for each Grid member you plan to join the Grid. For examples of user data files, see *[cloud-init Configuration in vNIOS for OpenStack](https://infoblox-docs.atlassian.net/wiki/spaces/vniosopstack/pages/1929216016)*.
2. Run the `openstack server create` command in OpenStack to spin up each Grid member VM, as follows:
  - For Red Hat OpenStack Platform, use the command:  
`openstack server create <instance_name> --config-drive True --flavor=<flavor_name> --image=<image_name> --nic port-id=<mgmt_port_id> --nic port-id=<lan1_port_id> --nic port-id=<ha_port_id> --nic port-id=<lan2_port_id> --user-data <user_data_file_name>`
  - For Ubuntu, use the command:  
`openstack server create <instance_name> --config-drive True --flavor <flavor_name> --image <image_name> --network <network_name_mgmt> --network <network_name_lan1> --network <network_name_ha> --network <network_name_lan2> --user-data <user_data_file_name>`  
For information about user data files, see the *Defining User Data Settings for vNIOS Instances* section below.  
Parameter description:
    - `config-drive` determines whether to use the virtual CD-ROM drive transport mechanism for the user data file. Set it to `True` to enable the use of virtual drive.
    - `image` defines the name of the software package you downloaded. For information about supported vNIOS for OpenStack models, see *[vNIOS for OpenStack X6 Series](https://docs.infoblox.com/space/vniosspec/1488322601/vNIOS+for+OpenStack+X6+Series)* and *[vNIOS for OpenStack X5 Series](https://docs.infoblox.com/space/vniosspec/1488846894/vNIOS+for+OpenStack+X5+Series)*.
    - `flavor` specifies the flavors of the vNIOS for KVM instance. For information about how to define flavors, see *[Setting up the OpenStack Flavors for vNIOS](https://infoblox-docs.atlassian.net/wiki/spaces/vniosopstack/pages/1098055742)*.
    - `nic port-id` specifies the port ID of the network interface.
    - `network` specifies the name of the network in which the port must reside.
    - `user-data` specifies the name of the user data file.

After you run the `openstack server create` command and launch the vNIOS for OpenStack instances, the Grid members automatically join the Grid. Further communications with the instance take place through Grid Manager and the NIOS CLI.

# > Macro (anchor)

Defining User Data Settings for vNIOS Instances Using Cloud-Init

When you deploy vNIOS appliances using cloud-init, the instances in the OpenStack environment require different user data settings. Compose the user data file in plain text format by using the vi editor in OpenStack.  
OpenStack supports two transport mechanisms for the user data file; one through a virtual CDROM drive (also known as ISO parameter injection) and the other through the metadata network service. You can provide either or both transport mechanisms. OpenStack will make the user data file available to the vNIOS instance using the transport you configure in the user data file. 

For the list of data fields you can configure in the user-data framework for provisioning vNIOS instances, see *[cloud-init Configuration in vNIOS for OpenStack](https://infoblox-docs.atlassian.net/wiki/spaces/vniosopstack/pages/1929216016)*.

For sample user data files, see *[cloud-init Configuration in vNIOS for OpenStack](https://infoblox-docs.atlassian.net/wiki/spaces/vniosopstack/pages/1929216016)*.

> ⚠️ **Note**
> ⚠️ 
> ⚠️ In case you are using mixed-interface support, use cloud-init with the MAC address added to the user data.

## Sample Commands for Deploying an HA Pair

The following `openstack server create` commands for Red Hat OpenStack platform are for deploying an HA pair in the OpenStack environment:

Run the following command to spin up the active node:

`openstack server create --config-drive=True --image=nios-9.0.5-305525-1420-160.qcow2 --flavor=vnios1420.160 --nic port-id=81345eaf-49dd-4ad1-a31c-32159ef4d948 --nic`  
` port-id=99c73fc5-71ca-457a-a505-f40e85f88207 --user-data ./user-data-ha HA_active1`  
  
Once the active node is up and running, change the token value in the user-data file and run the following command to create the passive node:  
`openstack server create --config-drive True --image nios-9.0.5-Alpha-305525-1420-160.qcow2 --flavor vnios1420.160 --nic port-id=ddd57167-2173-4f11-860b-c4efb9ddd3d6 --nic`  
` port-id=07b9df9b-0bb3-4ddd-9ede-850bf3a27671 --user-data ./user-data-ha HA_passive1`