Changes between Initial Version and Version 1 of HowTo/ManageCustomImagesInstaGENI


Ignore:
Timestamp:
11/08/13 13:44:38 (10 years ago)
Author:
nriga@bbn.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HowTo/ManageCustomImagesInstaGENI

    v1 v1  
     1[[PageOutline]]
     2
     3= InstaGENI Custom Images =
     4
     5This 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.
     6
     7== Custom Images with Flack ==
     8
     9The Flack tool supports create, using, listing and deleting custom images.  Each of these custom image functions are outlined in this section.
     10
     11=== Creating a Custom Image ===
     12
     13The Flack tool can make a copy of an OS image from any active node in a slice. The custom image that Flack creates is a capture of your original image that is available via a URN and URL for use by later slices in the same rack or in other racks. In this example we have a slice named ''lntest''  which includes 2 hosts is used to create image.
     14
     151. First access the slice that includes the node whose setup you would like to capture in a custom image. This example uses the GENI portal, where you select  the "Launch Flack" button for the slice:
     16
     17[[Image(CustomImage-flack-pt.jpg)]]
     18
     192. Once you have selected the slice in Flack you will see the the resources in use:
     20
     21[[Image(CustomImage-topo-pt.jpg)]]
     22
     233. We are going to select '' '''host2''' '' to generate a custom image. First click on the '' '''host2''' ''  information button [[Image(info.jpg)]], this brings up the host details. Select the ''Create Image'' button:
     24
     25[[Image(CustomImage-create-pt.jpg)]]
     26
     274. Selecting the ''Create Image'' button results in a pop-up requesting that you name the custom image that is about to be created for you:
     28
     29[[Image(CustomImage-name-pt.jpg)]]
     30
     315. Clicking the '' '''OK''' '' button will start the custom image creation.
     32
     33=== Using your Custom Image ===
     34
     35=== Deleting your Custom Image ===
     36
     37== Custom Images with Omni ==
     38
     39The Omni tool also supports create, using, listing and deleting custom images.  Each of these custom image functions are outlined in this section.
     40
     41=== Creating Custom Image ===
     42
     43The 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.
     44
     451. In order to capture the Image running on '' '''host1''' '' we must determine the URN for the host1 device by getting a sliver status:
     46{{{
     47$ omni.py sliverstatus -a gpo-ig lntest -o
     4817:24:08 INFO     omni: Loading agg_nick_cache file '/home/lnevers/.gcf/agg_nick_cache'
     4917:24:08 INFO     omni: Loading config file /home/lnevers/.gcf/omni_config
     5017:24:08 INFO     omni: Using control framework portal
     5117: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
     5217:24:09 INFO     omni: Slice urn:publicid:IDN+ch.geni.net:ln-prj+slice+lntest expires on 2013-11-04 21:21:50 UTC
     5317:24:09 INFO     omni: Status of Slice urn:publicid:IDN+ch.geni.net:ln-prj+slice+lntest:
     5417:24:11 INFO     omni:  (PG log url - look here for details on any failures: https://boss.instageni.gpolab.bbn.com/spewlogfile.php3?logfile=3769ab3e1ea15ccc069641ec06e946b5)
     5517: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
     5617:24:11 INFO     omni: Writing to 'lntest-sliverstatus-instageni-gpolab-bbn-com.json'
     5717: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
     5817:24:11 INFO     omni: ------------------------------------------------------------
     5917:24:11 INFO     omni:  Completed sliverstatus:
     60Args: sliverstatus lntest
     61
     62  Result Summary: Slice urn:publicid:IDN+ch.geni.net:ln-prj+slice+lntest expires on 2013-11-04 21:21:50 UTC
     63Slice 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.
     64 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.
     65Returned status of slivers on 1 of 1 possible aggregates.
     6617:24:11 INFO     omni: ============================================================
     67}}}
     68
     69
     702. 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:
     71
     72{{{
     73 "attributes": {
     74 "exclusive": "false",
     75 "sliver_id": "urn:publicid:IDN+instageni.gpolab.bbn.com+sliver+18223",   <<<<This URN is needed to create image.>>>>
     76 "component_manager_id": "urn:publicid:IDN+instageni.gpolab.bbn.com+authority+cm",
     77 "client_id": "host1",                                                    <<< Information is for host1>>>
     78 "component_id": "urn:publicid:IDN+instageni.gpolab.bbn.com+node+pc1"     
     79}}}
     803. 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'':
     81{{{
     82$ omni.py createimage -a gpo-ig lntest Icreatedthisimage -u urn:publicid:IDN+instageni.gpolab.bbn.com+sliver+18223
     8317:28:46 INFO     omni: Loading agg_nick_cache file '/home/lnevers/.gcf/agg_nick_cache'
     8417:28:46 INFO     omni: Loading config file /home/lnevers/.gcf/omni_config
     8517:28:46 INFO     omni: Using control framework portal
     8617: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
     8717:28:47 INFO     omni: Slice urn:publicid:IDN+ch.geni.net:ln-prj+slice+lntest expires on 2013-11-04 21:21:50 UTC
     8817:28:49 INFO     omni:  (PG log url - look here for details on any failures: https://boss.instageni.gpolab.bbn.com/spewlogfile.php3?logfile=4e800868c7546f75ec6d528ef879bc40)
     8917: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']
     9017:28:49 INFO     omni: ------------------------------------------------------------
     9117:28:49 INFO     omni:  Completed createimage:
     92Args: createimage lntest Icreatedthisimage
     93
     94  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']
     9517:28:49 INFO     omni: ============================================================
     96}}}
     97
     98Notice the ''Result Summary'' includes the information that you need to use the image:
     99{{{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.
     100
     1014. Omni also includes a command to ''' ''listimages'' ''', which lists your custom images, both public and private:
     102{{{
     103$ omni.py listimages -a gpo-ig
     10417:29:41 INFO     omni: Loading agg_nick_cache file '/home/lnevers/.gcf/agg_nick_cache'
     10517:29:41 INFO     omni: Loading config file /home/lnevers/.gcf/omni_config
     10617:29:41 INFO     omni: Using control framework portal
     10717: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
     10817:29:42 INFO     omni: ListImages using creator_urn 'urn:publicid:IDN+ch.geni.net+user+lnevers'
     10917:29:44 INFO     omni:  (PG log url - look here for details on any failures: https://boss.instageni.gpolab.bbn.com/spewlogfile.php3?logfile=fc27433f9d2b6f5dd0183dbf784bd1a4)
     11017:29:44 INFO     omni: [
     111  {
     112    "url": "https://boss.instageni.gpolab.bbn.com/image_metadata.php?uuid=ef4340a8-4017-11e3-9226-029e26f15299",
     113    "urn": "urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage"
     114  }
     115]
     11617:29:44 INFO     omni: ------------------------------------------------------------
     11717:29:44 INFO     omni:  Completed listimages:
     118Args: listimages
     119
     120  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:
     121[
     122  {
     123    "url": "https://boss.instageni.gpolab.bbn.com/image_metadata.php?uuid=ef4340a8-4017-11e3-9226-029e26f15299",
     124    "urn": "urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage"  <<==This is the image we just created >>
     125  }
     126]
     12717:29:44 INFO     omni: ============================================================
     128}}}
     129
     1305. 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:
     131{{{
     132
     133  <node client_id="cust-host1" exclusive="false">
     134      <sliver_type name="emulab-openvz" />
     135      <disk_image name="urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage" />
     136      </sliver_type>
     137      <interface client_id="cust-host1:if0" />
     138  </node>
     139}}}
     140
     141=== Using your Custom Image ===
     142
     143First find out the Image URL and URN information. This can be done with the omni '' '''listimages'' ''' option at your rack aggregate:
     144{{{
     145$ omni.py listimages -a my_rack_nickname
     146}}}
     147Now 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:
     148{{{
     149    <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" />
     150}}}
     151
     152If 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:
     153{{{
     154    <disk_image name="urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage" />
     155}}}
     156If 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:
     157{{{
     158    <disk_image url="https://boss.instageni.gpolab.bbn.com/image_metadata.php?uuid=ef4340a8-4017-11e3-9226-029e26f15299"/>
     159}}}
     160
     161That is all that is required to use your custom image!
     162
     163=== Deleting your Custom Image ===
     164
     165Deleting your custom image is done as follows with omni.
     166
     1671. First determine the image urn by using the omni '' '''listimages'' ''' option:
     168{{{
     169lnevers@sendaria:~/gcf-2.4.1/instarspec$ omni.py listimages -a gpo-ig
     17017:29:41 INFO     omni: Loading agg_nick_cache file '/home/lnevers/.gcf/agg_nick_cache'
     17117:29:41 INFO     omni: Loading config file /home/lnevers/.gcf/omni_config
     17217:29:41 INFO     omni: Using control framework portal
     17317: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
     17417:29:42 INFO     omni: ListImages using creator_urn 'urn:publicid:IDN+ch.geni.net+user+lnevers'
     17517:29:44 INFO     omni:  (PG log url - look here for details on any failures: https://boss.instageni.gpolab.bbn.com/spewlogfile.php3?logfile=fc27433f9d2b6f5dd0183dbf784bd1a4)
     17617:29:44 INFO     omni: [
     177  {
     178    "url": "https://boss.instageni.gpolab.bbn.com/image_metadata.php?uuid=ef4340a8-4017-11e3-9226-029e26f15299",
     179    "urn": "urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage"
     180  }
     181]
     18217:29:44 INFO     omni: ------------------------------------------------------------
     18317:29:44 INFO     omni:  Completed listimages:
     184Args: listimages
     185
     186  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:
     187[
     188  {
     189    "url": "https://boss.instageni.gpolab.bbn.com/image_metadata.php?uuid=ef4340a8-4017-11e3-9226-029e26f15299",
     190    "urn": "urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage"  <<==This is the image we will delete >>
     191  }
     192]
     193}}}
     194
     1952. Delete the image:
     196{{{
     197$ omni.py deleteimage urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage -a gpo-ig
     19810:30:54 INFO     omni: Loading agg_nick_cache file '/home/lnevers/.gcf/agg_nick_cache'
     19910:30:54 INFO     omni: Loading config file /home/lnevers/.gcf/omni_config
     20010:30:54 INFO     omni: Using control framework portal
     20110: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
     20210:30:54 INFO     omni: DeleteImage using image_urn 'urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage'
     20310:30:57 INFO     omni:  (PG log url - look here for details on any failures: https://boss.instageni.gpolab.bbn.com/spewlogfile.php3?logfile=c5d9fb81c216d701cb729a103b7adab5)
     20410: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
     20510:30:57 INFO     omni:  ------------------------------------------------------------
     20610:30:57 INFO     omni:  Completed deleteimage:
     207Args: deleteimage urn:publicid:IDN+instageni.gpolab.bbn.com+image+ch-geni-net:Icreatedthisimage
     208
     209  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
     21010:30:57 INFO     omni:  ============================================================
     211}}}
     212
     213Your image is now been removed!