Changes between Version 28 and Version 29 of GAPI_AM_API_DRAFT


Ignore:
Timestamp:
02/28/12 21:21:09 (13 years ago)
Author:
Aaron Helsinger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GAPI_AM_API_DRAFT

    v28 v29  
    33= GENI Aggregate Manager API Draft Revisions =
    44
    5 This page documents DRAFT revisions to the GENI Aggregate Manager API, proposed for the next version of the API. As indicated below, many of the revisions documented here have been agreed to in discussions on the GENI developer mailing list, and during at least one GEC, but not formally adopted. Well behaved aggregates will typically already implement such revisions. Other revisions are in early discussions and subject to change or abandonment.
    6 
    7 The GENI Aggregate Manager API allows aggregates to advertise resources and to allocate resources to Slices in the form of Slivers. A Sliver is the set of resources allocated by one Aggregate to one Slice.
     5This page documents DRAFT revisions to the GENI Aggregate Manager API, proposed for the next version of the API. As indicated below, some of the revisions documented here have been discussed on the GENI developer mailing list, and during at least one GEC. Other revisions are in early discussions and subject to change or abandonment.
     6
     7The GENI Aggregate Manager API allows aggregates to advertise resources and to allocate resources to Slices in the form of Slivers. A Sliver is a set of resources allocated by one Aggregate to one Slice. See below for a proposed complete definition.
    88
    99The current officially adopted version of the API is '''2''' and is documented on [wiki:GAPI_AM_API the main API page].
     
    1616
    1717This page documents proposed changes for AM API version '''3'''. These changes are grouped into sets. API Version 3 will be the collection of changes from the change sets below which we next agree on. Change sets still under discussion will then be targeted at a future release.
    18  C. Undefined proposal: Support for !UpdateSliver.
    19  D. Undefined: Support for clients manipulating individual slivers or groups of slivers at an aggregate.
    20  E. Undefined: Tickets, otherwise known as negotiated reservations.
    21 
    22 == Summary of Proposed Changes ==
    23 === Change Set C: !UpdateSliver ===
    24 
    25 This change set is new, not implemented, and currently under discussion.
    26 
    27  * Add a method !UpdateSliver, which adds, removes or modifies resources allocated the slice at the given aggregate, to match the new request RSpec supplied as an argument
    28  * See the discussion below.
    29 
    30 === Change Set D: Slivers and Sliver groups ===
    31 
    32 This change is TBD. The current proposal is to do nothing. See the discussion below.
    33 
    34 === Change Set E: Tickets ===
    35 
    36 This change is TBD. There is no concrete proposal yet on how to introduce tickets. See the discussion below.
    3718
    3819== Proposing Additional Changes ==
     
    4324Specific questions may be directed to the software team at the GPO (Tom Mitchell, Aaron Helsinger, and Sarah Edwards) at {tmitchel, ahelsing, sedwards} at geni.net
    4425
    45 == Proposed Change Details ==
    46 
    47 === Change Set C: !UpdateSliver ===
    48 ''Note: This set of changes is currently under active discussion and has gotten no unofficial or official agreement.''
    49 
    50 A common complaint among experimenters about the current AM API V1 is that there is no way to add or remove resources from a slice at an aggregate, without completely deleting the slice at that aggregate and recreating it, possibly losing resources to another experimenter and certainly losing state. This proposal aims to address that, by introducing a method to update the slice at an aggregate.
    51 
    52 The [http://svn.planet-lab.org/attachment/wiki/WikiStart/sfa.pdf SFA] calls for an !UpdateSlice method, "to request that additional resources—as specified in the RSpec—be allocated to the slice".
     26= Proposed changes for GENI Aggregate Manager API version 3 =
     27
     28This page documents a long list of proposed changes for AM API version 3. These changes provide ways for aggregates to expand GENI functionality, without requiring further API modifications.
     29
     30There are many changes here. As such, aggregates may implement these to varying degrees.
     31 - Clients are reminded that these methods are requests - based on the AM type and resource types, these requests may fail or not make sense. Clients should watch for {{{UNSUPPORTED}}} returns.
     32 - AMs are encouraged to implement as much of this API as reasonable to provide a common front for clients. When a function is not possible, return {{{UNSUPPORTED}}}, document publicly what functions do work, and suggest alternative ways to get the result the client desired.
     33
     34= Summary =
     35== Proposed Changes ==
     36At the top level, the proposed changes for AM API v3 include:
     37 - [#ChangeSetC:UpdateSlivers Change Set C]: Add the ability to !UpdateSlivers to immediately modify your reservation
     38 - [#ChangeSetD:Sliver-specificoperations Change Set D: Slivers]: Change methods to clarify that there may be multiple slivers per slice at an AM, and to allow operating on individual slivers
     39 - [#ChangeSetE:Tickets Change Set E: Tickets]: Add methods using tickets to do negotiated reservations
     40 - [#ChangeSetF1:DefineSliverStates Change Set F1]: Define sliver states, and the state changes that various methods cause
     41 - [#ChangeSetF2:ActOnSlivers Change Set F2]: Add a new general !ActOnSlivers method allowing AMs to support AM and resource-type specific operations
     42 - [#ChangeSetG:Credentialsaregeneralauthorizationtokens. Change Set G]: Generalize the credentials argument, allowing ABAC support
     43 - Change Set H: Clarify: A second call to !CreateSlivers without an intervening !DeleteSlivers is an error.
     44 - Change Set I1: !SliversStatus return structure includes sliver expiration
     45 - Change Set I2: !SliversStatus return includes SSH logins/key for nodes that support SSH access
     46 - Change Set I3: !CreateSlivers return becomes a struct, adds sliver expiration
     47 - Change Set I4: !CreateSlivers optionally does not start resources.
     48 - [#ChangeSetJ:Proxyaggregatemanagersaresupported Change Set J]: Support proxy aggregates with 1 new option and 1 new !GetVersion entry
     49 - [#ChangeSetK:Standardizecertificatesandcredentials Change Set K]: Standardize certificate contents, etc
     50  - Include a real serial number, holder email, holder uuid, and optionally authority URL in certificates
     51  - Define slice ID as the UUID in slice certificates
     52  - Define slice name, sliver name, and user name restrictions, and similar for URNs
     53  - Publish schemas for credentials and certificates
     54 - [#ChangeSetL:ChangeSFAcredentialsprivileges Change Set L]: Standardize slice credential privileges
     55
     56For a  full listing of the proposed API methods after all these changes, see [#Changesummary-methodsignatures below].
     57
     58== Unspecified items ==
     59 - Define the ticket service classes
     60 - Publish ticket schema
     61 - Publish credential schema
     62 - Define error codes returned by new methods, conditions
     63
     64-----
     65
     66= Change Set C: !UpdateSlivers =
     67Add an ability for experimenters to modify their allocated resources at an aggregate without deleting (and possibly losing) existing resource allocations.
     68
     69== Motivation ==
     70A common complaint among experimenters about the current AM API is that there is no way to add or remove resources from a slice at an aggregate, without completely deleting the slice at that aggregate and recreating it, possibly losing resources to another experimenter and certainly losing state. This proposal aims to address that, by introducing a method to update the slice at an aggregate.
     71
     72The  [http://svn.planet-lab.org/attachment/wiki/WikiStart/sfa.pdf SFA] calls for an !UpdateSlice method, "to request that additional resources—as specified in the RSpec—be allocated to the slice".
    5373
    5474In the !PlanetLab implementation of the SFA, !UpdateSliver is in fact a synonym for !CreateSliver - the server will ensure that your allocated resources match your request RSpec, adding, removing and modifying resources as needed. It immediately allocates and boots nodes to match the request RSpec.
    5575
    56 The ProtoGENI CMV2 API has [http://www.protogeni.net/trac/protogeni/wiki/ComponentManagerAPIV2#UpdateSliver UpdateSliver], which is described as the way to "Request a change of resources for an existing sliver. The new set of resources that are desired are specified in the rspec." At ProtoGENI as at !PlanetLab, this method takes the full RSpec description of resources the experimenter wants, and the server computes the difference with what the experimenter already has. At ProtoGENI though, this method returns a ticket. The experimenter must then redeem the ticket to actually acquire the resources. Then the experimenter manually calls !RestartSliver as needed on nodes that need to be rebooted, when the experimenter is ready to do so. This takes an extra step, but gives the experimenter full control over which nodes are restarted and when.
    57 
    58 Some key properties and differences of this method at those two aggregate code-bases, with a note on the alternatives. The community must discuss the options:
    59  - Takes the full description of what the experimenter wants, and the server computes the difference. Note that 2 experimenters with permissions to modify the slice (say, 2 students of a professor) could issue conflicting update calls on the same aggregate. And alternative would be that experimenters must compute the difference themselves, and would just specify the incremental changes they want in their reservation.
    60  - Atomic: either the full request succeeds, or it fails. The alternative would be that if the experimenter wanted 5 more nodes and only 3 were available, that the server could give you those 3.
    61  - The two implementations above differ on whether the changes are immediate or not. ProtoGENI uses tickets, allowing the experimenter to change their mind or coordinate their requests (See below). They also separate out reservation of the resources with restarting nodes. This allows the experimenter to control which nodes get rebooted and when. !PlanetLab in comparison handles all restarting of nodes for the experimenters, giving them a single operation to get their resources. This approach also more closely matches the behavior of !CreateSliver in the AM API V1.
    62 
    63 ''The community must discuss the alternatives above.''
    64 
    65 This proposal was discussed at the [http://groups.geni.net/geni/wiki/GEC12GeniAmAPI GEC12 AM API session].
    66 
    67 The proposed new method:
    68 {{{
    69 struct UpdateSliver(string slice_urn,
     76The ProtoGENI CMV2 API has [http://www.protogeni.net/trac/protogeni/wiki/ComponentManagerAPIV2#UpdateSliver UpdateSliver], which is described as the way to "Request a change of resuorces for an existing sliver. The new set of resources that are desired are specified in the rspec." At ProtoGENI as at !PlanetLab, this method takes the full RSpec description of resources the experimenter wants, and the server computes the difference with what the experimenter already has. At ProtoGENI though, this method returns a ticket. The experimenter must then redeem the ticket to actually acquire the resources.
     77
     78This topic was discussed at the [http://groups.geni.net/geni/wiki/GEC12GeniAmAPI GEC12 AM API session] and on the GENI dev mailing list (in [http://lists.geni.net/pipermail/dev/2011-October/000433.html October] and [http://lists.geni.net/pipermail/dev/2011-November/000531.html November]).
     79
     80== !UpdateSlivers ==
     81This change would add a new method !UpdateSlivers, which takes a full request RSpec of the desired final state of the slice at this aggregate. This proposal calls for adding this functionality in the context of tickets: the !UpdateSlivers method returns a ticket. See [#ChangeSetE:Tickets Change Set E: Tickets] for details. If tickets are not adopted, consider the alternative proposal below, where !UpdateSlivers immediately allocates and starts the requested resources, as in !CreateSlivers.
     82
     83Some points about this change:
     84 - The method takes a full request RSpec - not a diff.
     85  - Note that we want the manifest to be readily modifiable to be a request (include component_ids and sliver_ids), but it is not yet.
     86  - AMs may, as always, return {{{UNSUPPORTED}}} - EG if they are incapable of determining what changes to apply (computing a diff).
     87 - The request is either fully satisfied, or fails (returns an error code).
     88 - AMs must document the level of service they provide: will any state be lost on existing resources?
     89  - Typically this would be a per node or resource-type specification.
     90  - Use the levels of guarantee in {{{geni_state_guarantee}}} below.
     91  - Default is to provide no guarantee.
     92  - This API does not define where AMs provide detailed documentation, but AMs must return this value for the entire change as part of the return struct.
     93 - Experimenters may specify what level of disruption they can tolerate, using the {{{geni_state_guarantee}}} below. AMs are expected to fail a request with a specified service guarantee that they cannot satisfy. Default is to request no guarantee.
     94 - Options includes {{{geni_end_time}}}, a RFC3339 requested end time for the reservation. See below for details.
     95  - If omitted, the AM may reserve the resources for the default sliver duration.
     96  - AMs should follow the logic of !RenewSlivers to determine if the requested duration of the sliver is acceptable.
     97  - The request should Fail (return an error code) if the resources cannot be reserved until the requested time.
     98
     99This change adds a new option {{{geni_state_guarantee}}} with these possible values (case insensitive string or integer):
     100 - 0=NO_GUARANTEE (default: all state ''may'' be lost)
     101 - 1=SAVE_DISK (disk state will be preserved but running processes will be lost)
     102 - 2=SAVE_DISK_AND_PROCESSES (both disk state and running processes will be preserved, like migrating a VM)
     103 - 3=NO_DISRUPTION (no noticeable service disruption)
     104
     105AMs which cannot meet the implied limit to service disruption should fail the request (return an error code).
     106
     107{{{
     108struct UpdateSlivers(string slice_urn, string credentials[], string rspec,
     109                                                 struct options)
     110}}}
     111
     112Returns a struct:
     113{{{
     114{
     115  string ticket=<ticket>
     116  string geni_status=<sliver state - ticketed>,
     117  string geni_state_guarantee=<promise from AM of what experimenter state will be lost on trying to 'start' this allocation>,
     118 <others that are AM specific>
     119}
     120}}}
     121
     122See [#ChangeSetE:Tickets Change Set E: Tickets] for details on the ticket returned and ticket semantics.
     123
     124== Alternative proposal: !UpdateSlivers with immediate allocation ==
     125An alternative proposal would add two versions of !UpdateSlivers. Method 1 would return a ticket as above. Method 2 would immediately allocate the resources, as with !CreateSlivers.
     126
     127This proposed version of !UpdateSlivers is substantially the same as the main proposal above, with a few differences:
     128
     129 - Under this alternative proposal, on success the new resources are allocated to the slice. As with !CreateSlivers, by default those new resources are initialized or booted or started, such that they will shortly become available for experimenter use.
     130 - As with !CreateSlivers, the AM should start/restart resources immediately, as necessary.
     131  - This change introduces a new option {{{geni_donotstart}}}. When supplied and true (boolean: 0 or 1 in XML-RPC), aggregates should allocate the resources but not start them. Experimenters will have to explicitly use !ActOnSlivers to start or restart resources as necessary. Note that there may be no such distinction for some resources.
     132   - Removed resources are stopped by the aggregate automatically.
     133 - Note that the tickets proposal includes a method that updates the resource reservation without allocating them.
     134 - This method moves the overall sliver state to {{{allocated}}}, and then (if the experimenter did not specify {{{geni_donotstart}}}) {{{configuring}}} and then {{{ready}}} if it succeeds.
     135
     136Proposed method signature:
     137{{{
     138struct UpdateSlivers(string slice_urn,
    70139                    string credentials[],
    71                     <GENIV3 request RSpec schema compliant XML string> rspec,
     140                    <GENI request RSpec schema compliant XML string> rspec,
    72141                    struct users[],
    73142                    struct options)
    74 Success Return:
    75 {
    76    code=0
    77    value= <GENI V3 Manifest RSpec string>
    78    option = <None>
    79 }
    80 }}}
    81 
    82 Proposed semantics:
    83  - RSpec argument is a complete request RSpec with the desired new end state for the slice at this aggregate. ''Open questions: Does the request schema support specifying sliver_ids or other attributes that were in the manifest RSpec, and which the experimenter might want or need to preserve in this RSpec?''
    84  - Atomic: the request either succeeds entirely or fails and the slice is not changed at the aggregate at all, with the aggregate returning a message indicating that it failed and why. Aggregates are encouraged to return enough information to allow the experimenter to modify the request such that it can succeed.
    85  - Resources are allocated and started or restarted immediately, on behalf of the experimenter (no tickets, and no separate call to restart the sliver)
    86 
    87 
    88 === Change Set D: Slivers and !SliverGroups ===
    89 ''Note: This set of changes is currently under active discussion and has gotten no unofficial or official agreement.''
    90 
    91 ''The current proposal in this change set is to do nothing. See the proposal for !UpdateSliver instead.''
    92 
    93 This proposal was discussed at the [http://groups.geni.net/geni/wiki/GEC12GeniAmAPI GEC12 AM API session].
    94 
    95 The current AM API calls take a Slice URN, and operate on all resources under that ID at the given aggregate - all the resources for that slice at the aggregate are allocated, renewed, and deleted together. There is no provision for releasing some of the resources allocated to the slice at that aggregate, or for adding new resources to the reservation for that slice at a given aggregate.
     143Return value
     144{
     145 string rspec=<manifest>,
     146 string geni_start_time=<optional (may be omitted altogether) RFC3339 start time for the allocation: now if not specified>,
     147 string geni_expires=<RFC3339 sliver expiration>,
     148 string geni_status=<sliver state - allocated or changing or ready>,
     149 string geni_state_guarantee=<promise from AM of what experimenter state will be lost on trying to 'start' this allocation>,
     150 <others that are AM specific>
     151}
     152}}}
     153
     154= Change Set D: Sliver-specific operations =
     155A slice may have multiple slivers at a single AM. Experimenters can operate on slivers independently, if the AM supports it. AMs define slivers as groups of resources, and give them locally unique sliver_urns for identifying that group of resources.
     156
     157== Motivation ==
     158This change set was discussed at the [http://groups.geni.net/geni/wiki/GEC12GeniAmAPI GEC12 AM API session].
     159
     160The current AM API calls take a Slice URN, and operate on all resources under that label at the given aggregate - all the resources for that slice at the aggregate are allocated, renewed, and deleted together. There is no provision for releasing some of the resources allocated to the slice at that aggregate, or for adding new resources to the reservation for that slice at a given aggregate.
    96161
    97162This ties closely to the precise definition of a Slice vs a Sliver. The current AM API methods imply that a sliver represents all resources at an aggregate for a given slice. However, this does not match the definition that previous GENI documents have used, nor the functionality that experimenters desire.
    98163
     164Previous GENI documents have used this definition:
    99165''A sliver is the smallest set of resources at an aggregate that can be independently reserved and allocated. A given slice may contain multiple slivers at a single aggregate. A sliver may contain multiple components.''
    100166
    101 As such, the current AM API methods in fact operate on a group of slivers.
    102 
    103 This change set would provide a means for experimenters to operate on individual slivers within their slice at a given aggregate, or perhaps to define and operate on arbitrary groups of slivers at a given aggregate.
    104 
    105 Specifically, this change would provide ways to:
    106  - Add resources to a slice at a given aggregate, where resources are already reserved - without having to delete and recreate the reservation at the aggregate. But for this capability, see the !UpdateSliver proposal above.
    107  - Delete specific resources (slivers) from a reservation at an aggregate, without losing other resources. For this capability, see the !UpdateSliver proposal above. Alternatively, !DeleteSliver could be modified to take 'either' a {{{slice_urn}} (as it does currently), or a {{{sliver_urn}}}, such as is returned in a manifest RSpec.
    108  - Renew the reservation on specific resources (slivers) within a reservation at an aggregate, while allowing other resource reservations to expire. However, it is unclear whether this particular function would be useful.
    109  - Support fine grained manipulation of resources in other future AM API calls (such as !StartSliver, !StopSliver, !RestartSliver). However, those other functions are not yet supported in the AM API.
    110 
    111 NOTE: It is important to define the way of referring to the sliver (sliver name or sliver_urn) and the restrictions on such a name with regards to supported characters and length.
    112 
    113 
    114 === Change Set E: Tickets ===
    115 ''Note: This set of changes is not defined, currently under active discussion and has gotten no unofficial or official agreement.''
    116 
    117 This proposal was discussed at the [http://groups.geni.net/geni/wiki/GEC12GeniAmAPI GEC12 AM API session].
     167Given this definition, the current AM API methods in fact operate on a group of slivers.
     168
     169This change set would provide a means for experimenters to operate on individual slivers within their slice at a given aggregate.
     170
     171== Define sliver ==
     172A Sliver is an aggregate defined grouping of resources within a slice at this aggregate, whose URN identifies the sliver, and can be used as an argument to methods such as !DeleteSlivers or !RenewSlivers, and whose status can be independently reported in the return from !SliversStatus. The AM defines 1 or more of these groupings to satisfy a given resource request for a slice. All reserved resources are directly contained by exactly 1 such sliver container, which is in precisely 1 slice.
     173
     174Slivers are identified by an aggregate selected URN. See other change proposals for details on standardizing such URNs.
     175
     176== Addressable Slivers ==
     177Considering the clarified sliver definition, several API names are misleading. This change proposal modifies those method names to clarify that they may work with multiple slivers. Additionally, some methods can logically operate on individual slivers: this change modifies those methods' arguments to allow specifying a particular sliver.
     178
     179 1. Rename some existing methods to clarify that they act on 1+ slivers:
     180  - !CreateSliver -> !CreateSlivers
     181  - !RenewSliver -> !RenewSlivers
     182  - !DeleteSliver -> !DeleteSlivers
     183  - !SliverStatus -> !SliversStatus
     184
     185 2. Some methods that take {{{slice_urn}}} now take a {{{urn}}} that may be a slice or sliver:
     186  - !RenewSlivers, !DeleteSlivers, !SliversStatus
     187  - AMs are responsible for distinguishing whether the request operates on a slice or a sliver (see [#ChangeSetK:Standardizecertificatesandcredentials Change Set K] which defines how slice and sliver URNs differ).
     188  - AMs are free to refuse to Renew, Delete, or provide status on an individual sliver, if the local AM or that resource type does not support it.
     189   - AMs should return an error message. Clients may often use !UpdateSlivers instead to similar effect.
     190
     191= Change Set E: Tickets =
     192AM APIv3 adds support for negotiated reservations or two-phase commit, by '''add'''ing methods that allow an experimenter to reserve resources for a slice without committing to using them, or forcing the AM to incur the cost of instantiating them.
     193
     194== Motivation ==
     195This possible change was discussed at the [http://groups.geni.net/geni/wiki/GEC12GeniAmAPI GEC12 AM API session].
    118196
    119197The [http://svn.planet-lab.org/attachment/wiki/WikiStart/sfa.pdf SFA] defines the concept of a ticket. SFA1.0 section 5.3 says "A component signs an RSpec to produce a ticket, indicating a promise by the component to bind resources to the ticket-holder at some point in time." Tickets are promises to allocate resources.
    120198
    121 Tickets are used in the [http://www.protogeni.net/trac/protogeni/wiki/ComponentManagerAPIV2 ProtoGENI CMV2 interface], and are discussed on  [http://www.protogeni.net/trac/protogeni/wiki/Tickets the PG wiki]. Tickets (and leases) are also used extensively in Orca. For details on the use of leases and tickets in Orca, see [https://geni-orca.renci.org/trac/attachment/wiki/WikiStart/ORCA%20Book.pdf 'the Orca Book']. However, each of these uses of the notion of tickets differs.
    122 
    123 Tickets would enable a number of useful and possibly critical features:
     199Tickets are used in the [http://www.protogeni.net/trac/protogeni/wiki/ComponentManagerAPIV2 ProtoGENI CMV2 interface], and are discussed on  [http://www.protogeni.net/trac/protogeni/wiki/Tickets the PG wiki]. Tickets with a slightly different semantics (and leases) are also used extensively in Orca. For details on the use of leases and tickets in Orca, see [https://geni-orca.renci.org/trac/attachment/wiki/WikiStart/ORCA%20Book.pdf 'the Orca Book']. However, each of these uses of the notion of tickets differs.
     200
     201Tickets would potentially enable a number of useful and possibly critical features:
     202 - Coordinated or negotiated reservations: reserving resources from aggregate B only if aggregate A can give you a complementary resource. For example, a VLAN tag. This is related to stitching, both network stitching and the more general form.
     203 - Two phase commit reservations (similar to the above).
     204 - Scheduled reservations in the future.
    124205 - Brokers: 3rd parties consolidating, scheduling and allocating resources on behalf of a number of other aggregates
    125206 - Lending resources to other experimenters
    126  - Coordinated or negotiated reservations: reserving resources from aggregate B only if aggregate A can give you a complementary resource. For example, a VLAN tag. This is related to stitching, both network stitching and the more general form.
    127  - Two phase commit reservations (similar to the above)
    128  - Scheduled reservations in the future
    129  - Giving experimenters explicit control over when resources are started, stopped, and restarted (see the discussion on !UpdateSliver above)
    130 
    131 This change would introduce the concept of tickets, and new methods to use tickets. It requires:
    132  - a ticket schema
    133  - methods to get, redeem, split, and maybe return tickets
    134  - semantics for what promises a ticket provides, and what it means to redeem and return tickets
    135  - many other details.
     207 - Giving experimenters explicit control over when resources are started, stopped, and restarted (see the discussion on !UpdateSliver).
     208
     209== Tickets semantics ==
     210This proposal would add tickets to the existing AM API, allowing experimenters to reserve (hold) resources temporarily and cheaply. Tickets represent a promise to the named slice to allocate the specified resources, if the ticket is 'redeemed' while the ticket is still valid. Tickets describe a complete specification of the resources that will be allocated to the slice at this aggregate, if the ticket is redeemed.
     211
     212Some key properties of the tickets proposed here:
     213 - Tickets are IOUs from an AM to a slice (not to an experimenter - no delegation is necessary or possible).
     214 - Experimenters do not need to use tickets to reserve resources: existing methods without tickets still work.
     215 - A ticket is a promise by the AM to give the specified resources to the slice if an authorized slice member requests them.
     216  - The aggregate is saying they will not give away these resources to other slices, but only to this slice.
     217  - AMs must document how firm their promises are. See the attribute {{{geni_ticket_service_class}}}. 
     218   - Some aggregates may only offer soft promises, as in PlanetLab.
     219 - Tickets are signed by the AM: non repudiatable.
     220 - Tickets are bound to a slice: they contain the slice certificate.
     221 - Tickets may be passed from 1 researcher on a slice to another freely - no explicit delegation is required.
     222  - Indeed, any experimenter with appropriate slice credentials can retrieve the ticket from the aggregate.
     223  - Tickets may not be delegated to another slice or other entity; these tickets do not support brokers.
     224 - Tickets promise a particular set of resources: they include an RSpec. Note that this may be an unbound RSpec.
     225  - Note that we do not currently have unbound manifest RSpecs. For now we specify only that this is an RSpec.
     226 - Tickets are good for a limited time.
     227  - They must be redeemed by a specified time, {{{redeem_before}}}, after which the aggregate is free to assign the resources elsewhere.
     228   - Aggregates determine {{{redeem_before}}}, which is some epsilon in the near future.
     229   - Aggregates may accept a new option {{{geni_reserve_until}}} which is a request for a particular {{{redeem_before}}}, but are not required to support this.
     230  - Tickets specify when the resources will be available from ({{{starts}}}, typically essentially now), and when they will be available until (typically now plus the aggregate-local default sliver expiration time).
     231    - The resources may be available even longer, but that would require a separate !RenewSlivers call.
     232 - Tickets specify the full final state of the slice after applying this ticket.
     233  - Tickets are not incremental changes, and are not additive.
     234  - The implication is that there may be only 1 ticket outstanding for a slice per aggregate.
     235  - This also implies that these tickets are not suitable for use by brokers.
     236 - Aggregates must attempt to honor their promises. As a result, aggregates must remember all outstanding tickets until they are redeemed or expire.
     237 - All ticket related timestamps must be in the format of RFC3339 (http://www.ietf.org/rfc/rfc3339.txt)
     238  - Full date and time with explicit timezone: offset from UTC or in UTC.
     239  - eg: {{{1985-04-12T23:20:50.52Z}}} or {{{1996-12-19T16:39:57-08:00}}}
     240
     241== Ticket contents ==
     242Tickets have an ID, the certificate of the slice to whom the resources are promised, an RSpec representing the promised resources, several timestamps, other attributes, and a signature by the aggregate (including the aggregate's certificate).
     243
     244Tickets are externally represented as signed XML documents following the [http://www.w3.org/TR/xmldsig-core/ XML Digital Signatures specification].
     245
     246Tickets contain:
     247 - {{{owner_gid}}} = the certificate of the experimenter who requested the ticket
     248 - {{{target_gid}}} = slice certificate
     249 - {{{uuid}}}
     250  - Unique ID for the ticket, in the hexadecimal digit string format given in [http://www.ietf.org/rfc/rfc4122.txt RFC 4122]
     251 - {{{expires}}} - RFC3339 compliant Date/Time when the resources will no longer be yours per this reservation (eg sliver duration+now)
     252 - {{{redeem_before}}}: RFC3339 compliant Date/Time when you must redeem this reservation, or your resources will be returned to the available pool (eg now+epsilon)
     253 - {{{starts}}} - RFC3339 compliant Date/Time when the resources will be yours, per this reservation (eg now)
     254 - RSpec (not specified as request or manifest)
     255 - Attributes (AM/resource-type specific name/value pairs)
     256  - Including optionally {{{geni_state_guarantee}}} as defined below, to indicate if existing slivers will be disrupted (default is no guarantee).
     257  - Including {{{geni_ticket_service_class}}} as defined below, to indicate the firmness of the promise this ticket represents
     258 - signature including issuing AM's certificate
     259
     260More formally:
     261{{{
     262{
     263 owner_gid = <the certificate of the experimenter who requested the ticket>,
     264 target_gid = <slice certificate, following GENI AM API certificate specification>,
     265 uuid = <RFC 4122 compliant string>,
     266 expires = <RFC3339 compliant Date/Time when the resources will no longer be yours per this reservation (eg sliver duration+now)>,
     267 redeem_before = <RFC3339 compliant Date/Time when you must redeem this reservation, or your resources will be returned to the available pool (eg now+epsilon)>,
     268 starts = <RFC3339 compliant Date/Time when the resources will be yours, per this reservation (eg now)>,
     269 rspec = <RSpec (not specified as request or manifest)>,
     270 attributes = {
     271    geni_state_guarantee = <string>,
     272    geni_ticket_service_class = <string>,
     273    <others>
     274  },
     275  signature
     276}
     277}}}
     278
     279Tickets may include in the {{{attributes}}} element the attribute {{{geni_state_guarantee}}}, indicating whether the AM will preserve the state of any existing resources (case insensitive string or integer).
     280 - 0=NO_GUARANTEE (Default: all state ''may'' be lost)
     281 - 1=SAVE_DISK (disk state will be preserved but running processes will be lost)
     282 - 2=SAVE_DISK_AND_PROCESSES (both disk state and running processes will be preserved, like migrating a VM)
     283 - 3=NO_DISRUPTION (no noticeable service disruption)
     284
     285Tickets should include the {{{geni_ticket_service_class}}} attribute for advertising the firmness of the promise that a ticket represents (case insensitive string or integer).
     286 - FIXME: Provide definitions for these service classes.
     287 - 1=WEAK_EFFORT
     288 - 2=BEST_EFFORT
     289 - 3=ELASTIC_RESERVATION
     290 - 4=HARD_RESERVATION
     291
     292Tickets will follow a defined schema, to be published on geni.net.
     293
     294Tickets logically have a URN (not included in the ticket): {{{urn:publicid:IDN+<AM name>+ticket+<uuid>}}}
     295
     296For a similar structure in ProtoGENI, see https://www.protogeni.net/trac/protogeni/attachment/wiki/Authentication/credential.rnc
     297
     298== Methods ==
     299 1. !GetTicket
     300{{{
     301struct GetTicket (string slice_urn, string credentials[], string requestRSpec,
     302                           struct options)
     303}}}
     304 - Get a ticket promising resources requested in the rspec.
     305 - Return: ticket
     306 - Result State: {{{ticketed}}}
     307 - Options may include {{{geni_start_time}}} and {{{geni_end_time}}} (see below)
     308 2. !RedeemTicket
     309{{{
     310struct RedeemTicket(string slice_urn, string credentials[], string ticket,
     311                                 struct users[] (as in CreateSlivers), struct options)
     312}}}
     313 - Return:
     314{{{
     315{
     316 string rspec=<manifest>,
     317 string geni_start_time=<optional (may be omitted altogether): now if not specified>,
     318 string geni_expires=<RFC3339 sliver expiration>,
     319 string geni_status=<sliver state - allocated or changing or ready>,
     320 string geni_state_guarantee=<promise from AM of what experimenter state will be lost on trying to 'start' this allocation>,
     321 <others that are AM specific>
     322}
     323}}}
     324 - Begin allocating the resources promised in the ticket.
     325 - Option {{{geni_donotstart}}}:
     326  - If supplied and true (boolean: 0 or 1 in XML-RPC), final state is {{{allocated}}}, and experimenter must explicitly start or restart resources using !ActOnSlivers
     327  - If omitted, AM automatically starts/restarts resources, and state will be {{{changing}}} and then {{{ready}}}
     328 - Omitting the ticket causes the aggregate to redeem the outstanding ticket for this slice if any. If none, return an error code.
     329
     330 3. !ReleaseTicket
     331{{{
     332struct ReleaseTicket(string slice_urn, string credentials[], string ticket, struct options)
     333}}}
     334 - Give up the reservation for resources.
     335 - Return: True or error
     336 - Omitting the ticket causes the aggregate to release the 0 or 1 outstanding tickets for this slice.
     337
     338 4. !UpdateTicket
     339(atomic release/get)
     340{{{
     341struct UpdateTicket(string slice_urn, string credentials[], string requestRSpec,
     342                                string ticket, struct options)
     343}}}
     344 - For updating a reservation in place, replacing one ticket with a new one.
     345 - Return: Ticket
     346 - Result State: {{{ticketed}}}
     347 - Options may include {{{geni_start_time}}} and {{{geni_end_time}}} (see below)
     348
     349 5. !UpdateSlivers
     350{{{
     351struct UpdateSlivers(string slice_urn, string credentials[], string requestRSpec,
     352                                                 struct options)
     353}}}
     354 - Returns a struct:
     355{{{
     356{
     357  string ticket=<ticket>
     358  string geni_status=<sliver state - ticketed>,
     359  string geni_state_guarantee=<promise from AM of what experimenter state will be lost on trying to 'start' this allocation>,
     360 <others that are AM specific>
     361}
     362}}}
     363 - Get a promise for resources that would replace currently allocated resources, as defined in [#ChangeSetC:UpdateSlivers Change Set C].
     364 - Result State: {{{ticketed}}}
     365 - Options may include {{{geni_start_time}}} and {{{geni_end_time}}}, a RFC3339 requested start and end time for the reservation (option not required).
     366   - The request should Fail (return an error code) if the resources cannot be reserved from or until the requested time.
     367 - The method takes a full request RSpec - not a diff.
     368  - AMs may, as always, return {{{UNSUPPORTED}}} - EG if they are incapable of determining what changes to apply (computing a diff).
     369 - The request is either fully satisfied, or fails (returns an error code).
     370 - AMs must document the level of service they provide using levels from {{{geni_state_guarantee}}}: will any state be lost on existing resources?
     371  - Default is to provide no guarantee.
     372 - Experimenters may specify what level of disruption they can tolerate, using the {{{geni_state_guarantee}}} option.
     373  - AMs are expected to fail a request with a specified service guarantee that they cannot satisfy. Default is to request no guarantee.
     374 - For further details on the !UpdateSlivers semantics, see [#ChangeSetC:UpdateSlivers Change Set C].
     375
     376For a similar set of functions in ProtoGENI, see: https://www.protogeni.net/trac/protogeni/wiki/ComponentManagerAPIV2
     377
     378== Other changes to support tickets ==
     379 - !CreateSlivers remains the first call: do not use it to add resources to the slice.
     380 - !ListResources return value changes to be:
     381{{{
     382{
     383   string rspec (ad or Manifest - may be empty though)
     384   string tickets[] (required but may be an empty list)
     385}
     386}}}
     387 - For !ListResources with no {{{slice_urn}}}, {{{tickets}}} shall be an empty list, and rspec shall be an ad RSpec.
     388 - For !ListResources with a {{{slice_urn}}}, {{{rspec}}} is the manifest RSpec for everything belonging to that slice at this AM, if anything is currently allocated (not just a ticket). {{{tickets}}} is then any outstanding ticket(s) for this slice.
     389
     390== Scheduling support using Tickets ==
     391This ticket structure and methods, with small additions, supports using tickets for scheduling. This proposal does not require support for scheduling at aggregates.
     392
     393 - We are not explicitly supporting scheduling, but the timestamps here should be sufficient.
     394 - !GetTicket, !CreateSlivers, !ListResources, !UpdateTicket, !UpdateSlivers all accept new RFC3339 compliant {{{geni_start_time}}} and {{{geni_end_time}}} options to support scheduling in the future.
     395  - For !GetTicket and !CreateSlivers, if left out then the reservation start is 'now or really soon' and the end is start plus the default sliver duration.
     396  - AMs that do not support scheduling return {{{UNSUPPORTED}}} when passed {{{geni_start_time}}}.
     397  - AMs should still support {{{geni_end_time}}}, following the logic of !RenewSlivers to determine if the requested duration of the sliver is acceptable.
     398   - IE at !CreateSlivers and !GetTicket and !UpdateSlivers in particular
     399   - The request should Fail (return an error code) if the resources cannot be reserved until the requested time.
     400 - {{{redeem_before}}} in tickets should be {{{starts}}}+epsilon. That epsilon is AM specific, but typically a small number of minutes.
     401 - Multiple tickets may be outstanding for a single slice at a single AM only for non overlapping time intervals.
     402  - IE you could request 2 tickets: 1 for machines 1-3 on Tuesday and simultaneously request 1 for machines 4-6 on Thursday.
     403 - These options are accepted in !ListResources as well.
     404  - Specifying {{{geni_start_time}}} means tell me what will be available at that time. Default is now.
     405  - Specifying both {{{geni_end_time}}} and {{{geni_start_time}}} means show me only things available for that entire duration.
     406
     407== An Alternative: Provide two !UpdateSlivers methods ==
     408One alternative would be to define two versions of !UpdateSlivers, with and without an intermediate ticket. The no-ticket version of this method would behave like !CreateSlivers, immediately allocating requested resources. For details on this proposal, see above.
     409
     410-----
     411= Change Set F: Support AM and resource-type specific methods. =
     412Define the control API (the AM API) as about moving slivers through various states at an AM.
     413
     414== Motivation ==
     415AM API methods logically change the state of the slivers at this AM. But the API is not clear what experimenters should expect, and does not provide easy ways for experimenters to control when and how states change. There is in particular no way to move slivers through states and change them in ways otherwise undefined by the API.
     416
     417== Change Set F1: Define Sliver States ==
     418Currently the AM API defines several possible states as valid returns in !SliversStatus: {{{configuring}}}, {{{ready}}}, {{{unknown}}}, and {{{failed}}}. This change changes and expands that list of valid states, and explicitly defines the expected states after each AM API method call. Additionally, this change provides a mechanism for aggregates to supply their own states.
     419
     420The GENI AM API can be thought of as manipulating slivers. As such, each method potentially changes the state of 1 or more slivers. With the changes proposed here, several of the methods return a new {{{geni_status}}} field, whose value is one of the standard GENI sliver status values. Aggregates must use one of the standard GENI values for that return.
     421
     422{{{geni_status}}} legal values (case insensitive):
     423 - {{{uninitialized}}}: This is the state before any AM-local operation for this slice.
     424 - {{{ticketed}}}: The resources are reserved for the slice, but not currently provisioned for the slice. Slivers are {{{ticketed}}} after !GetTicket, !UpdateTicket, or after !UpdateSlivers. Note in particular that a slice may have some resources that are {{{ready}}} and others which are {{{ticketed}}} after an !UpdateSlivers call: we call the whole slice {{{ticketed}}} in this case.
     425 - {{{allocated}}}: The sliver(s) are currently provisioned for the slice, but not necessarily fully ready for experimental use (eg, not booted). This is the state after !RedeemTicket, or after !CreateSlivers with the {{{geni_donotstart}}} option.   
     426 - {{{ready}}}: The resources are ready for experimental use, as in after !CreateSlivers completes any booting or starting. Similarly after !ActOnSlivers with the {{{start}}} command. Note that each of those methods starts a process that may take significant time to complete. During that time the sliver will not yet be {{{ready}}}.
     427 - {{{closed}}}: When the slice was previously provisioned resources, which have now expired or been de-allocated with !DeleteSlivers, we call the sliver {{{closed}}}. Note that this state is rarely seen in practice - aggregates do not respond in this API to queries about slices that do not currently have outstanding allocations or tickets.
     428 - {{{changing}}}: This is the state of a sliver in transition. For example, while a machine is booting (changing from {{{allocated}}} to {{{ready}}}). This state used to be known as {{{configuring}}}.
     429 - {{{shutdown}}}: This is the state of a sliver after the Shutdown operation - the sliver is still allocated to the slice, possibly still booted and configured for the slice, but is not available for experimental use. And administrator must intervene to recover or delete the slivers.
     430 - {{{failed}}}: When an operation fails leaving the sliver unusable and requiring administrative intervention, it will be marked {{{failed}}}.
     431 - {{{unknown}}}: If the aggregate does not know the state of a sliver, it will be marked {{{unknown}}}. This state may be transitive, or may require an admin to recover.
     432
     433As in previous versions of this API, the state of the full set of slivers in a slice at an aggregate is a roll-up of the states of each sliver. For each of {{{ticketed}}}, {{{allocated}}}, and {{{ready}}}, the set of slivers is only in that state if all individual slivers are in that state. If any sliver is {{{shutdown}}} or {{{failed}}} or {{{changing}}} (in order of decreasing precedence), then the set of slivers is in that state. If all slivers are {{{unknown}}} or {{{closed}}}, then the slice at this aggregate is {{{unknown}}} or {{{closed}}}.
     434 - If not all resources in the sliver/slice can be moved to the desired next state, then the call fails.
     435 - When moving from state 1 to 2, the slice is in state 1 until all slivers are in state 2 (EG moving from {{{ticketed}}}->{{{allocated}}}).
     436
     437Aggregates are free to ''also'' return an aggregate specific status - either in an AM-specifically-named entry, or in {{{am_specific_status}}}. Such values should be thought of as sub-states within the GENI state. For example, where the GENI state might be {{{changing}}}, the AM specific state might also be {{{imaging}}} or {{{booting}}}. Methods which accept a state (!ActOnSlivers) may accept either one of the {{{geni_status}}} values, or an aggregate specific value. Aggregates must document the meaning and use of aggregate specific status values.
     438
     439State changes by method:
     440 - !GetTicket: From {{{uninitialized}}} to {{{ticketed}}}
     441 - !UpdateTicket: From {{{ticketed}}} to {{{ticketed}}}
     442 - !ReleaseTicket: From {{{ticketed}}} to {{{uninitialized}}} (or {{{allocated}}} if this was an update)
     443 - !RedeemTicket: From {{{ticketed}}} to {{{allocated}}}
     444 - !CreateSlivers: From {{{uninitialized}}} to {{{allocated}}}
     445  - And then to {{{ready}}} via {{{changing}}} if the {{{geni_donotstart}}} option is not supplied
     446 - !UpdateSlivers: From {{{allocated}}} or {{{ready}}} to {{{ticketed}}}
     447 - !DeleteSlivers: From {{{ready}}} or {{{allocated}}} (or {{{changing}}}, etc) to {{{closed}}} (not {{{ticketed}}})
     448 - Shutdown: From {{{allocated}}} or {{{ready}}} to {{{shutdown}}}
     449Note that {{{changing}}} or {{{unknown}}} may be a source state for any of these methods. Operations may fail, leaving a sliver {{{failed}}}, and operations may take time leaving a sliver {{{changing}}} for some time.
     450
     451Methods and state transitions as a picture:
     452
     453[[Image(sliver-states.jpg)]]
     454
     455{{{
     456#!comment
     457 - {{{uninitialized}}} -> (!GetTicket) -> {{{ticketed}}} (you have a ticket)
     458  - and back via !ReleaseTicket
     459 - {{{ticketed -> (!UpdateTicket) -> {{{ticketed}}}
     460 - {{{ticketed -> (!RedeemTicket) -> {{{allocated}}} (you have slivers)
     461 - {{{uninitialized}}} -> (!CreateSlivers) -> allocated and then via {{{changing}}} to {{{ready}}}
     462 - {{{allocated}}} (or {{{ticketed}}} when you also have {{{allocated}}} slivers)->(!DeleteSlivers) -> {{{closed}}}
     463 - {{{allocated}}} (or some {{{allocated}}} and some {{{ticketed}}}}) -> (Shutdown) -> {{{shutdown}}}
     464 - {{{shutdown}}} -> [some operator action] -> {{{closed}}} or {{{allocated}}}
     465 - {{{allocated}}} -> (!UpdateSlivers) -> whole is called {{{ticketed}}}, some slivers are {{{allocated}}} and some {{{ticketed}}}
     466 - Some slivers {{{allocated}} and some {{{ticketed}}} -> (!UpdateTicket) -> {{{allocated}}}+{{{ticketed}}}
     467 - {{{allocated}}}+{{{ticketed}}} -> (!ReleaseTicket) -> {{{allocated}}}
     468 - {{{allocated}}}+{{{ticketed}}} -> (!RedeemTicket) -> {{{allocated}}}
     469}}}
     470
     471Summary of changes:
     472 - {{{configuring}}} becomes {{{changing}}}, which can be used in many other cases, in returns from !SliversStatus
     473 - New states {{{uninitialized}}}, {{{ticketed}}}, {{{allocated}}}, {{{closed}}}, and {{{shutdown}}} are added
     474 - State transitions for each method are defined
     475 - {{{am_specific_status}}} optional return defined
     476 - {{{geni_status}}} is returned by !SliversStatus, !RedeemTicket, !UpdateSlivers, !CreateSlivers, and !ActOnSlivers (if all relevant change sets are adopted).
     477
     478== Change Set F2: !ActOnSlivers ==
     479This change introduces a new method, providing a generic way to act on slivers in an AM or resource type specific way. This method shall be used to 'start' or 'stop' or 'restart' resources that have been allocated but not started by !CreateSlivers or !RedeemTicket. It may also be used to change the state of slivers (or their contained resources) in an aggregate or resource specific way. Some aggregates may use this method to change configuration details of allocated resources. This might include changing acceptable login keys.
     480
     481!ActOnSlivers takes a {{{command}}}, {{{urn}}}, {{{state}}}, and {{{options}}}. The method return is a struct that includes the {{{urn}}}, {{{geni_status}}} of the sliver(s), and any other AM and operation specific options. The URN may be a slice urn, meaning all slivers in that slice at this AM are effected. Or the URN may be a particular sliver URN. The {{{state}}} argument is one of the {{{geni_status}}} values, or an AM-specific value. The {{{state}}} meaning depends on the {{{command}}}, but typically indicates the desired or resulting new state of the sliver(s). If the AM wishes to return an aggregate specific sliver status, it should still return a valid {{{geni_status}}}, and use an additional entry to also return the aggregate specific state. The {{{command}}} argument is aggregate defined. This API does not specify how aggregates advertise valid commands. Three particular commands are typical however: {{{start}}}, {{{stop}}}, and {{{restart}}}. These are used when the {{{geni_donotstart}}} option is supplied to !CreateSlivers for example.
     482
     483For example, to start allocated resources:
     484{{{
     485Arguments:
     486  command = start
     487  urn = <slice or sliver urn>
     488  state = ready
     489  options = <none required>
     490Result:
     491  urn = <same as input>
     492  geni_status = changing or ready on success
     493}}}
     494
     495Method signature:
     496{{{
     497struct ActOnSlivers(string command, string credential[], string urn, string state, struct options)
     498}}}
     499
     500Return struct:
     501{{{
     502{
     503 string urn=<urn of sliver or slice>,
     504 string geni_status=<new state of the slivers>,
     505 <other entries specific to the AM or resources - specifically am_specific_status>
     506}
     507}}}
     508
     509= Change Set G: Credentials are general authorization tokens. =
     510== Motivation ==
     511Most AM API methods take a list of credentials to authorize operations. Currently the API requires credentials in a particular format, and would disallow others, such as ABAC.
     512The API should allow for other innovative authorization tokens.
     513
     514== Make credentials more general ==
     515This change modifies the credentials argument to all methods. Each credential is now defined only as a signed document. A given list of credentials may contain credentials in multiple formats. The list may be empty. A given authorization policy at an AM may require 0, 1, or many credentials. Aggregates are required to allow credentials which are not used by local authorization policy or engines, using only credentials locally relevant.
     516
     517 - An AM must pick credentials out of the list that it understands and be robust to receiving credentials it does not understand.
     518  - Current slice and user credentials will be recognizable for following the schema defined in [#ChangeSetK:Standardizecertificatesandcredentials Change Set K].
     519 - AMs are required to continue to accept current-format credentials.
     520  - In particular, a single standard slice credential remains sufficient for most authorization policies.
     521 - Other credential formats acceptable by some aggregates might include ABAC x509 Attribute certificates, eg.
     522 - AMs may get other authorization material from other sources: EG a future Credential Store service.
     523
     524= Changes to existing methods =
     525Modify a few existing methods to make certain operations easier or more experimenter friendly.
     526
     527== Change Sets H&I: Misc other method changes ==
     528 - '''Change Set H''': A second call to !CreateSlivers without an intervening !DeleteSlivers is an error.
     529  - This change just clarifies expected behavior that was left under-specified in AM API v1.
     530  - !CreateSlivers takes a full Ad RSpec, it is not a way to 'add' resources.
     531  - Silently replacing the existing slivers with new slivers (similar to a call to !UpdateSlivers) is not acceptable.
     532
     533 - '''Change Set I1''': Add {{{geni_expires}}} to return from !SliversStatus for whole slice and then each sliver
     534  - This change standardizes behavior necessary for experimenters to determine their sliver expiration times.
     535  - Format is RFC3339 (http://www.ietf.org/rfc/rfc3339.txt)
     536   - Full date and time with explicit timezone: offset from UTC or in UTC)
     537   - eg: {{{1985-04-12T23:20:50.52Z}}} or {{{1996-12-19T16:39:57-08:00}}}
     538
     539 - '''Change Set I2''': Add SSH logins/keys to each node that supports SSH login in the return from !SliversStatus
     540This change standardizes behavior so experimenters can readily find how to log in to reserved resources.
     541{{{
     542'users' => [{'urn'   => $user1_urn.
     543             'login' => $login,
     544             'protocol' => [ssh, or ?],
     545             'port' => [22 or ?],
     546             'keys'  => [...] },
     547            {'urn'   => $user2_urn.
     548             'login' => $login,
     549             'protocol' => [ssh, or ?],
     550             'port' => [22 or ?],
     551             'keys'  => [...] }
     552           ]
     553}}}
     554
     555 - A note on distinguishing !ListResources from !SliversStatus:
     556  - !ListResources in the context of a slice URN is for listing the reserved resources. It provides mostly static information. (But if the manifest contains things which can change, then the manifest must change when those things (like say IP addresses) change.)
     557  - !SliversStatus is for everything else: anything which the AM can change for you using API calls, or which changes over time. So it has up/down state, expiration time, and now login keys. It provides that for your whole slice at this aggregate and all contained slivers.
     558
     559 - '''Change Set I3''': Return sliver expiration from !CreateSlivers
     560Experimenters currently do not know the expiration of their slivers without explicitly asking.
     561This change makes the !CreateSlivers return value become a struct:
     562{{{
     563{
     564 string rspec=<manifest>,
     565 string geni_start_time=<optional (may be omitted altogether): now if not specified>,
     566 string geni_expires=<RFC3339 sliver expiration, as in geni_expires from SliversStatus>,
     567 string geni_status=<sliver state - allocated or changing or ready>,
     568 <others that are AM specific>
     569}
     570}}}
     571
     572 - '''Change Set I4''': !CreateSlivers optionally does not start resources.
     573Currently, !CreateSlivers auto starts resources, moving them from {{{allocated}}} through {{{changing}}} to {{{ready}}}.
     574 - Add a new option {{{geni_donotstart}}}:
     575  - If supplied and true (boolean: 0 or 1 in XML-RPC), final state is {{{allocated}}}, and experimenter must explicitly start resources using !ActOnSlivers.
     576  - If omitted or false ({{{0}}}) (default), AM automatically starts resources as before, and state will be {{{changing}}} and then {{{ready}}}.
     577
     578== Change Set J: Proxy aggregate managers are supported ==
     579The GENI architecture that the architecture group is developing uses a proxy aggregate to handle standardized authorization and logging. This change is necessary to make such aggregates possible.
     580
     581Proxy aggregates will be supported by having client tools delegate slice credentials to the proxy aggregate (preferably without undue work by experimenters). This delegated credential will typically be marked non-delegatable and otherwise limited where possible. Note that experimenters are trusting proxy aggregates to perform only the desired action on their slice, although the delegated slice credential would allow other actions. This trust however is no more than the trust experimenters place in other AMs.
     582
     583Clients would contact the proxy aggregate URL, having learned that the proxy's URL is the way to contact the aggregate whose resources the client wants. Then through slice credential delegation the proxy AM can apply standard AM API authorization logic to authorize the operation at the proxy AM, and the 'real AM' can receive the call from the proxy AM, and also apply standard AM API authorization logic to validate the call from the proxy AM. Some proxied aggregate implementations may accept connections only from a proxy AM.
     584
     585Two changes are required to make this possible:
     586 1. Add a new optional return entry from !GetVersion: {{{geni_is_proxy_am}}}, a boolean (0 or 1 in XML-RPC). When present and true, the aggregate is advertising that it is a proxy aggregate. Clients should delegate any slice credentials to this aggregate when making subsequent AM API calls. This API does not specify how proxy aggregates advertise their certificate, which is required for clients to delegate slice credentials to the proxy.
     587
     588 2. Define a new option {{{geni_experimenter_urn}}}.
     589  - Proxy AMs will retrieve the experimenter URN from the subjectAltName of the client SSL certificate, and then supply this value in calls to the 'real AM' where the call is being redirected.
     590  - Such 'real' AMs should recognize they are being invoked by a proxy AM (having received a slice credential delegated to a proxy aggregate). In that case and that case only, the AM should include this {{{geni_experimenter_urn}}} in all logs to indicate the actual experimenter being granted resources.
     591  - The supplied slice credential should be a delegated credential, indicating that this 'real' experimenter was granted the required rights on this slice at some point in this chain - typically directly by the slice authority, and as the signer of the current credential delegating rights to the proxy AM.
     592
     593= Change Set K: Standardize certificates and credentials =
     594== Motivation ==
     595The current AM API specifies that certificates and credentials follow a particular format, using URNs that are based on experimenter supplied names. However that specification is not sufficiently specific, and there are currently differences in implementation among existing certificate and credential producers. This has led to errors, experimenter confusion, and messy code.
     596
     597== Changes ==
     598This proposal requires that certificates include a UUID and email address for the subject.
     599It codifies restrictions on usernames, sliver names, and slice names.
     600The proposal specifies that slices have a UUID to be used to identify slices in a consistent way over time (slice names may be re-used).
     601
     602Some overall points:
     603 - Aggregates are expected to fail requests that use certificates or URNs or names that violate this API.
     604 - Aggregates are required to consult and accept Certificate Revocation Lists in accordance with [http://tools.ietf.org/html/rfc3280 RFC 3280] and [http://tools.ietf.org/html/rfc5280 RFC 5280].
     605 - Schemas for certificates & credentials will be published on geni.net.
     606
     607Certificates:
     608 - GENI uses x509v3 identity certificates to identity users, slices, aggregates, and authorities, and these restrictions apply to all such certificates.
     609 - See http://groups.geni.net/geni/wiki/GeniApiCertificates.
     610 - Aggregates are required to properly validate all certificates to authenticate access to AM API calls, and fail calls that supply invalid certificates.
     611
     612Certificate contents:
     613 - {{{Version}}} shall be properly marked: 3
     614 - {{{serialNum}}} is required to be unique within the certificate authority: each newly issued certificate must have a unique serial number.
     615 - The Distinguished Name should include a human readable identifier, for both subject and issuer. Details are not specified
     616 - User (and most authority) certificates shall be marked {{{CA:TRUE}}} in the x509 v3 basic constraints; Slices shall be marked {{{FALSE}}}
     617 - The Subject Alternative Name field must include 3 pieces of information
     618  - Entries are comma separated ('{{{, }}}'), and may be in any order.
     619  - The URN identifier, following GENI URN standards as described here: http://groups.geni.net/geni/wiki/GeniApiIdentifiers
     620   - The URN is identifiable by looking for the entry beginning "{{{URI:urn:publicid:IDN}}}", for example: {{{URI:urn:publicid:IDN+emulab.net+user+stoller}}}.
     621  - A UUID, providing a globally unique ID for the entity.
     622   - In the hexadecimal digit string format given in [http://www.ietf.org/rfc/rfc4122.txt RFC 4122]
     623   - The UUID is identified with this prefix: "{{{URI:urn:uuid}}}" (as specified by RFC4122), for example: {{{URI:urn:uuid:33178d77-a930-40b1-9469-3aae08755743}}}.
     624  - The email address is an [http://tools.ietf.org/html/rfc2822#section-3.4.1 RFC2822] compliant and working address for contacting the subject of the certificate (experimenter, authority administrator, or slice owner).
     625   - The email entry is identified by the prefix "{{{email:}}}", for example: {{{email:stoller@emulab.net}}}
     626 - Recommendation: Authorities are encouraged but not required to include a URL where more information about the subject is available (eg slice authority registry URL). That URL may be included in a certificate extension, in the DN, or in the subjectAltName.
     627
     628Slices:
     629 - Slice ID is the UUID in the slice certificate, which is unique over time and space.
     630 - Slice URN is a label - unique at a point in time but not over time.
     631  - Format: {{{urn:publicid:IDN+<SA name>+slice+<slice name>}}}
     632 - Slice names are <=19 characters, only alphanumeric plus hyphen (no hyphen in first character): {{{'^[a-zA-Z0-9][-a-zA-Z0-9]+$'}}}
     633 - Aggregates are required to accept any compliant slice name and URN.
     634  - Note that this currently causes problems at PlanetLab/SFA aggregates, where node login names are based on slice names and are limited to 31 characters.
     635
     636Slivers:
     637 - Have a URN (returned in manifest RSpec), determined by the aggregate.
     638 - This URN should be unique over time within an AM for record-keeping / operations purposes.
     639  - Format: {{{urn:publicid:IDN+<AM name>+sliver+<sliver name>}}}
     640 - Sliver names
     641  - Must be unique over time within that AM, and are selected by the AM.
     642  - May use only alphanumeric characters plus hyphen.
     643
     644Usernames:
     645 - Usernames (user identifiers to the system) are set at the authority.
     646 - Usernames are case-insensitive internally, though they may be case-sensitive in display.
     647  - EG {{{JohnSmth}}} as a display name is {{{johnsmth}}} internally, and there cannot also be a user {{{JOHNSMTH}}}.
     648 - Usernames should begin with a letter and be alphanumeric or underscores - no hyphen or '.': ({{{'^[a-zA-Z][\w]+$'}}}).
     649 - Usernames are limited to 8 characters.
     650
     651= Change Set L: Change SFA credentials' privileges =
     652Our goal is to simplify and standardize privilege strings. Currently there are wildcards, bind, embed, and others. They are confusing. We also want extensibility to use these credentials elsewhere in future.
     653
     654Credentials should support these kinds of operations:
     655 - Learn about the slice
     656 - Add/Modify/Delete resources in the slice
     657 - Read slice details like I&M?
     658 - Use the slice
     659 - Operator shutdown
     660
     661Proposal - Replace all existing privileges with only the following possible strings (case insensitive):
     662 - {{{CanWrite}}}
     663  - If present in a valid slice credential, aggregates may permit !CreateSlivers, !RenewSlivers, !DeleteSlivers, Shutdown, plus new methods !ActOnSlivers, !UpdateSlivers, !GetTicket, !RedeemTicket, !UpdateTicket, !ReleaseTicket
     664  - Thus it replaces {{{bind}}}, {{{embed}}}, {{{control}}}, {{{instantiate}}}, {{{sa}}}, {{{pi}}}, or {{{*}}} in various places
     665 - {{{CanRead}}}
     666  - If present in a valid slice credential, aggregates may permit !ListResources with a {{{slice_urn}}}, !SliversStatus
     667  - Thus it replaces {{{info}}} or {{{*}}} in various places
     668 - {{{CanReadDetails}}}
     669 - {{{CanUse}}}
     670
     671Note that those last 2 may never get used, but are there in case I&M or opt-in make those useful.
     672
     673Note also that operators who wish to shut down a slice would need a slice credential with the {{{CanWrite}}} privilege.
     674
     675Privilege and credential semantics are defined as follows:
     676 - Aggregates may only grant access to a method if at least one valid credential
     677  - grants the required privilege (if any)
     678  - to the caller of the API method
     679   - (identified by their SSL client certificate and the {{{owner_gid}}} in the credential)
     680  - over the slice (if any) on which they are operating
     681   - ({{{target_gid}}} in the credential).
     682 - Other privileges may be present in the same or other credentials.
     683 - Local aggregate policy may deny access to a particular method even in the presence of a valid credential granting the required privilege.
     684 - Some operations (e.g. !GetVersion) may either simply require a valid credential with no particular privilege, or have no {{{credentials}}} argument at all.
     685
     686Note also that some current AMs do not require any particular privileges to do !ListResources, even with a {{{slice_urn}}}. This change explicitly requires that aggregates require a valid slice credential with {{{CanRead}}} privileges to perform this operation.
     687
     688-----
     689= Changes Not Included =
     690== RSpec changes resulting in GENI v4 RSpecs ==
     691 - Support unbound manifests
     692 - Make manifest an extension of Request, so you can readily edit & resubmit a manifest
     693 - Make configuration information in request and manifest optional, so it can be supplied/returned separately
     694 - Fully implement the compute ontology from Ilia
     695 - Ilia's other requests (Openflow related information)
     696 - Document process for updates per my dev list email
     697 - Be consistent: ref vs idref vs href
     698 - Include AM name/URL in RSpecs? Experimenter who allocated it URN?
     699 - Incorporate stitching extension as part of the 'base' RSpec
     700
     701== Misc ==
     702
     703 - Split !ListResources with {{{slice_urn}}} from !ListResources without. !ListResources with {{{slice_urn}}} we call Resolve(slice_urn).
     704 - Add {{{geni_credential_types}}} to !GetVersion return?
     705 - Add {{{geni_am_info}}} block to !GetVersion return (name, id, url, location, description, is_proxy, proxy: {(a geni_am_info block)}, proxy_for[] (list of geni_am_info blocks))
     706 - Define a new option {{{geni_am_id}}} for all methods. Proxy AMs may use this ID to look up the URL of the real AM, and pass the call along.
     707  - Instead just encode this am_id in the URL that the experimenter accesses, so that the proxy AM knows where to direct the call.
     708 - Allow the update methods to take a generic rspec argument, allowing AMs to accept full or diff RSpecs
     709 - Tickets
     710  - Remove requestor certificate?
     711  - Support brokers: Make ticket methods return multiple tickets. Define tickets as optionally diffs (additive). Make !RedeemTicket and !UpdateTicket take a list of tickets. Tickets are delegatable via signing, but the delegated ticket must be for a strict subset of the resources in the original.
     712
     713== Stitching ==
     714AMs must support the stitching extension where Layer 2 connections are available,
     715  - including in ads, requests, and manifests.
     716   - Advertise available VLANs, attempt to honor requested VLANs, reserve VLANs with tickets, and report reserved or instantiated VLANs in manifests
     717   - Use schema http://hpn.east.isi.edu/rspec/ext/stitch/0.1/stitch-schema.xsd
     718
     719----
     720 = Change summary - method signatures =
     721If all change sets listed here are adopted, the final method signatures will be as follows:
     722
     723 == !GetVersion ==
     724{{{
     725struct GetVersion([optional: struct options])
     726}}}
     727
     728Return struct:
     729{{{
     730
     731      {
     732        int geni_api;
     733        struct geni_api_versions {
     734             URL <this API version #>; # value is a URL, name is a number
     735             [optional: other supported API versions and the URLs where they run]
     736        }
     737        array geni_request_rspec_versions of {
     738             string type;
     739             string version;
     740             string schema;
     741             string namespace;
     742             array extensions of string;
     743        };
     744        array geni_ad_rspec_versions of {
     745             string type;
     746             string version;
     747             string schema;
     748             string namespace;
     749             array extensions of string;
     750        };
     751      }
     752}}}
     753
     754 == !ListResources ==
     755{{{
     756struct ListResources(string credentials[], struct options)
     757}}}
     758
     759Where options include:
     760{{{
     761{
     762  boolean geni_available;
     763  boolean geni_compressed;
     764  string geni_slice_urn;
     765  struct geni_rspec_version {
     766    string type;
     767    string version;
     768  };
     769  string geni_start_time;
     770  string geni_end_time;
     771}
     772}}}
     773
     774Return struct:
     775{{{
     776{
     777   rspec (ad or Manifest - may be empty though)
     778   tickets[] (required but may be an empty list)
     779}
     780}}}
     781
     782 == !GetTicket ==
     783{{{
     784struct GetTicket (string slice_urn, string credentials[], string requestRSpec,
     785                           struct options)
     786}}}
     787
     788Options include {{{geni_start_time}}} and {{{geni_end_time}}}
     789
     790Return: ticket
     791
     792 == !UpdateTicket ==
     793{{{
     794struct UpdateTicket(string slice_urn, string credentials[], string requestRSpec,
     795                                string ticket, struct options)
     796}}}
     797
     798Options include {{{geni_start_time}}} and {{{geni_end_time}}}
     799
     800Return: ticket
     801
     802 == !RedeemTicket ==
     803{{{
     804struct RedeemTicket(string slice_urn, string credentials[], string ticket,
     805                                 struct users[], struct options)
     806}}}
     807
     808Options include {{{geni_donotstart}}}
     809
     810Return struct:
     811{{{
     812{
     813 string rspec=<manifest>,
     814 geni_start_time=<optional (may be omitted altogether): now if not specified>,
     815 geni_expires=<RFC3339 sliver expiration>,
     816 string geni_status=<sliver state - allocated or changing or ready>,
     817 string geni_state_guarantee=<promise from AM of what experimenter state will be lost on trying to 'start' this allocation>,
     818 <others that are AM specific>
     819}
     820}}}
     821
     822 == !UpdateSlivers ==
     823{{{
     824struct UpdateSlivers(string slice_urn, string credentials[], string rspec,
     825                                                 struct options)
     826}}}
     827
     828Options include {{{geni_start_time}}} and {{{geni_end_time}}}
     829
     830Return struct:
     831{{{
     832{
     833  string ticket=<ticket>
     834  string geni_status=<sliver state - ticketed>,
     835  string geni_state_guarantee=<promise from AM of what experimenter state will be lost on trying to 'start' this allocation>,
     836 <others that are AM specific>
     837}
     838}}}
     839
     840 == !ReleaseTicket ==
     841{{{
     842struct ReleaseTicket(string slice_urn, string credentials[], string ticket, struct options)
     843}}}
     844
     845Return: boolean
     846
     847 == !CreateSlivers ==
     848{{{
     849struct CreateSlivers(string slice_urn,
     850                    string credentials[],
     851                    string rspec,
     852                    struct users[],
     853                    struct options)
     854}}}
     855
     856Options include:
     857{{{
     858{
     859  boolean geni_donotstart (optional),
     860  string geni_start_time <datetime> (optional),
     861  string geni_end_time <datetime> (optional)
     862}
     863}}}
     864
     865Return struct:
     866{{{
     867{
     868 string rspec=<manifest>,
     869 geni_start_time=<optional (may be omitted altogether): now if not specified>,
     870 geni_expires=<RFC3339 sliver expiration, as in geni_expires from SliversStatus>,
     871 string geni_status=<sliver state - allocated or changing or ready>,
     872 <others that are AM specific>
     873}
     874}}}
     875
     876 == !RenewSlivers ==
     877{{{
     878struct RenewSlivers(string urn,
     879                    string credentials[],
     880                    string expiration_time,
     881                    struct options)
     882}}}
     883Return: boolean
     884
     885 == !SliversStatus ==
     886{{{
     887struct SliverStatus(string slice_urn, string credentials[], struct options)
     888}}}
     889
     890Return:
     891{{{
     892{
     893  string geni_urn: <sliver URN>
     894  string geni_status: ready
     895  geni_expires: <datetime of expiration>
     896  struct geni_resources: [ { geni_urn: <resource URN>
     897                      geni_status: ready
     898                      geni_expires: <datetime of individual sliver expiration>
     899                      geni_error: ''},
     900                    { geni_urn: <resource URN>
     901                      geni_status: ready
     902                      geni_expires: <datetime of individual sliver expiration>
     903                      geni_error: ''}
     904                  ]
     905}
     906}}}
     907
     908Where for individual resources this block may be returned:
     909{{{
     910'users' => [{'urn'   => $user1_urn.
     911             'login' => $login,
     912             'protocol' => [ssh, or ?],
     913             'port' => [22 or ?],
     914             'keys'  => [...] },
     915            {'urn'   => $user2_urn.
     916             'login' => $login,
     917             'protocol' => [ssh, or ?],
     918             'port' => [22 or ?],
     919             'keys'  => [...] }
     920           ]
     921}}}
     922
     923 == !ActOnSlivers ==
     924{{{
     925struct ActOnSlivers(string command, string credentials[], string urn, string state, struct options)
     926}}}
     927
     928Return struct:
     929{{{
     930{
     931 string urn=<urn of sliver or slice>,
     932 string geni_status=<new state of the slivers>,
     933 <other entries specific to the AM or resources - specifically am_specific_status>
     934}
     935}}}
     936
     937 == !DeleteSlivers ==
     938{{{
     939struct DeleteSlivers(string urn, string credentials[], struct options)
     940}}}
     941
     942Return: boolean
     943
     944 == Shutdown ==
     945{{{
     946struct Shutdown(string slice_urn, string credentials[], struct options)
     947}}}
     948
     949Return: boolean