[[PageOutline]] '''Page is still under development please contact [mailto:help@geni.net] for any problems/questions. As of Nov. 8th, 2013 this process is broken in Flack, so please use the Omni alternative.''' = 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 Flack == The Flack tool supports create, using, listing and deleting custom images. Each of these custom image functions are outlined in this section. === Creating a Custom Image === The 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. 1. 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: [[Image(CustomImage-flack-pt.jpg)]] 2. Once you have selected the slice in Flack you will see the the resources in use: [[Image(CustomImage-topo-pt.jpg)]] 3. 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: [[Image(CustomImage-create-pt.jpg)]] 4. 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: [[Image(CustomImage-name-pt.jpg)]] 5. Clicking the '' '''OK''' '' button will start the custom image creation. You will then see a results window which will report that the image is creates and provides information to use the image on future slices: [[Image(CustomImage-confirm-pt.jpg)]] You may choose to ''copy'', ''save'' or ''email'' the custom image information. You are now ready to use your custom image in other slices. === Using your Custom Image === This section will show you how to use the custom image creates in the previous section, first in the same rack and then in a different rack. 1. To use your custom image in the same rack, first create your new slice and then proceed to define the sliver. Once you have added a host, select the node information button and click on the ''Select a user for user-created disk images'' pulldown: [[Image(CustomImage-select-pt.jpg)]] Once you have selected the ''Select a user for user-created disk images'' a pop-up windows will show your user URN, keep the default if you a using your own image, if you are using someone else's image, you must enter their URN: [[Image(customimage-select1-pt.jpg)]] === Deleting your Custom Image === == 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: ============================================================ }}} 2. 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", <<<>>> "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" }}} 3. 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.py 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. 4. Omni also includes a command to ''' ''listimages'' ''', which lists your custom images, both public and private: {{{ $ omni.py 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: ============================================================ }}} 5. 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: {{{ }}} === 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.py 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: {{{ }}} 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: {{{ }}} 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: {{{ }}} 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.py 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 >> } ] }}} 2. 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!