← Back to team overview

nova team mailing list archive

Re: Instance IDs and models in the ORM world

 

Hi Ewan,

On Sat, Oct 2, 2010 at 10:46 AM, Ewan Mellor <ewan.mellor@xxxxxxxxxxxxx>wrote:

> On Sat, Oct 02, 2010 at 03:29:57PM +0100, Ewan Mellor wrote:
>
> > In the documentation for the nova.virt layer (in nova.virt.fake) I wrote:
> >
> >     An instance has an ID, which is the identifier chosen by Nova to
> represent
> >     the instance further up the stack.  This is unfortunately also called
> a
> >     'name' elsewhere.  As far as this layer is concerned, 'instance ID'
> and
> >     'instance name' are synonyms.
> >
> >     Note that the instance ID or name is not human-readable or
> >     customer-controlled -- it's an internal ID chosen by Nova.  At the
> >     nova.virt layer, instances do not have human-readable names at all --
> such
> >     things are only known higher up the stack.
> >
> > Is this true any longer?  Looking at nova.db.sqlalchemy.Instance I see
> > fields named id, ec2_id, display_name, and display_description.  What are
> > the semantics of these fields?  How far are these concepts supposed to
> > propagate down the stack?
>

id is the primary key in sqlalchemy -- not stable if we move b/w databases
or shard, so not a candidate for uniquely identifying the instance for all
time.

ec2_id USED TO be the string that the EC2 API used to identify the instance
to the user.

ec2_id is being renamed (in a branch that hasn't hit trunk yet) to
'internal_id' and becoming a long int.  That is the canonical identifier for
an instance, unique for all time and unchanging throughout the life of the
instance.

The EC2 and Rackspace API modules convert 'internal_id' to and from an
API-specific form suitable for showing to users -- in the EC2 case, it's
converted to

  "i-%s" % base_36_representation_of(internal_id)

I've seen some code referring to 'ec2_id' as 'instance_id' (in method params
and such), which is just confusing; I'll be renaming those to internal_id
for consistency before Austin.

I don't know what display_name and display_description are about.

Michael


Confidentiality Notice: This e-mail message (including any attached or
embedded documents) is intended for the exclusive and confidential use of the
individual or entity to which this message is addressed, and unless otherwise
expressly indicated, is confidential and privileged information of Rackspace.
Any dissemination, distribution or copying of the enclosed material is prohibited.
If you receive this transmission in error, please notify us immediately by e-mail
at abuse@xxxxxxxxxxxxx, and delete the original message.
Your cooperation is appreciated.


Follow ups

References