Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Note
title

Note

All sample code in this section is written in Python using the Amazon Boto AWS API client library.

Before pre-provisioning and launching Infoblox vNIOS for AWS instances, ensure that you have completed the following:

  • Configure the AWS API Proxy based on your deployment, as described in Setting Up the Infoblox AWS API Proxy;

  • For CLI operations, configure an Amazon API client system to work with your API Proxy, as described in theSetting Up an API Client section;

  • Obtain and install pool licenses and create license pools on the Grid Master. (For information on license pools and dynamic licensing, see the Infoblox NIOS Documentation.) To obtain your pool licenses, consult your Infoblox Sales representative.

The following examples rely on the following two declarations:

...

The first declaration initializes a connection object in Python for the AWS VPC API endpoint. The second declaration
initializes a connection object to the AWS EC2 API endpoint.

...

Creating New VPC with Specific Tenant and Network View

...

...

This example shows the recommended API Client process to set the AWS VPC's DHCP options to specify a Infoblox vNIOS for AWS instance as the DNS server. This ensures that the NIOS Grid is the management for the VPC's DNS domain.
The network view must already be created in NIOS.
You use the CreateVpc workflow to define a new virtual private cloud. In the sample python script, you can issue the following sample directives:

...

##The vpc_id is the value Amazon passes to NIOS.

...

...

Creating New Subnet in VPC with no Extensible Attributes

You use the CreateSubnet workflow to create a new Subnet in an Amazon VPC. The following example is relatively straightforward, without use of any Infoblox extensions to search or define EA values:

...

The next example shows how you can pass an explicit prefix value to create the new subnet.

## or pass explicitly - which AWS DOES support) cird_and_exts - '10.10.1.1/26'

subnet = vpc_conn.create_subnet(vpc_id=vpc.id, cidr_block=cidr_and_exts)

print 'Subnet ID: %s, State: %s' % (subnet.id, subnet.state)

Adjust the CIDR and prefix values to suit your requirements.

The subnet.id value is passed to NIOS, and is used for other operations including creating new instances as described in the following section.

...

Creating New Instance in EA-Selected Subnet

...

...

The following script segment calls an Amazon virtual machine shape ID and refers to the AWS subnet for the VPC created in the previous section, CreatingNewSubnetinVPCwithnoExtensibleAttributes.
You use the Run Instances workflow to define a new virtual private cloud, combined with Infoblox extensions built into the API query request.

...

The IP for the new instance is automatically selected by NIOS from the subnet you previously created.
The next usage example includes the following:

  • Use of an Extensible Attribute to select the VPC subnet in which to provision the VM;

  • Specifying an FQDN for the Host record.

## Start a VM instance in AWS on the subnet created above, with the next available IP

...

## and create a DNS record with the specified host name.

## The DNS zone corp100.com must be created manually using a subnet search by EA.

...

(inst.id, inst.private_ip_address, inst._state.name)

...

Allocating and Associating an Amazon Elastic IP

This short script segment allocates an Amazon Elastic IP to be used for an instance. The Elastic IP always needs to have a Host name (X-IB-Host-Name) and the Infoblox Network View extension (X-IB-Network-View).

...