| 683 | |
| 684 | |
| 685 | -------------- |
| 686 | |
| 687 | == Windows 7 Example == |
| 688 | |
| 689 | This 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 | |
| 691 | NS file with two nodes, both running the {{{PNODE-BASE}}} image. |
| 692 | {{{ |
| 693 | #!tcl |
| 694 | set ns [new Simulator] |
| 695 | source tb_compat.tcl |
| 696 | |
| 697 | tb-make-soft-vtype container0 {pc2133 MicroCloud dl380g3} |
| 698 | |
| 699 | set base1 [$ns node] |
| 700 | tb-set-node-os $base1 PNODE-BASE |
| 701 | tb-set-hardware $base1 container0 |
| 702 | tb-set-node-failure-action $base1 "nonfatal" |
| 703 | |
| 704 | set base2 [$ns node] |
| 705 | tb-set-node-os $base2 PNODE-BASE |
| 706 | tb-set-hardware $base2 container0 |
| 707 | tb-set-node-failure-action $base2 "nonfatal" |
| 708 | |
| 709 | set lan1 [$ns make-lan "$base1 $base2" 100Mb 0.0ms DropTail] |
| 710 | tb-set-ip-lan $base1 $lan1 10.0.0.1 |
| 711 | tb-set-ip-lan $base2 $lan1 10.0.0.2 |
| 712 | |
| 713 | $ns rtproto Static |
| 714 | $ns run |
| 715 | }}} |
| 716 | |
| 717 | Create a new experiment with the NS file above. *Do not* swap in the experiment. |
| 718 | |
| 719 | We 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 |
| 723 | users: > ssh chef |
| 724 | chef: > cd src/config_server |
| 725 | chef: > git pull ~chef-user/config_server # grab the newest code from chef-user. |
| 726 | chef: > ./runserver.py -l debug -p 5323 -d $(pwd)/config.db # full path to DB and unused port. |
| 727 | }}} |
| 728 | |
| 729 | Create 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 | |
| 759 | Note that the Win7 nodes are in the same subnet at the physical nodes. |
| 760 | |
| 761 | Load 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 |
| 765 | users: > /share/config_server/bin/initialize_containers.py -p deter -e neo-win7 -f neo-win7.nodes.json -P 5323 -l debug |
| 766 | }}} |
| 767 | |
| 768 | Note that {{{neo-win7.nodes.json}}} is the JSON file above and we use the port of our own config_server. |
| 769 | |
| 770 | Output should not contain {{{[ERROR]}}} or {{{[WARN]}}} messages. Here's an example of a good run: |
| 771 | |
| 772 | {{{ |
| 773 | #!sh |
| 774 | 01-27 09:29:11 __main__ INFO Log level set to debug |
| 775 | 01-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 |
| 777 | 01-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 | |
| 785 | Now swap in the experiment: |
| 786 | |
| 787 | {{{ |
| 788 | #!sh |
| 789 | users: > swapexp -wNe deter,neo-win7 in |
| 790 | }}} |
| 791 | |
| 792 | Once swapped in, we log into a base node and kick off the chef processes to create and start the Win7 node. |