Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

get back into git with a weird state of work. don't expect anything t…

…o work at the moment
  • Loading branch information...
commit 5fcac8cf7d8907793724498c52699ac6879fb36c 1 parent bcf6a48
@ehaselwanter ehaselwanter authored
View
15 create_base_nodes_and_hostonly_ifs.sh
@@ -0,0 +1,15 @@
+#
+# Copyright 2012, Deutsche Telekom Laboratories
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
View
157 create_blank.rb
@@ -1,157 +0,0 @@
-require 'rubygems'
-require 'virtualbox'
-require 'fileutils'
-
-# monkey patch from https://github.com/hh/virtualbox/blob/da76afa639e11fcd9f0ab4a816876fb5bd30d579/lib/virtualbox/hard_drive.rb
-
-# needs some serious cleanup
-
-module VirtualBox
- class VM
-
- class << self
-
- # Creates and registers a new VM, and returns a
- # new VM object.
- #
- # @return [VM]
- def create(name)
- settings = VirtualBox::Lib.lib.virtualbox.compose_machine_filename(name)
- imachine = VirtualBox::Lib.lib.virtualbox.create_machine(settings, name)
- VirtualBox::Lib.lib.virtualbox.register_machine(imachine)
- return VirtualBox::VM.new(imachine)
- end
- end
- end
-
- class HardDrive
- def validate
- super
-
- medium_formats = Global.global.system_properties.medium_formats.collect { |mf| mf.id }
- validates_inclusion_of :format, :in => medium_formats, :message => "must be one of the following: #{medium_formats.join(', ')}."
-
- validates_presence_of :location
-
- max_vdi_size = Global.global.system_properties.info_vd_size
- validates_inclusion_of :logical_size, :in => (0..max_vdi_size), :message => "must be between 0 and #{max_vdi_size}."
- end
-
- def create_hard_disk_medium(outputfile, format = nil)
- # Get main VirtualBox object
- virtualbox = Lib.lib.virtualbox
-
- # Assign the default format if it isn't set yet
- format ||= virtualbox.system_properties.default_hard_disk_format
-
- # Expand path relative to the default hard disk folder. This allows
- # filenames to exist in the default folder while full paths will use
- # the paths specified.
- # outputfile = File.expand_path(outputfile, virtualbox.system_properties.default_hard_disk_folder)
- outputfile = File.expand_path(outputfile, virtualbox.system_properties.default_machine_folder)
-
- # If the outputfile path is in use by another Hard Drive, lets fail
- # now with a meaningful exception rather than simply return a nil
- raise Exceptions::MediumLocationInUseException.new(outputfile) if File.exist?(outputfile)
-
- # Create the new {COM::Interface::Medium} instance.
- new_medium = virtualbox.create_hard_disk(format, outputfile)
-
- # Raise an error if the creation of the {COM::Interface::Medium}
- # instance failed
- raise Exceptions::MediumCreationFailedException.new unless new_medium
-
- # Return the new {COM::Interface::Medium} instance.
- new_medium
- end
-
- end
-end
-
-def createvbox(os=:ubuntu,x64=false)
- boxnum = rand.to_s[2..4+1].to_i
- if os == :ubuntu
- if x64
- boxname="ubuntu64_#{boxnum}"
- else
- boxname="ubuntu__#{boxnum}"
- end
- end
-
- vbox = VirtualBox::VM.create boxname
- #vbox.description="A Box to Remember"
-
- vbox.memory_size = 2048 #I want to run a few of these
- vbox.os_type_id = "Ubuntu"
- vbox.vram_size = 12 #just enough for fullscreen + 2d accel
- vbox.accelerate_2d_video_enabled=false #needed?
- vbox.audio_adapter.enabled=false # not needed
- vbox.usb_controller.enabled=false # not needed... yet
-
- newhd=VirtualBox::HardDrive.new
- newhd.location=File.join(File.dirname(vbox.settings_file_path),vbox.name+'.vdi') #within the VM dir
- gigabyte=1000*1000*1024
- newhd.logical_size=40*gigabyte
- newhd.save
-
- newhd1=VirtualBox::HardDrive.new
- newhd1.location=File.join(File.dirname(vbox.settings_file_path),vbox.name+'1.vdi') #within the VM dir
- newhd1.logical_size=40*gigabyte
- newhd1.save
-
- controller_name='Sata Controller'
- vbox.with_open_session do |session|
- machine = session.machine
- machine.bios_settings.pxe_debug_enabled=true
- machine.add_storage_controller controller_name, :sata
- machine.attach_device(controller_name, 0, 0, :hard_disk, newhd.interface)
- machine.attach_device(controller_name, 1, 0, :hard_disk, newhd1.interface)
- end
-
- # this will boot from nerk only if we can't boot from disk
- vbox.boot_order=[:hard_disk ,:network,:null,:null]
-
-
- #vbox.extra_data['VBoxInternal/Devices/VMMDev/0/Config/KeepCredentials']='1'
-
- # This works when wanting to test all virtually
- # nic = vbox.network_adapters[0]
- # nic.attachment_type = :nat
- # requires a real tftp server
- ##`VBoxManage modifyvm "#{vbox.name}" --nattftpserver1 192.168.2.7`
- # vbox.extra_data['VBoxInternal/Devices/pcnet/0/LUN#0/Config/TFTPPrefix']='/var/www/'
- # vbox.extra_data['VBoxInternal/Devices/pcnet/0/LUN#0/Config/BootFile']='pxelinux.0' ##`VBoxManage modifyvm "#{vbox.name}" --nattftpfile1 pxelinux.0`
- # nic.enabled = true
- # nic.save
-
- # This is what we do when we want to test a real pxe implementation
- nic = vbox.network_adapters[0]
- nic.attachment_type = :host_only
- nic.host_only_interface = 'vboxnet0'
- nic.enabled = true
- nic.save
-
- nic = vbox.network_adapters[1]
- nic.attachment_type = :host_only
- nic.host_only_interface = 'vboxnet1'
- nic.enabled = true
- nic.save
-
- vbox.save
- # --ioapic on for the centos pxe boot
- `VBoxManage modifyvm #{boxname} --vrdeport 5010-5020 --ioapic on`
-
-
- vbox
-end
-
-box = createvbox
-
-puts "created new box #{box.name}"
-puts "start it with VBoxHeadless -s #{box.name}"
-
-# add the iso:
-
-
-
-
View
190 create_crowbar.rb
@@ -1,190 +0,0 @@
-require 'rubygems'
-require 'virtualbox'
-require 'fileutils'
-
-# monkey patch from https://github.com/hh/virtualbox/blob/da76afa639e11fcd9f0ab4a816876fb5bd30d579/lib/virtualbox/hard_drive.rb
-
-# needs some serious cleanup
-
-module VirtualBox
- class VM
-
- class << self
-
- # Creates and registers a new VM, and returns a
- # new VM object.
- #
- # @return [VM]
- def create(name)
- settings = VirtualBox::Lib.lib.virtualbox.compose_machine_filename(name)
- imachine = VirtualBox::Lib.lib.virtualbox.create_machine(settings, name)
- VirtualBox::Lib.lib.virtualbox.register_machine(imachine)
- return VirtualBox::VM.new(imachine)
- end
- end
- end
-
- class HardDrive
- def validate
- super
-
- medium_formats = Global.global.system_properties.medium_formats.collect { |mf| mf.id }
- validates_inclusion_of :format, :in => medium_formats, :message => "must be one of the following: #{medium_formats.join(', ')}."
-
- validates_presence_of :location
-
- max_vdi_size = Global.global.system_properties.info_vd_size
- validates_inclusion_of :logical_size, :in => (0..max_vdi_size), :message => "must be between 0 and #{max_vdi_size}."
- end
-
- def create_hard_disk_medium(outputfile, format = nil)
- # Get main VirtualBox object
- virtualbox = Lib.lib.virtualbox
-
- # Assign the default format if it isn't set yet
- format ||= virtualbox.system_properties.default_hard_disk_format
-
- # Expand path relative to the default hard disk folder. This allows
- # filenames to exist in the default folder while full paths will use
- # the paths specified.
- # outputfile = File.expand_path(outputfile, virtualbox.system_properties.default_hard_disk_folder)
- outputfile = File.expand_path(outputfile, virtualbox.system_properties.default_machine_folder)
-
- # If the outputfile path is in use by another Hard Drive, lets fail
- # now with a meaningful exception rather than simply return a nil
- raise Exceptions::MediumLocationInUseException.new(outputfile) if File.exist?(outputfile)
-
- # Create the new {COM::Interface::Medium} instance.
- new_medium = virtualbox.create_hard_disk(format, outputfile)
-
- # Raise an error if the creation of the {COM::Interface::Medium}
- # instance failed
- raise Exceptions::MediumCreationFailedException.new unless new_medium
-
- # Return the new {COM::Interface::Medium} instance.
- new_medium
- end
-
- end
-end
-
-def createvbox(os=:ubuntu,x64=false)
- #boxnum = rand.to_s[2..4+1].to_i
- if os == :ubuntu
- if x64
- boxname="crowbar_admin_64"
- else
- boxname="crowbar_admin"
- end
- end
-
- vbox = VirtualBox::VM.create boxname
- #vbox.description="A Box to Remember"
-
- vbox.memory_size = 4096 #I want to run a few of these
- vbox.os_type_id = "Ubuntu"
- vbox.vram_size = 12 #just enough for fullscreen + 2d accel
- vbox.accelerate_2d_video_enabled=false #needed?
- vbox.audio_adapter.enabled=false # not needed
- vbox.usb_controller.enabled=false # not needed... yet
-
- newhd=VirtualBox::HardDrive.new
- newhd.location=File.join(File.dirname(vbox.settings_file_path),vbox.name+'.vdi') #within the VM dir
- gigabyte=1000*1000*1024
- newhd.logical_size=40*gigabyte
- newhd.save
-
- #ok, we have to have the iso registered (skip this we use the last line to shell out and add it)
- #crowbar_iso = VirtualBox::DVD.all.select { |dvd| dvd.location =~ /openstack111014/ }.first
-
- controller_name='Sata Controller'
- vbox.with_open_session do |session|
- machine = session.machine
- #possibly change the screen on each boot... for demo?
- #machine.bios_settings.logo_image_path='/var/www/ii.bmp' #256/8bit BMP
- machine.bios_settings.pxe_debug_enabled=true
- #machine.create_shared_folder 'Sharename', '/path', RW?, Automount?
- #machine.create_shared_folder 'HostRoot', '/', false, true
- #machine.create_shared_folder 'Unattended', '/var/unattended/install', false, true
- #machine.create_shared_folder 'Tmp', '/tmp', true, true
- machine.add_storage_controller "IDE Controller", :ide # for the iso boot
- machine.add_storage_controller controller_name, :sata
- machine.attach_device(controller_name, 0, 0, :hard_disk, newhd.interface)
- #ok, we have to have the iso registered (skip this we use the last line to shell out and add it)
- #machine.attach_device(controller_name, 0, 1, :dvd, crowbar_iso.interface)
- end
-
- vbox.storage_controllers[0].controller_type = :piix3 #or :piix4, :ich6
-
- # this will boot from nerk only if we can't boot from disk
- vbox.boot_order=[:hard_disk ,:dvd,:null,:null]
-
-
- #vbox.extra_data['VBoxInternal/Devices/VMMDev/0/Config/KeepCredentials']='1'
-
- # This works when wanting to test all virtually
- # nic = vbox.network_adapters[0]
- # nic.attachment_type = :nat
- # requires a real tftp server
- ##`VBoxManage modifyvm "#{vbox.name}" --nattftpserver1 192.168.2.7`
- # vbox.extra_data['VBoxInternal/Devices/pcnet/0/LUN#0/Config/TFTPPrefix']='/var/www/'
- # vbox.extra_data['VBoxInternal/Devices/pcnet/0/LUN#0/Config/BootFile']='pxelinux.0' ##`VBoxManage modifyvm "#{vbox.name}" --nattftpfile1 pxelinux.0`
- # nic.enabled = true
- # nic.save
-
- # This is what we do when we want to test a real pxe implementation
- nic = vbox.network_adapters[0]
- nic.attachment_type = :host_only
- nic.host_only_interface = 'vboxnet0'
- nic.enabled = true
- nic.save
-
- nic = vbox.network_adapters[1]
- nic.attachment_type = :host_only
- nic.host_only_interface = 'vboxnet1'
- nic.enabled = true
- nic.save
-
-
- # we should be able to ssh localhost -P <the 5 digits of after randomname>
-
- # port = VirtualBox::NATForwardedPort.new
- # port.name = 'ssh'
- # port.guestport = 22
- # port.hostport = boxnum
- # port.protocol = :tcp
- # vbox.network_adapters[0].nat_driver.forwarded_ports << port
- # # Thank you Taylor for this:
- # # "0800273B51A9".taylor_ruby_foo() # => "08-00-27-3B-51-A9"
- # tftp_conffile = "01-#{nic.mac_address.split(/(..)/).reject do|c| c.empty? end.join('-').downcase}"
- # if os == :ubuntu and x64
- # vbox.os_type_id="Ubuntu_64"
- # File.symlink '/var/www/pxelinux.cfg/default-ubuntu64', "/var/www/pxelinux.cfg/#{tftp_conffile}"
- # # not needed anymore, as we just boot pxelinux.0 and use the same tftpprefix everytime now!!
- # #vbox.extra_data['VBoxInternal/Devices/pcnet/0/LUN#0/Config/TFTPPrefix']='/var/www/ubuntu-installer/amd64'
- # else # default os == :ubuntu i632
- # vbox.os_type_id="Ubuntu"
- # File.symlink '/var/www/pxelinux.cfg/default-ubuntu', "/var/www/pxelinux.cfg/#{tftp_conffile}"
- # #vbox.extra_data['VBoxInternal/Devices/pcnet/0/LUN#0/Config/TFTPPrefix']='/var/www/ubuntu-installer/i386'
- # #vbox.extra_data['VBoxInternal/Devices/pcnet/0/LUN#0/Config/TFTPPrefix']='/var/www/pxe_dust'
- # end
-
- vbox.save
-
-
-# `VBoxManage storageattach #{boxname} --storagectl "IDE Controller" --device 0 --port 0 --type dvddrive --medium /root/iso-images/openstack111014.iso`
- `VBoxManage storageattach #{boxname} --storagectl "IDE Controller" --device 0 --port 0 --type dvddrive --medium /root/crowbar/crowbar-cactus-1534-g4468ce1-dev.iso`
-
- vbox
-end
-
-box = createvbox
-
-puts "created new box #{box.name}"
-puts "start it with VBoxHeadless -s #{box.name}"
-
-# add the iso:
-
-
-
-
View
51 create_crowbar.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+#
+# Copyright 2012, Deutsche Telekom Laboratories
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+
+# needs some serious cleanup
+ISO="/home/crowbardev/crowbar-iso/share/iso/crowbar-v1.2-openstack-1632-g064b54d-dev.iso"
+
+IF_TYPE=82540EM
+
+VBoxManage unregistervm crowbar_admin --delete
+VBoxManage clonevm pxe --name crowbar_admin --register
+
+VBoxManage modifyvm crowbar_admin --memory 4096 --ostype Ubuntu_64
+
+VBoxManage modifyvm crowbar_admin --nic1 hostonly
+VBoxManage modifyvm crowbar_admin --nic2 hostonly
+VBoxManage modifyvm crowbar_admin --nic3 nat
+VBoxManage modifyvm crowbar_admin --nic4 none
+VBoxManage modifyvm crowbar_admin --macaddress1 080027BA2DAE
+VBoxManage modifyvm crowbar_admin --macaddress2 080027BE8E74
+VBoxManage modifyvm crowbar_admin --macaddress3 auto
+VBoxManage modifyvm crowbar_admin --macaddress4 auto
+VBoxManage modifyvm crowbar_admin --nictype1 $IF_TYPE
+VBoxManage modifyvm crowbar_admin --nictype2 $IF_TYPE
+VBoxManage modifyvm crowbar_admin --nictype3 $IF_TYPE
+VBoxManage modifyvm crowbar_admin --nictype4 $IF_TYPE
+VBoxManage modifyvm crowbar_admin --cableconnected2 off
+VBoxManage controlvm crowbar_admin setlinkstate2 off
+VBoxManage modifyvm crowbar_admin --cableconnected3 off
+VBoxManage controlvm crowbar_admin setlinkstate3 off
+VBoxManage modifyvm crowbar_admin --hostonlyadapter1 vboxnet0
+VBoxManage modifyvm crowbar_admin --hostonlyadapter2 vboxnet1
+VBoxManage storageattach crowbar_admin --storagectl "IDE Controller" --device 0 --port 1 --type dvddrive --medium "$ISO"
+VBoxManage modifyvm crowbar_admin --boot1 disk
+
+echo "start it with VBoxHeadless -s crowbar_admin"
View
62 create_nova_booting_base_box.sh
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+#
+# Copyright 2012, Deutsche Telekom Laboratories
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+
+MASCHINE_NAME="crowbar-base-box"
+IF_TYPE=82540EM #virtio causes problems (enumartion of device in ubunut 12.04
+
+VMPATH="/"$(VBoxManage list systemproperties|grep "^Default"| cut -d '/' -f 2-)"/"$MASCHINE_NAME"/"
+DISKPATH="/"$VMPATH/""$MASCHINE_NAME".vdi"
+
+#[ -f "$DISKPATH" ] && echo "we already have a "$MASCHINE_NAME" instance" && exit
+
+VBoxManage unregistervm "$MASCHINE_NAME" --delete
+rm -rf "$VMPATH"
+VBoxManage createvm --name "$MASCHINE_NAME" --ostype Ubuntu_64 --register
+VBoxManage storagectl "$MASCHINE_NAME" --name 'IDE Controller' --add ide
+VBoxManage storagectl "$MASCHINE_NAME" --name 'SATA Controller' --add sata --hostiocache off --sataportcount 1
+
+VBoxManage createhd --filename "$DISKPATH" --size 20000 --format VDI
+VBoxManage storageattach "$MASCHINE_NAME" --storagectl 'SATA Controller' --port 0 --device 0 --type hdd --medium "$DISKPATH"
+
+VBoxManage modifyvm "$MASCHINE_NAME" --nic1 hostonly
+VBoxManage modifyvm "$MASCHINE_NAME" --nic2 hostonly
+VBoxManage modifyvm "$MASCHINE_NAME" --nic3 hostonly
+VBoxManage modifyvm "$MASCHINE_NAME" --nic4 none
+VBoxManage modifyvm "$MASCHINE_NAME" --macaddress1 auto
+VBoxManage modifyvm "$MASCHINE_NAME" --macaddress2 auto
+VBoxManage modifyvm "$MASCHINE_NAME" --macaddress3 auto
+VBoxManage modifyvm "$MASCHINE_NAME" --macaddress4 auto
+VBoxManage modifyvm "$MASCHINE_NAME" --nictype1 $IF_TYPE # virtio failed pxe boot using the intel card
+VBoxManage modifyvm "$MASCHINE_NAME" --nictype2 $IF_TYPE
+VBoxManage modifyvm "$MASCHINE_NAME" --nictype3 $IF_TYPE
+VBoxManage modifyvm "$MASCHINE_NAME" --nictype4 $IF_TYPE
+VBoxManage modifyvm "$MASCHINE_NAME" --cableconnected1 on
+VBoxManage controlvm "$MASCHINE_NAME" setlinkstate1 on
+VBoxManage modifyvm "$MASCHINE_NAME" --cableconnected2 on
+VBoxManage controlvm "$MASCHINE_NAME" setlinkstate2 on
+VBoxManage modifyvm "$MASCHINE_NAME" --cableconnected3 on
+VBoxManage controlvm "$MASCHINE_NAME" setlinkstate3 on
+VBoxManage modifyvm "$MASCHINE_NAME" --cableconnected4 on
+VBoxManage controlvm "$MASCHINE_NAME" setlinkstate4 on
+
+VBoxManage modifyvm "$MASCHINE_NAME" --hostonlyadapter1 vboxnet4
+VBoxManage modifyvm "$MASCHINE_NAME" --hostonlyadapter2 vboxnet5
+VBoxManage modifyvm "$MASCHINE_NAME" --hostonlyadapter3 vboxnet6
+VBoxManage modifyvm "$MASCHINE_NAME" --hostonlyadapter4 vboxnet7
+
View
35 create_nova_node.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+#
+# Copyright 2012, Deutsche Telekom Laboratories
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+
+[ -z $1 ] && echo "you must provide a maschine name" && exit
+
+MASCHINE_NAME=$1
+
+echo "creating $MASCHINE_NAME"
+
+
+VBoxManage unregistervm "$MASCHINE_NAME" --delete
+VBoxManage clonevm crowbar-base-box --name "$MASCHINE_NAME" --register
+
+VBoxManage modifyvm "$MASCHINE_NAME" --memory 2048 --ostype Debian_64
+VBoxManage modifyvm "$MASCHINE_NAME" --vrdeport 5010-5030 --ioapic on #ioapic for centos pxe boot (verify it again)
+
+VBoxManage modifyvm "$MASCHINE_NAME" --boot1 net
+
+echo "start it with VBoxHeadless -s $MASCHINE_NAME"
View
35 create_swift_booting_base_box.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+#
+# Copyright 2012, Deutsche Telekom Laboratories
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+
+VMPATH="/"$(VBoxManage list systemproperties|grep "^Default"| cut -d '/' -f 2-)"/swift/"
+DISKPATH_1="/"$VMPATH/"/swift-root.vdi"
+DISKPATH_2="/"$VMPATH/"/swift-store.vdi"
+
+[ -f "$DISKPATH" ] && echo "we already have a swift instance" && exit
+
+VBoxManage unregistervm swift --delete
+rm -rf "$VMPATH"
+VBoxManage createvm --name swift --ostype Ubuntu_64 --register
+VBoxManage storagectl 'swift' --name 'IDE Controller' --add ide
+VBoxManage storagectl 'swift' --name 'SATA Controller' --add sata --hostiocache off --sataportcount 2
+
+VBoxManage createhd --filename "$DISKPATH_1" --size 5000 --format VDI
+VBoxManage createhd --filename "$DISKPATH_2" --size 10000 --format VDI
+VBoxManage storageattach 'swift' --storagectl 'SATA Controller' --port 0 --device 0 --type hdd --medium "$DISKPATH_1"
+VBoxManage storageattach 'swift' --storagectl 'SATA Controller' --port 1 --device 0 --type hdd --medium "$DISKPATH_2"
View
55 create_swift_node.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+#
+# Copyright 2012, Deutsche Telekom Laboratories
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+[ -z $1 ] && echo "you must provide a swift maschine name" && exit
+
+MASCHINE_NAME=$1
+
+echo "creating $MASCHINE_NAME"
+
+IF_TYPE=82540EM #virtio causes problems (enumartion of device in ubunut 12.04
+
+VBoxManage unregistervm "$MASCHINE_NAME" --delete
+VBoxManage clonevm swift --name "$MASCHINE_NAME" --register
+
+VBoxManage modifyvm "$MASCHINE_NAME" --memory 512 --ostype Debian_64
+
+VBoxManage modifyvm "$MASCHINE_NAME" --nic1 hostonly
+VBoxManage modifyvm "$MASCHINE_NAME" --nic2 hostonly
+VBoxManage modifyvm "$MASCHINE_NAME" --nic3 nat
+VBoxManage modifyvm "$MASCHINE_NAME" --nic4 none
+VBoxManage modifyvm "$MASCHINE_NAME" --macaddress1 auto
+VBoxManage modifyvm "$MASCHINE_NAME" --macaddress2 auto
+VBoxManage modifyvm "$MASCHINE_NAME" --macaddress3 auto
+VBoxManage modifyvm "$MASCHINE_NAME" --macaddress4 auto
+VBoxManage modifyvm "$MASCHINE_NAME" --nictype1 $IF_TYPE # virtio failed pxe boot using the intel card
+VBoxManage modifyvm "$MASCHINE_NAME" --nictype2 $IF_TYPE
+VBoxManage modifyvm "$MASCHINE_NAME" --nictype3 $IF_TYPE
+VBoxManage modifyvm "$MASCHINE_NAME" --nictype4 $IF_TYPE
+VBoxManage modifyvm "$MASCHINE_NAME" --cableconnected2 off
+VBoxManage controlvm "$MASCHINE_NAME" setlinkstate2 off
+VBoxManage modifyvm "$MASCHINE_NAME" --cableconnected3 off
+VBoxManage controlvm "$MASCHINE_NAME" setlinkstate3 off
+VBoxManage modifyvm "$MASCHINE_NAME" --hostonlyadapter1 vboxnet0
+VBoxManage modifyvm "$MASCHINE_NAME" --hostonlyadapter2 vboxnet1
+VBoxManage modifyvm "$MASCHINE_NAME" --hostonlyadapter3 vboxnet3
+VBoxManage modifyvm "$MASCHINE_NAME" --hostonlyadapter4 vboxnet4
+VBoxManage modifyvm "$MASCHINE_NAME" --vrdeport 5010-5030 --ioapic on #ioapic for centos pxe boot (verify it again)
+VBoxManage modifyvm "$MASCHINE_NAME" --boot1 net
+
+echo "start it with VBoxHeadless -s $MASCHINE_NAME"
View
16 delete_all.rb
@@ -1,3 +1,19 @@
+#
+# Copyright 2012, Deutsche Telekom Laboratories
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
#VBoxManage list vms
#"ubuntu__8063" {2bbef874-c459-4ece-afcb-a85ac6d674a4}
#"ubuntu__4475" {84a1d4b5-9848-4c28-8cf2-99110315ce99}
View
21 reset-network.sh
@@ -0,0 +1,21 @@
+#
+# Copyright 2012, Deutsche Telekom Laboratories
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+/usr/lib/virtualbox/VBoxNetAdpCtl vboxnet4 192.168.124.1 netmask 255.255.255.0
+/usr/lib/virtualbox/VBoxNetAdpCtl vboxnet5 192.168.122.1 netmask 255.255.255.0
+/usr/lib/virtualbox/VBoxNetAdpCtl vboxnet6 192.168.126.1 netmask 255.255.255.0
+/usr/lib/virtualbox/VBoxNetAdpCtl vboxnet7 192.168.123.1 netmask 255.255.255.0
+
View
22 stop_cluster.sh
@@ -0,0 +1,22 @@
+#
+# Copyright 2012, Deutsche Telekom Laboratories
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+VBoxManage controlvm crowbar-essex-1 poweroff
+VBoxManage controlvm crowbar-essex-2 poweroff
+VBoxManage controlvm crowbar-essex-3 poweroff
+VBoxManage controlvm crowbar-essex-4 poweroff
+VBoxManage controlvm crowbar-essex-5 poweroff
+VBoxManage controlvm crowbar_admin poweroff
Please sign in to comment.
Something went wrong with that request. Please try again.