Nova compute

This is the heart of the OpenStack compute resource management service. Its purpose is to identify and appropriate compute resources based on demand. It also has the responsibility of controlling the system hypervisor and virtual machines. Nova will work with several VMs, as mentioned, such as VMware or Xen, or it can manage containers. On-demand scaling is part and parcel of any cloud offering. 

Nova is based on a RESTful API web service for simplified control. 

To get a list of servers one would GET the following into Nova through the API:

 {your_compute_service_url}/servers

To create a bank of servers (ranging from a minimum of 10 and a maximum of 20) we would POST the following:

{
    "server": {
        "name": "IoT-Server-Array",
        "imageRef": "8a9a114e-71e1-aa7e-4181-92cc41c72721",
        "flavorRef": "1",
        "metadata": {
            "My Server Name": "IoT"
        },
        "return_reservation_id": "True",
        "min_count": "10",
        "max_count": "20"
    }
}

Nova would respond with a reservation_id:

{
    "reservation_id": "84.urcyplh"
}

Thus, the programming model is fairly simple in order to manage the infrastructure.

The Nova database is needed to maintain the current state of all objects in the cluster. For example, a few of the states the various servers in the cluster can include are:

  • ACTIVE: Server is actively running
  • BUILD: Server is in the process of being built and is not completed
  • DELETED: Server has been deleted
  • MIGRATING: Server is migrating to a new host

Nova relies on a scheduler to determine which task to execute and where to execute it. The scheduler can associate affinity randomly or use filters to choose a set of hosts that best match some sets of parameters. The filter end product will be an ordered list of host servers to use from best to worst (with incompatible hosts removed from the list).  

The following is the default filter used to assign server affinity:

scheduler_available_filters = nova.scheduler.filters.all_filters

A custom filter can be created (for example, a Python or JSON filter called IoTFilter.IoTFilter) and attached to the scheduler as follows:

scheduler_available_filters = IoTFilter.IoTFilter

To set a filter to find servers that have 16 VCPUs programmatically through the API, we construct a JSON file as follows:

{
    "server": {
        "name": "IoT_16",
        "imageRef": "8a9a114e-71e1-aa7e-4181-92cc41c72721",
        "flavorRef": "1"
    },
    "os:scheduler_hints": {
        "query": "[>=,$vcpus_used,16]"
    }
}

Alternatively, OpenStack also allows you to control the cloud through a command-line interface:

$ openstack server create --image 8a9a114e-71e1-aa7e-4181-92cc41c72721 
  --flavor 1 --hint query='[">=","$vcpus_used",16]' IoT_16

OpenStack has a rich set of filters to allow for the custom allocation of servers and services. This allows for very explicit control of server provisioning and scaling. This is a classic and very important aspect of cloud design. Such filters include but are not limited to:

  • RAM size
  • Disk capacity and type
  • IOPS levels
  • CPU allocation
  • Group affinities
  • CIDR affinity
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.211.87