Reserved Instances

Reserved Instances are guaranteed available virtual private servers. They are compute capacity reservations of a specific type and location. In AWS, they are called Reserved Instances. In Azure, they are pre-paid Virtual Machines. There is no analog in GCE, where pricing changes retroactively based upon usage. This class inherits from TopLevelResource and has direct access to the resource’s database object. The following attributes are directly accessible:

attr resource_id:
 The primary resource identifier that takes the form of a prefix followed by numbers and letters
attr organization_service_id:
 The ID of the parent organization service (cloud)
attr reservation_id:
 The cloud-assigned ID of the reservation
attr reservation_type:
 The type of reservation, e.g., compute, database
attr type_id:The ID of the type of reservation
attr region_name:
 The region where the reservation exists
attr zone:The availability zone where the reservation exists
attr offering_class:
 The class of reservation, e.g., standard or convertible
attr offering_type:
 The type of instance included in the reservation
attr state:The state of the reservation, e.g., whether it is active, pending modification, or retired
attr start:The start time of the reservation
attr expiration:
 The expiration of the reservation
attr duration:The duration of the reservation, e.g., 1 year
attr usage_price:
 If not paid fully in advance, the monthly price of the reservation
attr fixed_price:
 The upfront price of the reservation
attr instance_count:
 The number of instances in the reservation
attr product_description:
 The tenancy of the reservation, e.g., whether instances are physically or virtually isolated
attr scope:The scope of the reservation, i.e., whether it is region-wide or specific to an availability zone
class DivvyResource.Resources.instancereservation.InstanceReservation(resource_id)

Bases: DivvyResource.Resources.toplevelresource.TopLevelResource

Reserved Instance operations

static get_db_class()
static get_provider_id_field()

Reserved instances are not named by the user. We return the reservation ID here.

static get_resource_name_field()
static get_resource_type()
handle_resource_created(user_resource_id=None, project_resource_id=None)

This is called when a resource is created/discovered after initial data harvesting. It provides an opportunity for post-addition hooks (assignment to groups, alerts, etc.).


This is called when a resource is destroyed and before removal from the database. It provides an opportunity for pre-destruction hooks (removal from groups, alerts, etc.).

handle_resource_modified(resource, *args, **kwargs)

This is called when a resource is modified after the new data has been updated in the DB session. It provides an opportunity for post-modification hooks.

top_level_resource = True