wiki:HowTo/ManageCustomImagesInstaGENI

Version 23 (modified by Vic Thomas, 4 years ago) (diff)

--

InstaGENI Custom Images

This page capture examples for creating InstaGENI Custom images using both Flack and Omni tools. Custom images are usually created when you have defined and experiment node that has all the features and applications that you intend to use again and again for additional experiments.

Custom Images with Omni

The Omni tool also supports create, using, listing and deleting custom images. Each of these custom image functions are outlined in this section.

Creating Custom Image

The omni tools allows experimenters to create custom images by replicating any node in an active experiment. In this example a slice lntest is used which includes 2 hosts. The host1 image will be captured with omni.

  1. In order to capture the Image running on host1 we must determine the URN for the host1 device by getting a sliver status:
    $ omni.py sliverstatus -a gpo-ig lntest -o
    17:24:08 INFO     omni: Loading agg_nick_cache file '/home/lnevers/.gcf/agg_nick_cache'
    17:24:08 INFO     omni: Loading config file /home/lnevers/.gcf/omni_config
    17:24:08 INFO     omni: Using control framework portal
    17:24:08 INFO     omni: Substituting AM nickname gpo-ig with URL https://boss.instageni.gpolab.bbn.com:12369/protogeni/xmlrpc/am/2.0, URN urn:publicid:IDN+instageni.gpolab.bbn.com+authority+cm
    17:24:09 INFO     omni: Slice urn:publicid:IDN+ch.geni.net:ln-prj+slice+lntest expires on 2013-11-04 21:21:50 UTC
    17:24:09 INFO     omni: Status of Slice urn:publicid:IDN+ch.geni.net:ln-prj+slice+lntest:
    17:24:11 INFO     omni:  (PG log url - look here for details on any failures: https://boss.instageni.gpolab.bbn.com/spewlogfile.php3?logfile=3769ab3e1ea15ccc069641ec06e946b5)
    17:24:11 INFO     omni: Slice urn:publicid:IDN+ch.geni.net:ln-prj+slice+lntest at AM https://boss.instageni.gpolab.bbn.com:12369/protogeni/xmlrpc/am/2.0 has overall SliverStatus: unknown
    17:24:11 INFO     omni: Writing to 'lntest-sliverstatus-instageni-gpolab-bbn-com.json'
    17:24:11 INFO     omni: Sliver status for Slice urn:publicid:IDN+ch.geni.net:ln-prj+slice+lntest at AM URL https://boss.instageni.gpolab.bbn.com:12369/protogeni/xmlrpc/am/2.0
    17:24:11 INFO     omni: ------------------------------------------------------------
    17:24:11 INFO     omni:  Completed sliverstatus:
    Args: sliverstatus lntest
    
      Result Summary: Slice urn:publicid:IDN+ch.geni.net:ln-prj+slice+lntest expires on 2013-11-04 21:21:50 UTC
    Slice urn:publicid:IDN+ch.geni.net:ln-prj+slice+lntest at AM https://boss.instageni.gpolab.bbn.com:12369/protogeni/xmlrpc/am/2.0 has overall SliverStatus: unknown.
     Saved sliverstatus on lntest at AM https://boss.instageni.gpolab.bbn.com:12369/protogeni/xmlrpc/am/2.0 to file lntest-sliverstatus-instageni-gpolab-bbn-com.json.
    Returned status of slivers on 1 of 1 possible aggregates.
    17:24:11 INFO     omni: ============================================================
    
  1. Look at the content of the sliver status output file (lntest-sliverstatus-instageni-gpolab-bbn-com.json) and search for host1 and find its sliver_id . Below is an excerpt of the sliver status output file that show information required:
 "attributes": {
 "exclusive": "false",
 "sliver_id": "urn:publicid:IDN+instageni.gpolab.bbn.com+sliver+18223",   <<<<This URN is needed to create image.>>>>
 "component_manager_id": "urn:publicid:IDN+instageni.gpolab.bbn.com+authority+cm",
 "client_id": "host1",                                                    <<< Information is for host1>>>
 "component_id": "urn:publicid:IDN+instageni.gpolab.bbn.com+node+pc1"     
  1. You now have the device URN that is actively running as host1 in the slice lntest. With this information we can now have omni create a custom image which we will name Icreatedthisimage using the slice lntest' and the URN that corresponds to host1:
    $ omni createimage -a gpo-ig lntest Icreatedthisimage -u urn:publicid:IDN+instageni.gpolab.bbn.com+sliver+18223
    17:28:46 INFO     omni: Loading agg_nick_cache file '/home/lnevers/.gcf/agg_nick_cache'
    17:28:46 INFO     omni: Loading config file /home/lnevers/.gcf/omni_config
    17:28:46 INFO     omni: Using control framework portal
    17:28:46 INFO     omni: Substituting AM nickname gpo-ig with URL https://boss.instageni.gpolab.bbn.com:12369/protogeni/xmlrpc/am/2.0, URN urn:publicid:IDN+instageni.gpolab.bbn.com+authority+cm
    17:28:47 INFO     omni: Slice urn:publicid:IDN+ch.geni.net:ln-prj+slice+lntest expires on 2013-11-04 21:21:50 UTC
    17:28:49 INFO     omni:  (PG log url - look here for details on any failures: https://boss.instageni.gpolab.bbn.com/spewlogfile.php3?logfile=4e800868c7546f75ec6d528ef879bc40)
    17:28:49 INFO     omni: Snapshotting disk on urn:publicid:IDN+instageni.gpolab.bbn.com+sliver+18223 at https://boss.instageni.gpolab.bbn.com:12369/protogeni/xmlrpc/am/2.0, creating public image ['urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage', 'https://boss.instageni.gpolab.bbn.com/image_metadata.php?uuid=ef4340a8-4017-11e3-9226-029e26f15299']
    17:28:49 INFO     omni: ------------------------------------------------------------
    17:28:49 INFO     omni:  Completed createimage:
    Args: createimage lntest Icreatedthisimage
    
      Result Summary: Snapshotting disk on urn:publicid:IDN+instageni.gpolab.bbn.com+sliver+18223 at https://boss.instageni.gpolab.bbn.com:12369/protogeni/xmlrpc/am/2.0, creating public image ['urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage', 'https://boss.instageni.gpolab.bbn.com/image_metadata.php?uuid=ef4340a8-4017-11e3-9226-029e26f15299']
    17:28:49 INFO     omni: ============================================================
    

Notice the Result Summary includes the information that you need to use the image: creating public image ['urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage', 'https://boss.instageni.gpolab.bbn.com/image_metadata.php?uuid=ef4340a8-4017-11e3-9226-029e26f15299']. The new custom image URN and URL can be used for other nodes to load the image.

  1. Omni also includes a command to listimages , which lists your custom images, both public and private:
    $ omni listimages -a gpo-ig
    17:29:41 INFO     omni: Loading agg_nick_cache file '/home/lnevers/.gcf/agg_nick_cache'
    17:29:41 INFO     omni: Loading config file /home/lnevers/.gcf/omni_config
    17:29:41 INFO     omni: Using control framework portal
    17:29:41 INFO     omni: Substituting AM nickname gpo-ig with URL https://boss.instageni.gpolab.bbn.com:12369/protogeni/xmlrpc/am/2.0, URN urn:publicid:IDN+instageni.gpolab.bbn.com+authority+cm
    17:29:42 INFO     omni: ListImages using creator_urn 'urn:publicid:IDN+ch.geni.net+user+lnevers'
    17:29:44 INFO     omni:  (PG log url - look here for details on any failures: https://boss.instageni.gpolab.bbn.com/spewlogfile.php3?logfile=fc27433f9d2b6f5dd0183dbf784bd1a4)
    17:29:44 INFO     omni: [
      {
        "url": "https://boss.instageni.gpolab.bbn.com/image_metadata.php?uuid=ef4340a8-4017-11e3-9226-029e26f15299",
        "urn": "urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage"
      }
    ]
    17:29:44 INFO     omni: ------------------------------------------------------------
    17:29:44 INFO     omni:  Completed listimages:
    Args: listimages
    
      Result Summary: Images created by urn:publicid:IDN+ch.geni.net+user+lnevers at https://boss.instageni.gpolab.bbn.com:12369/protogeni/xmlrpc/am/2.0:
    [
      {
        "url": "https://boss.instageni.gpolab.bbn.com/image_metadata.php?uuid=ef4340a8-4017-11e3-9226-029e26f15299",
        "urn": "urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage"  <<==This is the image we just created >>
      }
    ]
    17:29:44 INFO     omni: ============================================================
    
  1. You are now ready to use the custom image in other slices. Following is an example node definition in a request RSpec that uses the image we just created:
      <node client_id="cust-host1" exclusive="false">
          <sliver_type name="emulab-openvz" />
          <disk_image name="urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage" />
          </sliver_type>
          <interface client_id="cust-host1:if0" />
      </node>
    

Using your Custom Image

First find out the Image URL and URN information. This can be done with the omni listimages option at your rack aggregate:

$ omni listimages -a my_rack_nickname

Now that you have the image information, you can add it to your request RSpec. To add an custom disk image that can run in any rack, you should use both URN and URL in your RSpec:

   <disk_image name="urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage" 
    url="https://boss.instageni.gpolab.bbn.com/image_metadata.php?uuid=ef4340a8-4017-11e3-9226-029e26f15299" />

If you plan to use the custom image in the same rack as the original sliver used to generate the image, you only need to specify your custom image URN:

   <disk_image name="urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage" />

If you plan to use the custom image in a different rack than the original sliver used to generate the image, you only need specify your custom image URL:

   <disk_image url="https://boss.instageni.gpolab.bbn.com/image_metadata.php?uuid=ef4340a8-4017-11e3-9226-029e26f15299"/>

That is all that is required to use your custom image!

Deleting your Custom Image

Deleting your custom image is done as follows with omni.

  1. First determine the image urn by using the omni listimages option:
    lnevers@sendaria:~/gcf-2.4.1/instarspec$ omni listimages -a gpo-ig
    17:29:41 INFO     omni: Loading agg_nick_cache file '/home/lnevers/.gcf/agg_nick_cache'
    17:29:41 INFO     omni: Loading config file /home/lnevers/.gcf/omni_config
    17:29:41 INFO     omni: Using control framework portal
    17:29:41 INFO     omni: Substituting AM nickname gpo-ig with URL https://boss.instageni.gpolab.bbn.com:12369/protogeni/xmlrpc/am/2.0, URN urn:publicid:IDN+instageni.gpolab.bbn.com+authority+cm
    17:29:42 INFO     omni: ListImages using creator_urn 'urn:publicid:IDN+ch.geni.net+user+lnevers'
    17:29:44 INFO     omni:  (PG log url - look here for details on any failures: https://boss.instageni.gpolab.bbn.com/spewlogfile.php3?logfile=fc27433f9d2b6f5dd0183dbf784bd1a4)
    17:29:44 INFO     omni: [
      {
        "url": "https://boss.instageni.gpolab.bbn.com/image_metadata.php?uuid=ef4340a8-4017-11e3-9226-029e26f15299",
        "urn": "urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage"
      }
    ]
    17:29:44 INFO     omni: ------------------------------------------------------------
    17:29:44 INFO     omni:  Completed listimages:
    Args: listimages
    
      Result Summary: Images created by urn:publicid:IDN+ch.geni.net+user+lnevers at https://boss.instageni.gpolab.bbn.com:12369/protogeni/xmlrpc/am/2.0:
    [
      {
        "url": "https://boss.instageni.gpolab.bbn.com/image_metadata.php?uuid=ef4340a8-4017-11e3-9226-029e26f15299",
        "urn": "urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage"  <<==This is the image we will delete >>
      }
    ]
    
  1. Delete the image:
    $ omni.py deleteimage urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage -a gpo-ig
    10:30:54 INFO     omni: Loading agg_nick_cache file '/home/lnevers/.gcf/agg_nick_cache'
    10:30:54 INFO     omni: Loading config file /home/lnevers/.gcf/omni_config
    10:30:54 INFO     omni: Using control framework portal
    10:30:54 INFO     omni: Substituting AM nickname gpo-ig with URL https://boss.instageni.gpolab.bbn.com:12369/protogeni/xmlrpc/am/2.0, URN urn:publicid:IDN+instageni.gpolab.bbn.com+authority+cm
    10:30:54 INFO     omni: DeleteImage using image_urn 'urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage'
    10:30:57 INFO     omni:  (PG log url - look here for details on any failures: https://boss.instageni.gpolab.bbn.com/spewlogfile.php3?logfile=c5d9fb81c216d701cb729a103b7adab5)
    10:30:57 INFO     omni: Deleted image urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage at https://boss.instageni.gpolab.bbn.com:12369/protogeni/xmlrpc/am/2.0
    10:30:57 INFO     omni:  ------------------------------------------------------------
    10:30:57 INFO     omni:  Completed deleteimage:
    Args: deleteimage urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage
    
      Result Summary: Deleted image urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage at https://boss.instageni.gpolab.bbn.com:12369/protogeni/xmlrpc/am/2.0 
    10:30:57 INFO     omni:  ============================================================
    

Your image is now been removed!

Attachments (12)

Download all attachments as: .zip