https://img.shields.io/badge/Chameleon-Open%20Notebook-brightgreen

Making a reservation

First, select which project and site you wish to authenticate against.

[ ]:
import chi

chi.use_site('CHI@UC')
# Set to your project's charge code
chi.set('project_name', 'CH-XXXXXX')

Reserve a bare metal node.

Multiple nodes can be reserved at once by changing the count variable. This example makes a reservation for the “compute_haswell” node type. See here for a complete list of node types available currently.

Functions used in this example:

[ ]:
from chi.lease import lease_duration, add_node_reservation, create_lease

lease_name = "myLease"
node_type = "compute_haswell"
start_date, end_date = lease_duration(days=1)

# Build list of reservations (in this case there is only one reservation)
reservations = []
add_node_reservation(reservations, count=1, node_type=node_type)
# Create the lease
lease = create_lease(lease_name, reservations, start_date=start_date,
                     end_date=end_date)

Reserve a floating IP.

While it’s possible to allocate a floating IP ad hoc from Chameleon most of the time, there are a limited amount of IPs and they are sometimes exhausted. You can reserve a floating IP to ensure you have access to one to attach to your experimental nodes to allow, e.g., external SSH connectivity.

See here for some tips on how to make the most out of a single floating IP, which can help you avoid excessive charges.

Functions used in this example:

[ ]:
from chi.lease import lease_duration, add_fip_reservation, create_lease

lease_name = "myLease"
start_date, end_date = lease_duration(days=1)

# Build list of reservations (in this case there is only one reservation)
reservation_list = []
add_fip_reservation(reservation_list, count=1)

# Create the lease
lease = create_lease(lease_name, reservation_list, start_date=start_date,
                     end_date=end_date)

Reserve a VLAN segment.

This example illustrates how to reserve an isolated VLAN in order to ensure your network experiment is not subject to cross-traffic from other experimenters.

This is also how you reserve stitchable VLANs provided through ExoGENI. For these VLANs, you must set physical_network to “exogeni”.

Functions used in this example:

[ ]:
from chi.lease import lease_duration, add_network_reservation, create_lease

lease_name = "myLease"
network_name = f"{lease_name}Network"
of_controller_ip = None
of_controller_port = None
vswitch_name = None
physical_network = "physnet1"
start_date, end_date = lease_duration(days=1)

# Build list of reservations (in this case there is only one reservation)
reservations = []
add_network_reservation(reservations,
                        network_name=network_name,
                        of_controller_ip=of_controller_ip,
                        of_controller_port=of_controller_port,
                        vswitch_name=vswitch_name,
                        physical_network=physical_network)

# Create the lease
lease = create_lease(lease_name, reservations, start_date=start_date,
                     end_date=end_date)

Reserve multiple types of resources in a single lease.

[ ]:
from chi.lease import (
    lease_duration, add_node_reservation, add_network_reservation,
    add_fip_reservation, create_lease)

lease_name = "myLease"
start_date, end_date = lease_duration(days=1)

# Build list of reservations
reservations = []
add_node_reservation(reservations, count=1, node_type="compute_haswell")
add_network_reservation(reservations, network_name=f"{lease_name}Network")
add_fip_reservation(reservations, count=1)

# Create the lease
lease = create_lease(lease_name, reservations, start_date=start_date,
                     end_date=end_date)