Scale Nex!™ onto a new Cloud Provider Region

To ensure robust resiliency, it is preferable to deploy applications on a cluster across multiple regions

Scale up on a new region

Nex!™ Region Configuration

The regions configuration is located in the Ansible files, see the provided minimum example.

Configuration for a region must be provided for gateway, routing, compute and storage

When the configuration has been updated, Nex!™ instance must be re-configured by running the Ansible deployment scripts.

Launch the Nex!™ racks on target region

From the rails console of the Nex!™ instance, run the following

# Set targeted region
region = 'australiaeast'

# Start GatewayRack
r = GatewayRack.create!(vpc_region: region, stack: 'nat')
r.provision!

# Iterate until the rack has been provisioned
r.reload.status


# Start RoutingRack
r = RoutingRack.create!(vpc_region: region)
r.provision!

# Iterate until the rack has been provisioned
r.reload.status


# Start ComputeRack
r = ComputeRack.create!(vpc_region: region)
r.provision!

# Iterate until the rack has been provisioned
r.reload.status
r.reload.status


# Start StorageRack
r = StorageRack.create!(vpc_region: region)
r.provision!

# Iterate until the rack has been provisioned
r.reload.status

Change existing App and Addon balancing

From the rails console of the Nex!™ instance, run the following

# Find your application
a = App.find_by(name: 'clueless-turkey')
# Configure regions balancing accordingly
a.update_attributes(opts: a.opts.merge('region_balancing' => 'australiasoutheast=1,australiaeast=1'))

And then restart App from Nex!™ Client

Spool down a specific region

To remove a region from Nex!™, the following can be run

# Set all Applications and Addons region balancing accordingly
App.all.each { |a| a.update_attributes(opts: a.opts.merge('region_balancing' => 'australiasoutheast=1'), preferred_region: 'australiasoutheast') }
Addon.all.each { |a| a.update_attributes(opts: (a.opts || {}).merge('region_balancing' => 'australiasoutheast=1')) }

# For all Compute Racks to tear down
cr = ComputeRack.find 51
cr.available_pu = -1000
cr.save
cr.cube_instances.each { |e| e.cluster.reload.restart; sleep 3 }

Then using the Nex! client, make sure the racks have been freed-up

nex-cli racks

+---------+----+--------------------+--------+---------+------------+-----+----------+---------------+--------------------------------------+
|                                                               Compute Racks                                                               |
+---------+----+--------------------+--------+---------+------------+-----+----------+---------------+--------------------------------------+
| TYPE    | ID | REGION             | STACK  | STATUS  | IIP        | EIP | CAPACITY | MACHINE SIZE  | MACHINE ID                           |
+---------+----+--------------------+--------+---------+------------+-----+----------+---------------+--------------------------------------+
| compute | 51 | australiaeast      | docker | running | 10.51.2.13 | -   | 0/256    | Standard_F16s | 7e0cdaa2-ceec-4a5c-8935-ed45cb1716c9 |
| compute | 61 | australiasoutheast | docker | running | 10.50.2.11 | -   | 70/256   | Standard_F16s | 4c736426-d9f0-44b1-af4c-77a8e497eb65 |
+---------+----+--------------------+--------+---------+------------+-----+----------+---------------+--------------------------------------+

The racks can then be stopped from the Rails console

ComputeRack.find(51).stop!
ComputeRack.find(51).recalculate_usage