Crowbar Development Based Upon SUSE¶
virtual | machine (VM) that is based on openSUSE or SUSE Linux Enterprise Server (SLES). | It is currently focused on the core Rails application and required barclamps.
Setting up the VM¶
instructions <dev-vm.md>`__. If not, setup the VM accordingly and | continue on to the next section.
them if | necessary.
Download the VM¶
following
| locations (KVM image in qcow2 format recommended):
Boot the VM¶
This can be done either via libvirt, or directly via
qemu-kvm:
Booting via libvirt¶
Give the VM a name; this can be whatever you want.
kvm-host# vm_name=crowbar-admin-sles
kvm-host# bridge=virbr0
Register and boot the VM:
kvm-host# vm-install \
-n $vm_name -o sles11 -c4 -m2048 -M2048 \
-d qcow2:$vm_disk,xvda,disk,w,0,cachemode=none \
-e \
--nic bridge=$bridge,model=virtio \
--keymap en-gb
cache=none instead of cachemode=none.)libvirt, you can later control itvirt-manager in the normal way.Booting via qemu-kvm¶
Place the image in the
dev-setup/qemu-kvmdirectory of the `Crowbargit <https://github.com/crowbar/crowbar/>`__ checkout on your KVM
host.
- [Optional] Set which bridge device you want to route the VM’s NATtraffic through:
kvm-host# export BRIDGE=virbr0
Start the VM by running the following as root:
kvm-host# ./start-vm
Use the
--preallocateoption if you need to improve disk performance.
Post-boot¶
- [SLES VM only] Connect to the VM’s graphical console to accept theend user license agreement (EULA). If you used
qemu-kvm,connect via VNC, e.g.:kvm-host> vncviewer :10
Otherwise you will already see the console, but you can alsoconnect | via
virt-managerorvncviewer.Once connected, type
q,y, and hit enter. - After the VM boots up (takes a bit longer for first boot), youshould be able to connect to the VM via SSH:
kvm-host> ssh root@192.168.124.10 # Password is 'linux'
- [SLES only] If you’re running the VM within the SUSE network, run
add-suse-internal-reposto add the internal SUSErepositories. Otherwise, if you have a SLES subscription, registerwith NCC to get updates. - Create a non-root user account and set the password. Use the sameusername as you do on your regular workstation forconvenience. Then re-login to the dev VM as the newly createduser, e.g.:
root@crowbar-dev> useradd -m jamestyj root@crowbar-dev> passwd jamestyj root@crowbar-dev> logout jamestyj@kvm-host> ssh 192.168.124.10 jamestyj@crowbar-dev>
Setting Up the Development Environment¶
You should now have a working VM that you can SSH into from the qemu-kvm host.
Copy your
.gitconfigand other configuration files to the VM. For example:crowbar-dev> scp -r <your-usual-dev-host>:.{gitconfig,vimrc,vim,profile,ssh} .Check out the Crowbar git repo and run the dev tool:
crowbar-dev> git clone git://github.com/crowbar/crowbar.git crowbar-dev> cd crowbar crowbar-dev> ./dev setup
The./dev setupscript will ask for your Github username andpassword. It will fork the Crowbar and corresponding barclamprepositories to your account and clone them intocrowbar/barclamps/. Seeanddev-and-code-review | for details.
Now assemble the Crowbar application:
crowbar-dev> ./dev tests setup --no-gem-cache
This assembles a working and testable Crowbar Rails application in/tmp/crowbar-dev-test/opt/dell/crowbar_framework.Now you can run an instance of the web UI:
crowbar-dev> cd /tmp/crowbar-dev-test/opt/dell/crowbar_framework crowbar-dev> bundle install crowbar-dev> bundle exec rake db:migrate crowbar-dev> bundle exec rails s puma
And also to run the (unit + RSpec) tests:
crowbar-dev> bundle exec rake db:drop railties:install:migrations db:migrate db:fixtures:dump test:units spec
See the testing page for details.
Troubleshooting Tips¶
Connect to the VM via VNC. This is useful for debugging the VM (e.g., networking issues).
kvm-host> vncviewer :10
The VM is configured with the following settings:
IP address: 192.168.124.10 Netmask: 255.255.255.0 Gateway: 192.168.124.1 DNS: 10.120.2.88, 8.8.8.8
You may need to update the DNS setting to match your environmentby modifying/etc/resolv.conf.