Configuring vRack for Public Cloud using OVHcloud APIv6
Objective
OVHcloud vRack is a private network solution that enables our customers to route traffic between OVHcloud dedicated servers as well as other OVHcloud services. At the same time, it allows you to add Public Cloud instances to your private network to create an infrastructure of physical and virtual resources.
This guide explains how to configure Public Cloud instances within your vRack using the OVHcloud APIv6.
Requirements
- A Public Cloud project in your OVHcloud account
- An OpenStack user account
- Basic networking knowledge
- Consulting the guide Configuring the vRack on Public Cloud (to understand the different methods to manage the vRack with the Public Cloud)
- Consulting the guide First steps to use the OVHcloud API (to familiarise yourself with the OVHcloud API)
Instructions
Step 1: Activating and managing a vRack
Log in to the OVHcloud APIv6 interface according to the relevant guide (First steps with the OVHcloud API) and follow these steps:
Creating the cart
This call will create an ID for your 'shopping cart'. You can add as many articles as you want before you validate it.
In this case, the order of a vRack alone is free. Remember your cart number (cartId), it will be required for the rest.
Retrieving the necessary information for the vRack order
This call will allow you to retrieve all the information needed to order the vRack. Copy the following:
cartId, duration, planCode, and pricingMode.
Adding the vRack to the cart
This call allows you to add the vRack to the cart by adding all the necessary information to the order.
For a vRack, this would be, for example:
cartId: [your cart identifier]
duration: "P1M"
planCode: "vrack"
pricingMode: "default"
quantity: 1
Once you have validated the order, you will receive an item number ("itemId"). Keep this information, it will be useful if you wish to make changes before the validation of the cart.
Validating the cart
Once you have put all the items in your cart, you will need to validate it:
This call will validate the cart and create a purchase order ("orderId"). Keep this information, it will be necessary to validate the order.
Validating the final order
To validate the order, you have two possibilities:
- Pass through the visible URL when the cart is validated. Example:
URL: https://www.ovh.com/cgi-bin/order/displayOrder.cgi?orderId=12345678&orderPassword=xxxxxxxxxx
- Validate using this call:
Even if it is a โฌ0 purchase order, it is necessary to simulate a purchase order payment (orderId). Your order form will then be validated and processing will begin.
Once the free order has been validated, it may take a few minutes for the vRack to be activated.
Step 2: Adding your Public Cloud project to the vRack
Once the vRack is active, you will need to integrate your Public Cloud project(s) into the vRack.
Log in to the OVHcloud APIv6 interface according to the relevant guide (First steps with the OVHcloud API).
In case the project ID is unknown, the calls below allow you to retrieve it.
Identifying the project
This call retrieves the list of projects.
This call identifies the project via the "description" field.
Adding the project to the vRack
Once the project ID and the vRack name are known, their association is made through the following call:
Fill in the fields with the information previously retrieved:
serviceName: vRack name in the form "pn-xxxxxx"
project: The Public Cloud project ID in the form of a 32-character string
This call initialises the association of the project and the vRack. The task ID must then be retrieved to check the progress.
Checking the progress of the task
You can view the progress of the task with this call:
This call is optional and only allows you to check the status of the task. Once it is complete, you can proceed to the next step.
Step 3: Creating a VLAN in the vRack
It is necessary to create a VLAN so that instances connected to the vRack can communicate with each other.
With the Public Cloud service, you can create up to 4,000 VLANs within one vRack. This means that you can use each private IP address up to 4,000 times. Thus, for example, 192.168.0.10 of VLAN 2 is different from IP 192.168.0.10 of VLAN 42.
This can be useful in order to segment your vRack between multiple virtual networks.
Using the OVHcloud APIv6, you can customise all settings: IP range (10.0.0.0/16 for example), deployment zone, DCHP, Gateway, etc.
On dedicated servers, you are using VLAN 0 by default. The OpenStack infrastructure requires to specify your VLAN ID directly at the infrastructure level.
Unlike dedicated servers, there is no need to tag a VLAN directly on a Public Cloud instance.
To learn more about this topic, please refer to the guide Creating multiple vLANs in a vRack
vRack is managed at the OVHcloud infrastructure level, meaning you can only administrate it in the OVHcloud Control Panel and the OVHcloud APIv6.
Because OpenStack is not located at the same level, you will not be able to customise VLANs through the Horizon interface or OpenStack APIs.
Once logged in to the OVHcloud APIv6 interface, follow these steps:
Retrieving the required information
Public Cloud project
This call retrieves the list of projects.
This call identifies the project via the "description" field.
vRack
In the field "serviceName", specify the ID of your project. Save the vRack ID information in the form "pn-xxxxx".
Creating the private network
Fill in the fields with the information previously obtained:
serviceName : project ID
name : name of your VLAN
You can leave the "Region" field blank in order to enable it for all regions.
The VLAN identifier (vlanId) is required if you want to create a specific VLAN.
The creation will take a few moments.
You can check your VLAN information with the following call
This call retrieves the "networkId" in this form: name-vrack_vlanId.
For example, VLAN 42: pn-xxxxxx_42
Creating a subnet
By default, if you do not add a subnet, the IP range used is:
If you want to manage IP assignments yourself, you will need to create a subnet.
To do this, once the VLAN is created, you will need to create the subnet for each affected area by the following call:
Fill in the fields according the following table.
This is the stage of creating the subnet by region. You can enable or disable private IP address assignment dynamically through DHCP.
You will need to do the same for each region where your instances are present.
Be careful to separate your IP address pools for different regions. For example:
From 192.168.0.2 to 192.168.0.254 for SBG1
From 192.168.1.2 to 192.168.1.254 for GRA1
Step 4: Integrating an instance into the vRack
There are two possible scenarios:
- The instance to be integrated does not exist yet.
- An existing instance needs to be added to the vRack.
In case of a new instance
Once logged in to the OVHcloud APIv6 interface, follow these steps:
Retrieving the required information
Retrieving the project ID
Retrieving the networkID of the public network (Ext-Net)
Retrieving the networkID of the private network (vRack interface previously created)
The identifier will have the form: "pn-xxxxx_yy" in which yy is the VLAN number.
Retrieving the ID of the chosen instance type (flavorId)
You can limit the list by specifying the creation region of your instance.
Retrieving the ID of the chosen image (imageId)
You can limit the list by specifying the creation region of your instance.
Retrieving your OpenStack SSH key ID (sshKeyId)
If you have not added an SSH key to your OVHcloud Control Panel yet, you can do so using the following call:
Deploying the instance
Once all the elements necessary for the deployment are gathered, you can use the following call:
You will need to fill in at least the following fields:
Once the call is complete, if all information is correctly filled in, the instance will be created with one or more network interfaces.
Depending on operating systems, you will need to manually configure your private network interfaces to be considered.
Because OpenStack is unable to prioritise the public interface of the vRack interface, the vRack interface may sometimes pass as the default route.
The direct consequence is that the instance is unreachable from a public IP.
One or more reboots of the instance from the Control Panel can resolve this situation.
The other solution is to connect to the instance via another server in the same private network. You can also correct the network configuration of the instance through Rescue mode.
In case of an existing instance
If you need to integrate an existing instance into the vRack, it is not possible to do so from your OVHcloud Control Panel. You will need to use Horizon, the OpenStack API or the OVHcloud APIv6.
The required action is simply to add a new network interface to your server, in addition to the existing one.
For example, if you have a public interface eth0, you will add the interface eth1.
The configuration of this new interface is rarely automatic. You will therefore need to set a static IP or configure DHCP, depending on your infrastructure.
The steps below describe how to manage your instances' network interfaces.
Retrieving the required information
Retrieving the project ID
Retrieving the instance ID
Retrieving the networkID of the public network (Ext-Net)
Retrieving the networkID of the private network (vRack interface previously created)
The identifier will have the form: "pn-xxxxx_yy" in which yy is the VLAN number.
Adding an interface to your instance
Once all the elements necessary are gathered, you can use the following call:
You will need to fill in at least the following fields:
Once the call is complete, if all information is correctly filled in, a new interface will be added to your instance.
Your OVHcloud instance will have a new network interface in addition to the public interface (Ext-Net).
In the instance summary, you can see the private IP address that is automatically assigned to your interface.
It is your responsibility to correctly configure the interface through DHCP or by using the proper IP addresses through a static IP configuration.
Removing an interface from your instance
Detaching a network interface is permanent.
However, it is important to note that if you detach the "Ext-Net" interface (public IP), this address will be released and put back into circulation. It is not possible to just reassign it.
This action is only required if you wish to isolate your server in the vRack (private network), or if you wish to remove it from one or more VLANs.
Once all the necessary information is retrieved, you can use the following call to remove an interface:
You will need to fill in at least the following fields:
Go further
Configuring vRack for Public Cloud
First steps with the OVHcloud API
If you need training or technical assistance to implement our solutions, contact your sales representative or click on this link to get a quote and ask our Professional Services experts for assisting you on your specific use case of your project.
Join our community of users on https://community.ovh.com/en/.