Versions Compared

Key

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

...

Before getting started, be sure to source your openrc file.

...

 Key Pairs

  • A key pair is required before launching an instance, as the public key needs to be injected into the instance during the provisioning process. The following command will generate the pair, and output the private key: 

    Code Block
    $ openstack keypair create <key_name> >> my_key.pem

...

  • And to list existing key pairs (you guessed it): 

    Code Block
    $ openstack keypair list 

...

Security Groups

  • As outlined in the Basic Guide, modifying the default security group to permit ICMP and ssh means that you don’t need to assign specific security groups to an instance in order to do simple troubleshooting (ping or traceroute) or gain access: 

    Code Block
    $ openstack security group rule create --proto icmp --src-ip 0.0.0.0/0 default
    $ openstack security group rule create --proto icmp --src-ip ::/0 default
    $ openstack security group rule create --proto tcp --src-ip 0.0.0.0/0 --dst-port 22 default
    $ openstack security group rule create --proto tcp --src-ip ::/0 --dst-port 22 default

...

  • When an entire security group is no longer required, the whole group is deleted with: 

    Code Block
     $ openstack security group delete <security_group_name>

...

Instances

Most of the commands for manipulating and managing instances is with openstack server. This command is quite extensive, allowing creation, deletion, starting, stopping, adding/removing security groups, adding/removing volumes and more. Refer to the OpenStack server command-object documentation for more information. openstack flavor list, openstack flavor show <flavor_name> and openstack image list, openstack image show ‘<image_name>’ can provide information as to what flavors and images are available.

...

  • Detach a volume. This is not a destructive action and data on the volume is left intact: 

    Code Block
     $ openstack server remove volume <instance_name> <volume_name>

...

Floating IPs

As discussed previously, networking with respect to the assignment of IP addresses in the Rapid Access Cloud is handled automatically during provisioning, with the exception of public IPv4 addresses referred to as floating IPs in OpenStack. There is a single pool that floating IPs are allocated from, named ‘nova’ and by default each project is permitted a single IP from this pool:

...

  • Return allocated IP address to pool: 

    Code Block
    $ openstack ip floating delete <ip_address> 

...

Volumes

Note

OpenStack instances are intended to be ephemeral, that is the storage associated with the instance is not meant to retain data for any length of time.

...

  • Delete a volume. This is a destructive action and all data associated with the volume is lost

    Code Block
     $ openstack volume delete <volume_name>

...

Snapshots and

...

Images

While it is true that instances in the Rapid Access Cloud are intended to be ephemeral, it is still possible to capture the state of an instance at any moment and save it as an image that can in turn be provisioned in a similar fashion to deploying a new instance using openstack server create as outlined above. This permits the ability to back-up an instance for safe keeping or create a base image with required applications already installed if you want to rapidly deploy many instances with a similar role. Volume snapshots are point-in-time stateful ‘freeze’ of a volume, meaning the volume itself cannot be attached after a snapshot is taken. (see volumes above for creating new volumes from snapshots)

...