VirtualBoxTestEnvironment
From BCCD 3.0
Contents |
GUI
VirtualBox Procedure for BCCD-ng
- Download/Configure Virtual Box.
- Download the latest bccd image.
- Download/Install the Virtual Box Extension Pack
- This enables PXE Booting through Virutal Box. If you want to PXE Boot, make sure to liberate the head node first
- Create a new virtual machine for 1 ... n different virtual nodes.
- Choose 'Linux' for Operating System
- For Version choose:
- 'Debian', if running 32 bit BCCD
- 'Debian (64 bit)', if running 64 bit BCCD (without this BCCD won't detect 64-bit hardware)
- Make a hard drive for the head node with the default of 8 GB to test liberation
- Point each VM's virtual CD/DVD drive to the image.
- Configure the internal network for the head node
- Only the head node needs to connect to the Internet
- Choose Settings -> Network -> Adapter 2
- set 'attached to' to 'internal network'
- set the adapter to intel PRO/1000 MT Server
- set 'network name to 'bccd'
- Configure internal network for the rest of the nodes
- Choose Settings -> Network -> Adapter 1
- set 'attached to' to 'internal network'
- set the adapter to intel PRO/1000 MT Server
- set 'network name' to 'bccd'
- Now an internal network has been established between the virtual nodes.
- Start up each virtual machine, making sure that the head node gets a significant head start.
- On the head node only, configure eth1 to ip 192.168.0.* (where * = a number between 1 and 255), subnet 255.255.255.0, no gateway
- Each client node should pick up an IP address automatically and not prompt for one.
- On the head node, run bccd-snarfhosts and cat ~/machines
- Make sure there's an entry for each node you've attached
CLI
- Configure your NICs
- Figure out your public (bridged) NIC by examining the output of
/sbin/ifconfig -a. - Create a private (host-only) NIC with
VBoxManage hostonlyif ipconfig vboxnet0 --ip 192.168.4.0 --netmask 255.255.255.0. - Disable DHCP with
VBoxManage dhcpserver remove --netname HostInterfaceNetworking-vboxnet0.
- Figure out your public (bridged) NIC by examining the output of
- Create your VM
-
VBoxManage createvm --name bccd-ng0 --ostype Debian --register
-
- Attach a SATA controller
-
VBoxManage storagectl bccd-ng0 --name sata0 --add sata --controller IntelAHCI --sataportcount 4
-
- Create a hard disk image
-
VBoxManage createhd --filename ~/VirtualBox\ VMs/bccd-ng0/bccd-ng0.vdi --size 8192
-
- Attach the hard drive to the SATA controller
-
VBoxManage storageattach bccd-ng0 --storagectl sata0 --port 0 --device 0 --type hdd --medium ~/VirtualBox\ VMs/bccd-ng0/bccd-ng0.vdi
-
- Attach a DVD drive
-
VBoxManage storageattach bccd-ng0 --storagectl sata0 --port 1 --device 0 --type dvddrive --medium /cluster/bccd-ng/testing/bccd0_r2921.iso - Modify the VM with
VBoxManage modifyvm bccd-ng0 --memory 256 --acpi on --ioapic on --vtxvpid on --nestedpaging on --hwvirtex on --nic1 intnet --nictype1 82545EM --intnet1 bccd-ng0-net --nic2 bridged --nictype2 82545EM --bridgeadapter2 eth1 --vrde on --vrdeaddress 0.0.0.0 --vrdeport 3901 --vrdeauthtype external --boot1 dvd --boot2 disk. (Make sure the intnet network name is unique for every BCCD network you want setup, and that you have the Extension Pack installed if you want to use the remote desktop)
-
Remote Management
You can use VRDP to manage the VMs remotely. Make sure you supply different ports for your VMs with --vrdpport. If you connect to the VM from Windows, you should be sure to supply a bogus username so that Windows doesn't screw things up with its credential caching.
- Starting the VM:
VBoxHeadless --startvm vmname. - Stop the VM:
VBoxManage controlvm vmname poweroff. - Reset the VM:
VBoxManage control reset.
Passing Boot Flags through VirtualBox's custom mac address
One can change VirtualBox's mac address via through the virutalbox gui or with the command
vboxmanage modifyvm <virtual machine name> --macaddress1 <new mac address written without ':'s> (ex. 020000000001)
The Custom MAC
To activate the BCCD's automatic test suite (not yet implemented), use the following format: 02:YY:YY:NI:OX:XX
- Y represent characters that should be set to ensure the MAC address's randomness on any network the system is expected to be on.
- N represents the number of nodes
- I represents the number of NICs
- O represents the ordinal position of the NIC (i.e. first, second, etc.)
- X represents free space for additional flags (use any hex digit)
Binary Boot Flags Encoded in Hexadecimal
The final three Xs represent 12 bits in which arbitrary boot flags may be set. Following are the positions of each bit within the 12 and their meanings.
- (0) : Network specification
- 0 : I am the External Network NIC. I connect to the Internet.
- 1 : I am the BCCD Network NIC. I connect to the other nodes.
- (1): Control or Test
- 0 : Automatically run the test suite with the default control and shut down
- 1 : Automatically build a control and shut down
- (1-7) : Unused
- (8-12): How many client nodes do we expect to connect? (Number of nodes not including head node) (Max 15, aka 1111)
There are plenty of websites available to help you convert your binary boot flag string to hexadecimal: One such website
Note: This configuration should be set only for the NIC that will handle the external network (if there is one) and the NIC that will handle the BCCD network. All boot flags besides the flags to match NICs to networks are taken from the BCCD Network NIC.