Jump to: navigation, search

Difference between revisions of "RetainGlanceMetadata"

 
Line 8: Line 8:
 
When creating a bootable volume from a commercial image, it is proposed that the Glance metadata stored for the original image be retained by Cinder. This data need not be accessible by the end user. The intent is to retain licensing and charging information for the billing system.
 
When creating a bootable volume from a commercial image, it is proposed that the Glance metadata stored for the original image be retained by Cinder. This data need not be accessible by the end user. The intent is to retain licensing and charging information for the billing system.
  
Further to this, when cloning a volume with retained metadata, the metadata should also be stored in the clone. The clone copy may extend the metadata, but the core Glance data should remain unaltered. Again the intent is to track clone instances and bill correctly for licensed images.
+
Further to this, when cloning a volume with retained metadata, the metadata should also be stored for the clone. The clone copy may extend the metadata, but the core Glance data should remain unaltered. Again the intent is to track clone instances and bill correctly for licensed images.
 
 
'''Alternative'''
 
 
 
Another alternative is to instead create an entry in the Glance system, which references the Cinder volume rather than the Swift object, but copies the original image metadata, and thus uses the Glance system to store the licensing and billing information.
 
 
 
This alternative also requires that cloned volumes likewise create a record in Glance, or instead references the original Cinder entry so that billing and licensing data is retained for the clone.
 
  
 
== Release Note ==
 
== Release Note ==
Line 22: Line 16:
 
== Rationale ==
 
== Rationale ==
  
There is a requirement for cloud providers to be able to charge additional fees on a per-instance or per-usage rate for certain images. For example, a commercial cloud appliance, or an operating system which has a usage or licensing charge. The intent is to save this pricing data in the Glance metadata, and to pass this data on to the billing subsystem as needed.
+
There is a requirement for cloud providers to be able to charge additional fees on a per-instance or per-usage rate for certain images. For example, a commercial cloud appliance, or an operating system which has a usage or licensing charge. The intent is to save this metadata in the Cinder/nova-volumes table, and to pass this data on to the billing subsystem as needed.
 
 
However, where a user creates a bootable volume in Cinder from a commercial image and does not immediately create an instance from it, there is a danger that the licensing or billing information stored in Glance will be lost and incorrect billing records will be produced. Similarly, where a clone is taken from a volume produced from a commercial image, the metadata could also be lost.
 
  
 
== User stories ==
 
== User stories ==
  
'''Alternative 1'''
+
* The user creates a bootable volume from an image.
 
 
* The user creates a bootable volume from a commercial image.
 
 
* The source of the volume and the Glance metadata are retained by Cinder.
 
* The source of the volume and the Glance metadata are retained by Cinder.
 
* Once an instance is booted from this volume, a billing record is created, referencing the Glance metadata.
 
* Once an instance is booted from this volume, a billing record is created, referencing the Glance metadata.
 
* If the volume is cloned, the metadata stored by Cinder is also cloned.
 
* If the volume is cloned, the metadata stored by Cinder is also cloned.
 
'''Alternative 2'''
 
 
* The user creates a bootable volume from a commercial image.
 
* A Glance image record is created.
 
* The object reference is set to the Cinder volume rather than the Swift object.
 
* The metadata is copied (and extended) from the original image metadata.
 
* If the volume is cloned, the cloning operation creates another Glance image record.
 
  
 
== Assumptions ==
 
== Assumptions ==
Line 48: Line 30:
  
 
== Implementation ==
 
== Implementation ==
 +
 +
A new table needs to be created in the Cinder database, with the name '''volume_glance_metadata''' with the following structure:
 +
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
|-
 +
|-
 +
|  id
 +
|-
 +
|  volume_id
 +
|-
 +
|  key
 +
|-
 +
|  value
 +
|}
 +
 +
The table will retain the Glance metadata as a series of '''key''' = '''value''' pairs and has a ''many-to-one'' relationship with the '''volumes''' table.
  
 
=== Migration ===
 
=== Migration ===

Revision as of 16:57, 27 August 2012

Summary

When creating a bootable volume from a commercial image, it is proposed that the Glance metadata stored for the original image be retained by Cinder. This data need not be accessible by the end user. The intent is to retain licensing and charging information for the billing system.

Further to this, when cloning a volume with retained metadata, the metadata should also be stored for the clone. The clone copy may extend the metadata, but the core Glance data should remain unaltered. Again the intent is to track clone instances and bill correctly for licensed images.

Release Note

The end-user impact should be minimal. Ideally if the source image is licensed in a different way, such as a per-instance license fee or per-hour usage fee, this should be reflected in the describe-volume API so the user can clearly see that instances booted from the volume will be charged at an alternate rate. The simplest way to achieve this is to display the metadata in raw (and read-only) form. If using the Glance alternative, then there are no end-user changes as the information is retained in Glance.

Rationale

There is a requirement for cloud providers to be able to charge additional fees on a per-instance or per-usage rate for certain images. For example, a commercial cloud appliance, or an operating system which has a usage or licensing charge. The intent is to save this metadata in the Cinder/nova-volumes table, and to pass this data on to the billing subsystem as needed.

User stories

  • The user creates a bootable volume from an image.
  • The source of the volume and the Glance metadata are retained by Cinder.
  • Once an instance is booted from this volume, a billing record is created, referencing the Glance metadata.
  • If the volume is cloned, the metadata stored by Cinder is also cloned.

Assumptions

Design

Implementation

A new table needs to be created in the Cinder database, with the name volume_glance_metadata with the following structure:

id
volume_id
key
value

The table will retain the Glance metadata as a series of key = value pairs and has a many-to-one relationship with the volumes table.

Migration

Unresolved issues