Changes between Version 2 and Version 3 of OpenStack-Install

Show
Ignore:
Timestamp:
12/15/11 12:16:15 (8 years ago)
Author:
pruth (IP: 152.54.9.28)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OpenStack-Install

    v2 v3  
    3737}}} 
    3838 
     395. Install OpenStack rpm 
     40 
     41Cloud Controller: 
     42{{{ 
     43sudo yum install euca2ools openstack-nova-node-full 
     44}}} 
     45 
     46Compute Nodes: 
     47{{{ 
     48sudo yum install openstack-nova-node-compute 
     49}}} 
     50 
     51 
     526. Setup suport services: 
     53 
     54{{{ 
     55sudo chkconfig libvirtd on 
     56sudo service libvirtd start 
     57sudo service mysqld start 
     58sudo chkconfig mysqld on 
     59sudo service rabbitmq-server start 
     60sudo chkconfig rabbitmq-server on 
     61}}} 
     62 
     636. Create MySQL database on Cloud Controller 
     64 
     65Set password for mysql 
     66 
     67{{{ 
     68mysqladmin -uroot password nova 
     69}}} 
     70 
     71Script to setup database for OpenStack 
     72 
     73{{{ 
     74#!/bin/bash 
     75 
     76DB_NAME=nova 
     77DB_USER=nova 
     78DB_PASS=nova 
     79PWD=nova 
     80 
     81CC_HOST="A.B.C.D" # IPv4 address 
     82HOSTS='node1 node2 node3' # compute nodes list 
     83 
     84mysqladmin -uroot -p$PWD -f drop nova 
     85mysqladmin -uroot -p$PWD create nova 
     86 
     87for h in $HOSTS localhost; do 
     88        echo "GRANT ALL PRIVILEGES ON $DB_NAME.* TO '$DB_USER'@'$h' IDENTIFIED BY '$DB_PASS';" | mysql -uroot -p$DB_PASS mysql 
     89done 
     90echo "GRANT ALL PRIVILEGES ON $DB_NAME.* TO $DB_USER IDENTIFIED BY '$DB_PASS';" | mysql -uroot -p$DB_PASS mysql 
     91echo "GRANT ALL PRIVILEGES ON $DB_NAME.* TO root IDENTIFIED BY '$DB_PASS';" | mysql -uroot -p$DB_PASS mysql 
     92 
     93nova-manage db sync 
     94}}} 
     95 
     967.  Configure firewall 
     97 
     98Cloud Controller 
     99{{{ 
     100sudo iptables -I INPUT 1 -p tcp --dport 5672 -j ACCEPT 
     101sudo iptables -I INPUT 1 -p tcp --dport 3306 -j ACCEPT 
     102sudo iptables -I INPUT 1 -p tcp --dport 9292 -j ACCEPT 
     103sudo iptables -I INPUT 1 -p tcp --dport 6080 -j ACCEPT 
     104sudo iptables -I INPUT 1 -p tcp --dport 8773 -j ACCEPT 
     105sudo iptables -I INPUT 1 -p tcp --dport 8774 -j ACCEPT 
     106sudo iptables -I INPUT 1 -p udp --dport 67 -j ACCEPT 
     107}}} 
     108 
     109All Compute Nodes 
     110 
     111{{{ 
     112sudo iptables -I INPUT 1 -p tcp -s <CLOUD_CONTROLLER_IP_ADDRESS> --dport 5900:6400 -j ACCEPT 
     113}}} 
     114 
     1158. Configure /etc/nova/nova.conf.  One example using a single NIC.  Requires a vlan (by default vlan tag 100).  Replace CLOUD_CONTROLLER_IP with your cloud contorller's IP. 
     116 
     117 
     118{{{ 
     119--verbose=true 
     120--ec2_url=http://CLOUD_CONTROLLER_IP:8773/services/Cloud 
     121--s3_host=CLOUD_CONTROLLER_IP 
     122--cc_host=CLOUD_CONTROLLER_IP 
     123--rabbit_host=CLOUD_CONTROLLER_IP 
     124--sql_connection=mysql://nova:nova@CLOUD_CONTROLLER_IP/nova 
     125--glance_api_servers=CLOUD_CONTROLLER_IP:9292 
     126--use_s3=true 
     127--libvirt_type=kvm 
     128--use_syslog=false 
     129--node_availability_zone=nova 
     130--logdir=/var/log/nova 
     131--logging_context_format_string=%(asctime)s %(name)s: %(levelname)s [%(request_id)s %(user)s %(project)s] %(message)s 
     132--logging_default_format_string=%(asctime)s %(name)s: %(message)s 
     133--logging_debug_format_suffix= 
     134--use_cow_images=true 
     135--auth_driver=nova.auth.dbdriver.DbDriver 
     136--scheduler_driver=nova.scheduler.zone.ZoneScheduler 
     137--image_service=nova.image.glance.GlanceImageService 
     138--use_ipv6=false 
     139--ca_path=/var/lib/nova/CA 
     140--keys_path=/var/lib/nova/keys 
     141--images_path=/var/lib/nova/images 
     142--buckets_path=/var/lib/nova/buckets 
     143--instances_path=/var/lib/nova/instances 
     144--networks_path=/var/lib/nova/networks 
     145--injected_network_template=/usr/share/nova/interfaces/ 
     146--libvirt_xml_template=/usr/share/nova/libvirt.xml.template 
     147--vpn_client_template=/usr/share/nova/client.ovpn.template 
     148--credentials_template=/usr/share/nova/novarc.template 
     149--state_path=/var/lib/nova 
     150--lock_path=/var/lib/nova/tmp 
     151--vnc_enabled=true 
     152--vncproxy_url=http://CLOUD_CONTROLLER_IP:6080 
     153--vncserver_host=0.0.0.0 
     154--vnc_token_ttl=300 
     155# 
     156## Networking 
     157--network_manager=nova.network.manager.VlanManager 
     158--dhcpbridge_flagfile=/etc/nova/nova.conf 
     159--dhcpbridge=/usr/bin/nova-dhcpbridge 
     160--flat_network_bridge=br100 
     161--flat_interface=eth0 
     162--public_interface=eth0 
     163--vlan_interface=eth0 
     164--my_ip=CLOUD_CONTROLLER_IP 
     165--lock_path=/tmp 
     166--bridge_interface=eth0 
     167}}} 
     168 
     1699.  Start your OpenStack services 
     170 
     171{{{ 
     172for n in api compute network objectstore scheduler vncproxy; do sudo service openstack-nova-$n start; done 
     173sudo service openstack-glance-api start 
     174sudo service openstack-glance-registry start 
     175for n in node1 node2 node3; do ssh $n sudo service openstack-nova-compute start; done 
     176}}} 
     177 
     17810. Create public/private networks for vms 
     179 
     180{{{ 
     181nova-manage --flagfile=/etc/nova/nova.conf network create private 10.0.1.0/24 1 256 
     182nova-manage --flagfile=/etc/nova/nova.conf floating create 10.0.1.0/24  
     183}}} 
     184 
     18511. Create user and project (both user and project called "admin") 
     186 
     187{{{ 
     188nova-manage --flagfile=/etc/nova/nova.conf user admin admin 
     189nova-manage --flagfile=/etc/nova/nova.conf project create admin admin 
     190}}} 
     191 
     192 
     19312. Get the credential files and source the novarc file 
     194 
     195{{{ 
     196nova-manage --flagfile=/etc/nova/nova.conf project zipfile admin admin 
     197unzip nova.zip 
     198source novarc 
     199}}} 
     200 
     201You should now be able to use the ec2 commands.  Try: 
     202{{{ 
     203euca-describe-instances 
     204}}} 
     205 
     206 
     20713.  Allow ping/ssh access 
     208 
     209{{{ 
     210euca-authorize -P icmp -t -1:-1 default 
     211euca-authorize -P tcp -p 22 default 
     212}}} 
     213 
     21414. Something is broken about the dhcp server that OpenStack deploys.  Kill all dnsmasq servers and restart the nova-network service.  If you don't do this you will not be able to access your vms. 
     215 
     216{{{ 
     217sudo killall dnsmasq 
     218sudo service openstack-nova-network restart 
     219}}} 
     220 
     221=== Starting a VM ===  
     222 
     2231.  Get a working image with kernal and initrd.   
     224 
     225Simple example image: 
     226 
     227{{{ 
     228wget http://smoser.brickies.net/ubuntu/ttylinux-uec/ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz 
     229tar -xvf ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz 
     230}}} 
     231 
     2322.  Bundle, upload, and register the kernel, initrd, and image 
     233 
     234{{{ 
     235euca-bundle-image -i <kernel file name> --kernel true 
     236euca-upload-bundle -b kernel-bucket -m /tmp/<kernel file name>.manifest.xml 
     237euca-register kernel-bucket/<kernel file name>.manifest.xml 
     238 
     239euca-bundle-image -i <ramdisk file name> --ramdisk true 
     240euca-upload-bundle -b ramdisk-bucket -m /tmp/<ramdisk file name>.manifest.xml 
     241euca-register ramdisk-bucket/<ramdisk file name>.manifest.xml 
     242 
     243euca-bundle-image -i <image file name> --kernel <aki name> --ramdisk <ari name> 
     244euca-upload-bundle -b image-bucket -m /tmp/<image file name>.manifest.xml 
     245euca-register image-bucket/<image file name>.manifest.xml 
     246}}} 
     247 
     248Try: 
     249 
     250{{{ 
     251euca-describe-images 
     252}}} 
     253 
     254 
     2553.  Add a key 
     256 
     257{{{ 
     258euca-add-keypair mykey > mykey.pem 
     259}}} 
     260 
     2614.  Run the vm 
     262 
     263Replace IMAGE_ID with your image id (probably i-00000003) 
     264{{{ 
     265euca-run-instances -k mykey IMAGE_ID 
     266}}} 
     267 
     2685. You should have a running instance 
     269 
     270Try (replace VMs_IP with your vm's IP) 
     271 
     272{{{ 
     273euca-describe-instances 
     274ping VMs_IP 
     275ssh -i mykey.pem root@VMs_IP 
     276}}} 
     277 
    39278 
    40279 
     
    44283http://yum.griddynamics.net/yum 
    45284 
    46 http://wiki.openstack.org/NovaInstall/RHEL6Notes-Diablo-3 
     285http://wiki.openstack.org/NovaInstall/RHEL6Notes-Diablo-3 (a lot of instructions borrowed from here)