Red Hat Training

A Red Hat training course is available for Red Hat Fuse

1.9. Terminate Instances

Terminating EC2 instances

Terminating an EC2 compute instance means that the instance is completely destroyed and the hardware resources are returned to the pool. In contrast, stopping an instance (which is possible for some machine images) merely shuts down the processes running on the instance, preserving any data and software on the instance.
You can use either of the following approaches to terminate instances on Amazon EC2:
Important
You should always terminate instances when you are finished with them, in order to minimize usage charges. Stopping an instance is not the same as terminating an instance

Terminate individual instances

The cleanest way to terminate an individual compute instance is to use the fabric:container-delete console command, as follows:
  1. Log on to the remote Fabric Server on EC2, using the client utility:
    ./client -u admin -p admin -h 50.19.18.91
  2. Enter the following console command:
    Fabric8:admin@registry> fabric:container-delete mqserver
The advantage of this command is that all of the corresponding entries in the Fabric Registry are cleaned up, before the container's compute instance is terminated.

Terminate all containers

You can quickly terminate all of your compute instances on the EC2 cloud using the jclouds:node-destroy-all command, as follows:
  1. Start up your local container:
    ./fuse
  2. Enter the following console command:
    JBossFuse:karaf@root> jclouds:node-destroy-all
Note
This example assumes that your entire fabric is hosted in the cloud, so that you do not need to worry about the consistency of registry entries when you delete it. This approach would not be appropriate, however, if you have a fabric that overlaps with host machines outside the cloud.