Opened 7 years ago

Closed 7 years ago

#15 closed (fixed)

AM API acceptance tests report a mismatch between component_id in manifest and request rspecs

Reported by: lnevers@bbn.com Owned by: ibaldin@renci.org
Priority: major Milestone:
Component: AM Version: SPIRAL4
Keywords: Cc: sedwards@bbn.com
Dependencies:

Description

The AM API test report that the manifest rspec include component_ids that do not match the component_id in the request rspec. Here is the test output:

$ ./am_api_accept.py -a am-undertest -V 2 --debug --ProtoGENIv2 
F.F..........
======================================================================
FAIL: test_CreateSliver: Passes if the sliver creation workflow succeeds.  Use --rspec-file to replace the default request RSpec.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./am_api_accept.py", line 612, in test_CreateSliver
    self.subtest_CreateSliverWorkflow()
  File "./am_api_accept.py", line 678, in subtest_CreateSliverWorkflow
    "but did not." % slicename)
  File "/home/lnevers/gcf-1.6.1-mod1/src/omni_unittest.py", line 154, in assertCompIDsEqual
    raise NotEqualComponentIDsError, msg
NotEqualComponentIDsError: Request RSpec and Manifest RSpec returned by 'ListResources' on slice 'acclne-151825' expected to have same component_ids but did not.

The request RSpec includes a client_id="geni1":

<?xml version="1.0" encoding="UTF-8"?>
<rspec type="request"
xsi:schemaLocation="http://www.protogeni.net/resources/rspec/2 http://www.protogeni.net/resources/rspec/2/request.xsd"
    xmlns:flack="http://www.protogeni.net/resources/rspec/ext/flack/1"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://www.protogeni.net/resources/rspec/2">
<node client_id="geni1" component_manager_id="urn:publicid:IDN+bbnvmsite+authority+cm">
 <sliver_type name="m1.small">
   <disk_image name="http://geni-images.renci.org/images/standard/debian/debian-squeeze-amd64-neuca-2g.zfilesystem.sparse.v0.
2.xml" version="397c431cb9249e1f361484b08674bc3381455bb9" />
 </sliver_type>
</node>
</rspec>

The Manifest RSpec includes a client_id="9a1c9fec-63ec-4d9f-a670-b979bdf1a474#geni1":

<rspec type="manifest" xmlns="http://www.protogeni.net/resources/rspec/2" xmlns:ns2="http://hpn.east.isi.edu/rspec/ext/stitch/0.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.protogeni.net/resources/rspec/2 http://www.protogeni.net/resources/rspec/2/manifest.xsd http://hpn.east.isi.edu/rspec/ext/stitch/0.1/ http://hpn.east.isi.edu/rspec/ext/stitch/0.1/stitch-schema.xsd">  
      <node client_id="9a1c9fec-63ec-4d9f-a670-b979bdf1a474#geni1" component_id="urn:publicid:IDN+geni-orca.renci.org+bbnvmsite.rdf#bbnvmsite/Domain" exclusive="true" sliver_id="urn:publicid:IDN+geni-orca.renci.org+sliver+urn:publicid:IDN+pgeni.gpolab.bbn.com+slice+ln0503+9a1c9fec-63ec-4d9f-a670-b979bdf1a474#geni1">    
            <sliver_type name="m1.small">      
                  <disk_image name="http://geni-images.renci.org/images/standard/debian/debian-squeeze-amd64-neuca-2g.zfilesystem.sparse.v0.2.xml" version="397c431cb9249e1f361484b08674bc3381455bb9"/>      
            </sliver_type>    
            <services/>    
            <interface client_id="9a1c9fec-63ec-4d9f-a670-b979bdf1a474#geni1:if1"/>    
      </node>  
</rspec>

Change History (18)

comment:1 Changed 7 years ago by ahelsing@bbn.com

Ilia- Can you maybe put the GID at the end of the client_id at least?

comment:2 Changed 7 years ago by ibaldin@renci.org

Owner: changed from somebody to ibaldin@renci.org
Status: newassigned

Added a fix so manifest CM URNs should match those specified in request. Will be deployed 06/26/12.

comment:3 Changed 7 years ago by ahelsing@bbn.com

Using the NICTA rack at the tutorial, the manifest has no component_manager_id element.

comment:4 Changed 7 years ago by ahelsing@bbn.com

See ticket #15

comment:5 Changed 7 years ago by ahelsing@bbn.com

err, #69

comment:6 Changed 7 years ago by ibaldin@renci.org

Please point me to some documentation that explains what the following fields are supposed to contain (some subsets of them are applicable to nodes, links and interfaces).

client id component id sliver id component name

comment:7 Changed 7 years ago by ahelsing@bbn.com

I wish I could.

This page has a little documentation - not enough: http://www.protogeni.net/trac/protogeni/wiki/RSpecReference2

client_id: An experimenter specified name for the element. Like 'PC-left' and 'PC-right'. client_id is required to be specified in request rspecs, and to be preserved in manifest rspecs.

component_name: An aggregate specified name for the component. Like 'pc147'. Should be unique within the aggregate. component_name is used in Ads, can be included in requests, and is also therefore used in manifests. See under component_id for details on including or omitting this field in requests.

component_id: A URN uniquely identifying the component, of the form: urn:publicid:IDN+<AM name>+<component type>+<component_name as above>. This ID is specified by the aggregate. For details on URNs, see http://groups.geni.net/geni/wiki/GeniApiIdentifiers component_id is required in Ad RSpecs. It is required in request RSpecs, where the experimenter is requesting a particular component (a so-called 'bound' rspec). If omitted, the request should specify a hardware_type and/or sliver_type, and is allowing the aggregate to select an available component that matches those request parameters.

sliver_id: A URN that uniquely identifies the sliver. It is generated by the AM. In AM API v3, it is used by experimenter tools to request actions on particularly slivers. It must be unique across all slices. It is of the form: urn:publicid:IDN+<AM name>+sliver+<some unique ID of the aggregate's own choosing>. For details on URNs, see http://groups.geni.net/geni/wiki/GeniApiIdentifiers sliver_id is only used in manifest_rspecs.

Per our email exchange over the GEC, the component ID for a VM server in an Ad remains the component_id for the VMs assigned to the slice in the manifest.

Per other tickets here, there are further conventions on how to construct component_nam and component_id for nodes and links, to allow parsing of topology information.

From my previous guidance to you:

All resources in a single Ad Rspec should have the same component_manager_id: that is, all resources that can be assigned by the same set of SW by definition share a component_manager

...

Naming / IDing links: "<prefix>+<site>+interface+<node or switch name>:<port#>:<remote end name>, EG: "<prefix>+emulab.net+interface+procurve-pgeni-wash:10:ion" Name the port# where possible, and the remote end where possible.

I hope this helps - ask questions if something else is needed.

comment:8 Changed 7 years ago by ibaldin@renci.org

This is better.

I am unclear about this statement:

"Per our email exchange over the GEC, the component ID for a VM server in an Ad remains the component_id for the VMs assigned to the slice in the manifest."

because we do not advertise VMs (they don't exist yet) or the individual worker nodes on which VMs are stood up (since we do not control VM placement policy, advertising individual worker nodes is not terribly useful).

comment:9 Changed 7 years ago by ahelsing@bbn.com

Hmm, that was unclear.

The Ad RSpec has a component_id for the VM server (logically - in your case it is really IDing the ability of the rack to issue VMs).

The request RSpec will or could include that same component_id (in your case, if the request goes to an individual rack, it doesn't really matter if the component_id is included, the effect is the same).

The manifest RSpec will include that same component_id (even if the request RSpec left it out).

So the component_id in the manifest essentially IDs the VM server - not the VM instance. The component_id plus client_id together uniquely ID the VM instance. And depending on your implementation, the component_id plus sliver_id might also uniquely ID the VM instance. (You get to decide if a single sliver can contain multiple VMs at your AM.)

Did that help?

comment:10 Changed 7 years ago by ibaldin@renci.org

I believe this one is fixed now. You can test it when ExoGENI is up EOD 06/20/12.

comment:11 Changed 7 years ago by lnevers@bbn.com

Re-ran the acceptance tests and now get the following results:

$ ./am_api_accept.py -a am-undertest --api-version 2 
F.F..........
======================================================================
FAIL: test_CreateSliver: Passes if the sliver creation workflow succeeds.  Use --rspec-file to replace the default request RSpec.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./am_api_accept.py", line 612, in test_CreateSliver
    self.subtest_CreateSliverWorkflow()
  File "./am_api_accept.py", line 678, in subtest_CreateSliverWorkflow
    "but did not." % slicename)
  File "/home/lnevers/gcf-1.6.2/src/omni_unittest.py", line 154, in assertCompIDsEqual
    raise NotEqualComponentIDsError, msg
NotEqualComponentIDsError: Request RSpec and Manifest RSpec returned by 'ListResources' on slice 'acclne-130424' expected to have same component_ids but did not.

======================================================================
FAIL: test_CreateSliverWorkflow_multiSlice: Do CreateSliver workflow with multiple slices and ensure can not do ListResources on slices with the wrong credential.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./am_api_accept.py", line 970, in test_CreateSliverWorkflow_multiSlice
    "but did not." % slicenames[i])
  File "/home/lnevers/gcf-1.6.2/src/omni_unittest.py", line 154, in assertCompIDsEqual
    raise NotEqualComponentIDsError, msg
NotEqualComponentIDsError: Request RSpec and Manifest RSpec returned by 'ListResources' on slice 'acclne-1305210' expected to have same component_ids but did not.

----------------------------------------------------------------------
Ran 13 tests in 283.426s

FAILED (failures=2)

comment:12 Changed 7 years ago by ibaldin@renci.org

Orca ignores component id in the request. Put whatever you want in it to match the manifest.

comment:13 Changed 7 years ago by ahelsing@bbn.com

Cc: sedwards@bbn.com added

I don't understand that comment.

How does the experimenter know in advance what the component_id will be in the manifest, when they are constructing the request?

That said, this particular test is trying to validate that the manifest gives you the same components that were requested. Luisa, can you work with Sarah to identify from the logs exactly what the tests are complaining about? Perhaps the component_id is a red herring.

comment:14 Changed 7 years ago by lnevers@bbn.com

I will work with Sarah. Also re-ran with "--un-bound" option which requests some resources, not a particular resource. This option by-passes the component_id comparison.

The current acceptance test run reports two failures, which Sarah is investigating to determine the source of these failures. Here is the current am_api_accept.py results:

lnevers@arendia:~/gcf-1.6.2/acceptance_tests/AM_API$ ./am_api_accept.py -a am-undertest --api-version 2 --un-bound
F.F..........
======================================================================
FAIL: test_CreateSliver: Passes if the sliver creation workflow succeeds.  Use --rspec-file to replace the default request RSpec.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./am_api_accept.py", line 612, in test_CreateSliver
    self.subtest_CreateSliverWorkflow()
  File "./am_api_accept.py", line 697, in subtest_CreateSliverWorkflow
    self.subtest_SliverStatus( slicename )
  File "./am_api_accept.py", line 1189, in subtest_SliverStatus
    self.assertKeyValueType( 'SliverStatus', aggName, resource, 'geni_error', str )
  File "/home/lnevers/gcf-1.6.2/src/omni_unittest.py", line 217, in assertKeyValueType
    % (method, aggName, key, str(dictionary)))
AssertionError: Return from 'SliverStatus' at https://bbn-hn.exogeni.net:11443
/orca/xmlrpc expected to have entry 'geni_error' but instead returned:
{'orca_expires': 'Tue Jul 24 13:57:02 UTC 2012', 'geni_urn': 'urn:publicid:IDN+exogeni.net:bbnvmsite+sliver+835ecc95-3433-48e9-8fce-544c8fa37016#geni1', 'geni_status': 'Ticketed'}
... edited for length ...

======================================================================
FAIL: test_CreateSliverWorkflow_multiSlice: Do CreateSliver workflow with multiple slices and ensure can not do ListResources on slices with the wrong credential.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./am_api_accept.py", line 990, in test_CreateSliverWorkflow_multiSlice
    self.subtest_SliverStatus( slicenames[i] )
  File "./am_api_accept.py", line 1189, in subtest_SliverStatus
    self.assertKeyValueType( 'SliverStatus', aggName, resource, 'geni_error', str )
  File "/home/lnevers/gcf-1.6.2/src/omni_unittest.py", line 217, in assertKeyValueType
    % (method, aggName, key, str(dictionary)))
AssertionError: Return from 'SliverStatus' at https://bbn-hn.exogeni.net:11443
/orca/xmlrpc expected to have entry 'geni_error' but instead returned:
{'orca_expires': 'Tue Jul 24 13:58:58 UTC 2012', 'geni_urn': 'urn:publicid:IDN+exogeni.net:bbnvmsite+sliver+64c703ed-94ff-49ca-
8eac-65e6c5e70658#geni2', 'geni_status': 'Active'}
... edited for length ...
----------------------------------------------------------------------
Ran 13 tests in 327.106s
FAILED (failures=2)

comment:15 Changed 7 years ago by lnevers@bbn.com

According to Sarah, the listresources is missing a field 'geni_error' and this missing information is the source of the 2 failures in previous note:

The SliverStatus return from the log is this (reformatted slightly for readability):
{'geni_resources': [
               {'geni_status': 'Active',
                'geni_urn': 'urn:publicid:IDN+exogeni.net:bbnvmsite+sliver+64c703ed-94ff-49ca-8eac-65e6c5e70658#geni2',
                 'orca_expires': 'Tue Jul 24 13:58:58 UTC 2012'}],
 'geni_status': 'ready',
 'geni_urn': 'urn:publicid:IDN+pgeni.gpolab.bbn.com+slice+acclne-1357530'
}

Looks to me like it's missing `geni_error` and is otherwise fine.  The missing `geni_error` should be reported as a bug.

Adding this note to track the missing geni_error information in the sliverstatus output.

comment:16 Changed 7 years ago by ibaldin@renci.org

I fixed it in the code. It will not get deployed for the next two+ weeks. Why we want to have an empty field when there is no error is a separate question.

comment:17 Changed 7 years ago by ibaldin@renci.org

Regarding Aaron's comment.

Orca does not expose component ids, other then indicating a generic type in the ad (orca-local-net, orca-transit-net, orca-vm-cloud etc). They have no internal meaning other than trying to stay compatible with the RSpec.

The triple <ORCA SM URL, component_manager_id, resource type> uniquely determines how the resources are instantiated.

comment:18 Changed 7 years ago by lnevers@bbn.com

Resolution: fixed
Status: assignedclosed

Forgot to update this yesterday. The AM API Acceptance test was run and the test now completes without any errors:

$ ./am_api_accept.py -a am-undertest --api-version 2 --un-bound
.............
----------------------------------------------------------------------
Ran 13 tests in 737.410s

Yeah!! I think this ticket has been addressed. Closing.

Note: See TracTickets for help on using tickets.