progetti:cloud-areapd:openstack_havana_installation
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| progetti:cloud-areapd:openstack_havana_installation [2014/01/09 16:18] – frizzier@infn.it | progetti:cloud-areapd:openstack_havana_installation [2014/01/17 10:10] (current) – frizzier@infn.it | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Openstack HAVANA Installation and Configuration ====== | ||
| + | |||
| + | Authors: Eric Frizziero (INFN Padova), Lisa Zangrando (INFN Padova) | ||
| + | |||
| + | ==== Description ==== | ||
| + | This guide provides the step-by-step installation and configuration procedure of Openstack HAVANA in // | ||
| + | In particular the setup requires just a physical host (i.e. gilda-11.pd.infn.it) having two physical network cards (eth0 and eth1). | ||
| + | The " | ||
| + | The Openstack framework is installed in a SL6 environment by using the packstack tool with the specific (i.e. local) network type to allocate tenant networks. | ||
| + | |||
| + | ==== Prerequisites ==== | ||
| + | * OS: SL6 | ||
| + | * EthernetCard: | ||
| + | |||
| + | ==== Installation of repositories ==== | ||
| + | <code bash> | ||
| + | rpm -Uvh http:// | ||
| + | yum install -y http:// | ||
| + | yum clean all; yum update | ||
| + | </ | ||
| + | |||
| + | ==== Disable the yum-autoupdate ==== | ||
| + | <code bash> | ||
| + | rpm -e --nodeps yum-autoupdate-2-5.2.noarch | ||
| + | </ | ||
| + | |||
| + | ==== RPMs installation ==== | ||
| + | <code bash> | ||
| + | yum install -y openvswitch.x86_64 | ||
| + | yum install -y openstack-neutron-openvswitch.noarch | ||
| + | yum install -y openstack-packstack | ||
| + | reboot | ||
| + | </ | ||
| + | |||
| + | ==== Host Network configuration ==== | ||
| + | |||
| + | === Configure the ethernet card " | ||
| + | <code bash> | ||
| + | cat / | ||
| + | DEVICE=" | ||
| + | TYPE=OVSPort | ||
| + | DEVICETYPE=ovs | ||
| + | OVS_BRIDGE=br-ex | ||
| + | ONBOOT=yes | ||
| + | # | ||
| + | </ | ||
| + | |||
| + | === Create the bridge " | ||
| + | <code bash> | ||
| + | cat / | ||
| + | DEVICE=" | ||
| + | DEVICETYPE=" | ||
| + | TYPE=" | ||
| + | BOOTPROTO=" | ||
| + | DNS1=" | ||
| + | GATEWAY=" | ||
| + | IPADDR=" | ||
| + | NETMASK=" | ||
| + | ONBOOT=" | ||
| + | </ | ||
| + | |||
| + | === Configure the ethernet card " | ||
| + | <code bash> | ||
| + | cat / | ||
| + | DEVICE=" | ||
| + | HWADDR=" | ||
| + | TYPE=OVSPort | ||
| + | DEVICETYPE=ovs | ||
| + | OVS_BRIDGE=br-int | ||
| + | ONBOOT=" | ||
| + | # | ||
| + | </ | ||
| + | |||
| + | === Create the bridge " | ||
| + | <code bash> | ||
| + | cat / | ||
| + | DEVICE=" | ||
| + | DEVICETYPE=" | ||
| + | TYPE=" | ||
| + | BOOTPROTO=" | ||
| + | IPADDR=" | ||
| + | NETMASK=" | ||
| + | ONBOOT=" | ||
| + | </ | ||
| + | |||
| + | === Network restart === | ||
| + | <code bash> | ||
| + | chkconfig network on | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | |||
| + | === Network configuration example === | ||
| + | After restarting the network the configuration should be as the following: | ||
| + | <code bash> | ||
| + | ifconfig | ||
| + | |||
| + | br-ex Link encap: | ||
| + | inet addr: | ||
| + | inet6 addr: fe80:: | ||
| + | UP BROADCAST RUNNING | ||
| + | RX packets: | ||
| + | TX packets:79 errors:0 dropped:0 overruns:0 carrier: | ||
| + | collisions: | ||
| + | RX bytes: | ||
| + | |||
| + | br-int | ||
| + | inet addr: | ||
| + | inet6 addr: fe80:: | ||
| + | UP BROADCAST RUNNING | ||
| + | RX packets:222 errors:0 dropped:0 overruns:0 frame: | ||
| + | TX packets:14 errors:0 dropped:0 overruns:0 carrier: | ||
| + | collisions: | ||
| + | RX bytes:29276 (28.5 KiB) TX bytes:804 (804.0 b) | ||
| + | |||
| + | eth0 Link encap: | ||
| + | inet6 addr: fe80:: | ||
| + | UP BROADCAST RUNNING MULTICAST | ||
| + | RX packets: | ||
| + | TX packets:68 errors:0 dropped:0 overruns:0 carrier: | ||
| + | collisions: | ||
| + | RX bytes: | ||
| + | Memory: | ||
| + | |||
| + | eth1 Link encap: | ||
| + | inet6 addr: fe80:: | ||
| + | UP BROADCAST RUNNING MULTICAST | ||
| + | RX packets:253 errors:0 dropped:0 overruns:0 frame: | ||
| + | TX packets:7 errors:0 dropped:0 overruns:0 carrier: | ||
| + | collisions: | ||
| + | RX bytes:31166 (30.4 KiB) TX bytes:538 (538.0 b) | ||
| + | Memory: | ||
| + | |||
| + | lo Link encap:Local Loopback | ||
| + | inet addr: | ||
| + | inet6 addr: ::1/128 Scope: | ||
| + | UP LOOPBACK RUNNING | ||
| + | RX packets:1 errors:0 dropped:0 overruns:0 frame: | ||
| + | TX packets:1 errors:0 dropped:0 overruns:0 carrier: | ||
| + | collisions: | ||
| + | RX bytes:93 (93.0 b) TX bytes:93 (93.0 b) | ||
| + | |||
| + | virbr0 | ||
| + | inet addr: | ||
| + | UP BROADCAST RUNNING MULTICAST | ||
| + | RX packets:0 errors:0 dropped:0 overruns:0 frame: | ||
| + | TX packets:0 errors:0 dropped:0 overruns:0 carrier: | ||
| + | collisions: | ||
| + | RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | ovs-vsctl show | ||
| + | f917351b-1027-4acf-b771-9ed93ee52f26 | ||
| + | Bridge br-int | ||
| + | Port br-int | ||
| + | Interface br-int | ||
| + | type: internal | ||
| + | Port " | ||
| + | Interface " | ||
| + | Bridge br-ex | ||
| + | Port br-ex | ||
| + | Interface br-ex | ||
| + | type: internal | ||
| + | Port " | ||
| + | Interface " | ||
| + | ovs_version: | ||
| + | </ | ||
| + | |||
| + | ==== Openstack installation ==== | ||
| + | This is the packstack-answers-file.txt used: {{: | ||
| + | <code bash> | ||
| + | packstack --answer-file=packstack-answers-file.txt | ||
| + | </ | ||
| + | Note: used the property // | ||
| + | |||
| + | ==== Openstack configuration ==== | ||
| + | The services nova-api and the nova-metadata-api are both using the same port, 8775. Thus, the services are ' | ||
| + | |||
| + | It is necessary to execute the following steps (see:[[ http:// | ||
| + | |||
| + | Edit / | ||
| + | <code bash> | ||
| + | enabled_apis=ec2, | ||
| + | </ | ||
| + | |||
| + | Restart the nova-api and nova-metadata-api services: | ||
| + | <code bash> | ||
| + | service openstack-nova-api restart | ||
| + | service openstack-nova-metadata-api restart | ||
| + | chkconfig openstack-nova-metadata-api on #auto start nova-metadata-api on boot | ||
| + | </ | ||
| + | |||
| + | If you tried to start openstack-nova-metadata-api before editing nova.conf you may need to do: | ||
| + | <code bash> | ||
| + | rm -f / | ||
| + | rm -f / | ||
| + | service openstack-nova-metadata-api restart | ||
| + | </ | ||
| + | |||
| + | === dhcp_agent.ini configuration === | ||
| + | Edit / | ||
| + | <code bash> | ||
| + | enable_isolated_metadata = True | ||
| + | enable_metadata_network = True | ||
| + | </ | ||
| + | |||
| + | Restart Neutron services | ||
| + | <code bash> | ||
| + | service neutron-dhcp-agent restart | ||
| + | service neutron-openvswitch-agent restart | ||
| + | </ | ||
| + | |||
| + | === ovs_neutron_plugin.ini configuration === | ||
| + | This step is needed only if the packstack property // | ||
| + | |||
| + | Edit / | ||
| + | <code bash> | ||
| + | network_vlan_ranges = physnet1 | ||
| + | bridge_mappings = physnet1: | ||
| + | </ | ||
| + | |||
| + | Restart Neutron services | ||
| + | <code bash> | ||
| + | service neutron-dhcp-agent restart | ||
| + | service neutron-openvswitch-agent restart | ||
| + | </ | ||
| + | |||
| + | === Neutron network configuration === | ||
| + | <code bash> | ||
| + | source keystonerc_admin | ||
| + | </ | ||
| + | |||
| + | == Create the net " | ||
| + | <code bash> | ||
| + | neutron net-create int-net --provider: | ||
| + | Created a new network: | ||
| + | +---------------------------+--------------------------------------+ | ||
| + | | Field | Value | | ||
| + | +---------------------------+--------------------------------------+ | ||
| + | | admin_state_up | ||
| + | | id | a3cbe3f5-a4a7-4dc8-86c9-493f0e6491b3 | | ||
| + | | name | int-net | ||
| + | | provider: | ||
| + | | provider: | ||
| + | | provider: | ||
| + | | shared | ||
| + | | status | ||
| + | | subnets | ||
| + | | tenant_id | ||
| + | +---------------------------+--------------------------------------+ | ||
| + | </ | ||
| + | |||
| + | == Create the subnet " | ||
| + | <code bash> | ||
| + | neutron subnet-create int-net 192.168.252.0/ | ||
| + | Created a new subnet: | ||
| + | +------------------+------------------------------------------------------+ | ||
| + | | Field | Value | | ||
| + | +------------------+------------------------------------------------------+ | ||
| + | | allocation_pools | {" | ||
| + | | cidr | 192.168.252.0/ | ||
| + | | dns_nameservers | ||
| + | | enable_dhcp | ||
| + | | gateway_ip | ||
| + | | host_routes | ||
| + | | id | dde26418-aec8-4984-b623-8e5e182655e5 | ||
| + | | ip_version | ||
| + | | name | int-subnet | ||
| + | | network_id | ||
| + | | tenant_id | ||
| + | +------------------+------------------------------------------------------+ | ||
| + | |||
| + | </ | ||
| + | |||
| + | == Create the net " | ||
| + | <code bash> | ||
| + | neutron net-create ext-net --provider: | ||
| + | Created a new network: | ||
| + | +---------------------------+--------------------------------------+ | ||
| + | | Field | Value | | ||
| + | +---------------------------+--------------------------------------+ | ||
| + | | admin_state_up | ||
| + | | id | f8976c9c-9e27-49c0-ab8c-5ba32dfea47d | | ||
| + | | name | ext-net | ||
| + | | provider: | ||
| + | | provider: | ||
| + | | provider: | ||
| + | | router: | ||
| + | | shared | ||
| + | | status | ||
| + | | subnets | ||
| + | | tenant_id | ||
| + | +---------------------------+--------------------------------------+ | ||
| + | </ | ||
| + | |||
| + | == Create the subnet " | ||
| + | <code bash> | ||
| + | neutron subnet-create ext-net 193.206.210.0/ | ||
| + | Created a new subnet: | ||
| + | +------------------+--------------------------------------------------------+ | ||
| + | | Field | Value | | ||
| + | +------------------+--------------------------------------------------------+ | ||
| + | | allocation_pools | {" | ||
| + | | cidr | 193.206.210.0/ | ||
| + | | dns_nameservers | ||
| + | | enable_dhcp | ||
| + | | gateway_ip | ||
| + | | host_routes | ||
| + | | id | fddd7673-51ea-45b4-b712-26e9023abdcb | ||
| + | | ip_version | ||
| + | | name | ex-subnet | ||
| + | | network_id | ||
| + | | tenant_id | ||
| + | +------------------+--------------------------------------------------------+ | ||
| + | </ | ||
| + | |||
| + | == Create and configure the Neutron router " | ||
| + | <code bash> | ||
| + | neutron router-create ext-to-int | ||
| + | |||
| + | Created a new router: | ||
| + | +-----------------------+--------------------------------------+ | ||
| + | | Field | Value | | ||
| + | +-----------------------+--------------------------------------+ | ||
| + | | admin_state_up | ||
| + | | external_gateway_info | | | ||
| + | | id | 5fc0c9bc-3544-4423-897d-a9777ccc96f3 | | ||
| + | | name | ext-to-int | ||
| + | | status | ||
| + | | tenant_id | ||
| + | +-----------------------+--------------------------------------+ | ||
| + | |||
| + | neutron router-gateway-set ext-to-int ext-net | ||
| + | Set gateway for router ext-to-int | ||
| + | |||
| + | neutron router-interface-add ext-to-int int-subnet | ||
| + | Added interface 3f4baee8-f21e-4d89-91bb-d522c2e0d5e0 to router ext-to-int. | ||
| + | </ | ||
| + | |||
| + | == Enable ping and SSH for VMs == | ||
| + | Add the following security groups for enabling ping and SSH for VMs. | ||
| + | <code bash> | ||
| + | nova secgroup-add-rule default icmp -1 -1 0.0.0.0/ | ||
| + | +-------------+-----------+---------+-----------+--------------+ | ||
| + | | IP Protocol | From Port | To Port | IP Range | Source Group | | ||
| + | +-------------+-----------+---------+-----------+--------------+ | ||
| + | | icmp | -1 | -1 | 0.0.0.0/0 | | | ||
| + | +-------------+-----------+---------+-----------+--------------+ | ||
| + | |||
| + | nova secgroup-add-rule default tcp 22 22 0.0.0.0/ | ||
| + | +-------------+-----------+---------+-----------+--------------+ | ||
| + | | IP Protocol | From Port | To Port | IP Range | Source Group | | ||
| + | +-------------+-----------+---------+-----------+--------------+ | ||
| + | | tcp | 22 | 22 | 0.0.0.0/0 | | | ||
| + | +-------------+-----------+---------+-----------+--------------+ | ||
| + | </ | ||
| + | |||
| + | == Set the static routing == | ||
| + | <code bash> | ||
| + | sudo route add -net 192.168.252.0 netmask 255.255.255.0 gw 193.206.210.165 | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
