Changes between Version 44 and Version 45 of NeoContainers


Ignore:
Timestamp:
Jan 27, 2016 9:51:12 AM (8 years ago)
Author:
Geoff Lawler
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NeoContainers

    v44 v45  
    681681<!------------------------------------------------------------------------>
    682682}}}
     683
     684
     685--------------
     686
     687== Windows 7 Example ==
     688
     689This example shows how to bring up Win7 nodes. It does not use the old containers system. It has two nodes in a single LAN, then spins up a single Win7 node on each.
     690
     691NS file with two nodes, both running the {{{PNODE-BASE}}} image.
     692{{{
     693#!tcl
     694set ns [new Simulator]
     695source tb_compat.tcl
     696
     697tb-make-soft-vtype container0 {pc2133 MicroCloud dl380g3}
     698
     699set base1 [$ns node]
     700tb-set-node-os $base1 PNODE-BASE
     701tb-set-hardware $base1 container0
     702tb-set-node-failure-action $base1 "nonfatal"
     703
     704set base2 [$ns node]
     705tb-set-node-os $base2 PNODE-BASE
     706tb-set-hardware $base2 container0
     707tb-set-node-failure-action $base2 "nonfatal"
     708
     709set lan1 [$ns make-lan "$base1 $base2" 100Mb 0.0ms DropTail]
     710tb-set-ip-lan $base1 $lan1 10.0.0.1
     711tb-set-ip-lan $base2 $lan1 10.0.0.2
     712
     713$ns rtproto Static
     714$ns run
     715}}}
     716
     717Create a new experiment with the NS file above. *Do not* swap in the experiment.
     718
     719We run our own configuration database on the {{{chef}}} node. This is not required, but keeps our configuration separate from the "official" configuration database.
     720
     721{{{
     722#!sh
     723users: > ssh chef
     724chef: > cd src/config_server
     725chef: > git pull ~chef-user/config_server   # grab the newest code from chef-user.
     726chef: > ./runserver.py -l debug -p 5323 -d $(pwd)/config.db    # full path to DB and unused port.
     727}}}
     728
     729Create a {{{nodes.json}}} file which describes the Win7 nodes to create:
     730
     731{{{
     732#!json
     733[
     734        {
     735                "host": "base1",
     736                "name": "billg",
     737                "image_url": "http://scratch/containers/deter_win7.box",
     738                "image_os": "windows",
     739                "image_type": "vagrant",
     740                "image_name": "deter/win7",
     741                "interfaces": [
     742                    { "address": "10.0.0.101", "mac": "de:ad:be:ef:00:bf" }
     743                ]
     744        },
     745        {
     746                "host": "base2",
     747                "name": "ballmer",
     748                "image_url": "http://scratch/containers/deter_win7.box",
     749                "image_os": "windows",
     750                "image_type": "vagrant",
     751                "image_name": "deter/win7",
     752                "interfaces": [
     753                    { "address": "10.0.0.102", "mac": "de:ad:be:ef:00:c1" }
     754                ]
     755        }
     756]
     757}}}
     758
     759Note that the Win7 nodes are in the same subnet at the physical nodes.
     760
     761Load the configuration into our configuration server running on {{{chef}}}. This must be done *before* swapping in the experiment as the configuration server must request control network addresses from DETER.
     762
     763{{{
     764#!sh
     765users: > /share/config_server/bin/initialize_containers.py -p deter -e neo-win7 -f neo-win7.nodes.json -P 5323 -l debug
     766}}}
     767
     768Note that {{{neo-win7.nodes.json}}} is the JSON file above and we use the port of our own config_server.
     769
     770Output should not contain {{{[ERROR]}}} or {{{[WARN]}}} messages. Here's an example of a good run:
     771
     772{{{
     773#!sh
     77401-27 09:29:11 __main__     INFO     Log level set to debug
     77501-27 09:29:11 __main__     DEBUG    using base url: /exp/deter/neo-win7/insert
     776[OK   ] : Initializing containers from neo-win7.nodes.json for use in experiment deter/neo-win7
     77701-27 09:29:11 __main__     DEBUG    sending url: http://chef:5323/exp/deter/neo-win7/insert/containers
     778[OK   ] : upload_node_file: Connecting to server chef:5323
     779[OK   ] : upload_node_file: Posting node data ... url=/exp/deter/neo-win7/insert/containers
     780[OK   ] : Upload_node_file: Getting Response
     781[OK   ] : Good response from server. Message: Nodes added: billg, ballmer
     782[OK   ] : All is well. Nodes initialized.
     783}}}
     784
     785Now swap in the experiment:
     786
     787{{{
     788#!sh
     789users: > swapexp -wNe deter,neo-win7 in
     790}}}
     791
     792Once swapped in, we log into a base node and kick off the chef processes to create and start the Win7 node.