progetti:cloud-areapd:keystone-glance_high_availability:openstack_ha:temporary_compute
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| progetti:cloud-areapd:keystone-glance_high_availability:openstack_ha:temporary_compute [2015/02/16 10:35] – [IPTables configuration] dorigoa@infn.it | progetti:cloud-areapd:keystone-glance_high_availability:openstack_ha:temporary_compute [2015/03/27 09:19] (current) – [Install software] dorigoa@infn.it | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ======= Installation and Configuration of OpenStack Compute Node ======= | ||
| + | Author: | ||
| + | * Alvise Dorigo (INFN Padova) | ||
| + | ===== Prerequisites ===== | ||
| + | * [[http:// | ||
| + | |||
| + | At least one node with: | ||
| + | * Updated SL6/CentOS6 (6.4 or 6.5) | ||
| + | * Make sure that yum autoupdate is disabled | ||
| + | <code bash> | ||
| + | root@controller-01 ~]# grep ENA / | ||
| + | # ENABLED | ||
| + | ENABLED=" | ||
| + | </ | ||
| + | * At least 20GB HD for operating system and OpenStack software and related log files | ||
| + | * Dedicated storage mounted on ''/ | ||
| + | <code bash> | ||
| + | gluster volume set < | ||
| + | gluster volume set < | ||
| + | </ | ||
| + | where < | ||
| + | |||
| + | < | ||
| + | |||
| + | * SELinux configured as " | ||
| + | * EPEL 6-8 | ||
| + | * A MySQL (possibly a HA cluster) endpoint each OpenStack service can connect to (in this guide we're using our MySQL Percona cluster' | ||
| + | * A HAProxy/ | ||
| + | * Installed CA INFN certificate on both nodes | ||
| + | <code bash> | ||
| + | [root@network-01 ~]# ll / | ||
| + | -rw-r--r-- 1 root root 1257 Jun 5 19:05 / | ||
| + | </ | ||
| + | * Installed and active libvirt | ||
| + | <code bash> | ||
| + | yum -y install libvirt | ||
| + | chkconfig libvirtd on | ||
| + | service libvirtd start | ||
| + | </ | ||
| + | * Activated virtualization on CPU (can be toggled in the BIOS menu): | ||
| + | <code bash> | ||
| + | cat / | ||
| + | flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 lahf_lm dts tpr_shadow vnmi flexpriority | ||
| + | |||
| + | lsmod |grep kvm | ||
| + | kvm_intel | ||
| + | kvm | ||
| + | |||
| + | lscpu |grep -i virtu | ||
| + | Virtualization: | ||
| + | |||
| + | </ | ||
| + | Note: '' | ||
| + | ===== Naming conventions and networking assumptions ===== | ||
| + | We assume that the compute node has the following network setup: | ||
| + | * It has two network interface connected to two different networks: **management network** and **data network** | ||
| + | * **Management network** is: '' | ||
| + | * **Data network** is: '' | ||
| + | * Node are named: '' | ||
| + | |||
| + | ==== Further pre-requisite on data network interface ==== | ||
| + | In the net-interface configuration script for data network (something like ''/ | ||
| + | <code bash> | ||
| + | MTU=" | ||
| + | </ | ||
| + | ===== IPTables configuration ===== | ||
| + | Execute the following commands: | ||
| + | <code bash> | ||
| + | # VNC's TCP ports | ||
| + | iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 5900:5999 -j ACCEPT | ||
| + | # libvirtd' | ||
| + | iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 16509 -j ACCEPT | ||
| + | # libvirtd' | ||
| + | iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 49152:49261 -j ACCEPT | ||
| + | # permit ntpd's udp communications | ||
| + | iptables -A INPUT -p udp -m state --state NEW -m udp --dport 123 -j ACCEPT | ||
| + | |||
| + | mv / | ||
| + | iptables-save > / | ||
| + | chkconfig iptables on | ||
| + | chkconfig ip6tables off | ||
| + | service iptables restart | ||
| + | </ | ||
| + | |||
| + | ===== Naming conventions and networking assumptions ===== | ||
| + | We assume that the compute node has the following setup: | ||
| + | * It has 2 network interfaces connected to two different networks: **management network**, **Data network** | ||
| + | * **Management network** is: '' | ||
| + | * **Data network** is: 192.168.61.0/ | ||
| + | * The node is named: '' | ||
| + | * In this guide the controller' | ||
| + | * In this guide the MySQL cluster' | ||
| + | * In this guide the controller' | ||
| + | ===== Install software ===== | ||
| + | Install Havana repo: | ||
| + | <code bash> | ||
| + | yum -y install http:// | ||
| + | </ | ||
| + | When the support to Havana is decomissioned, | ||
| + | <code bash> | ||
| + | yum -y install https:// | ||
| + | sed -i ' | ||
| + | </ | ||
| + | Install Nova and Neutron' | ||
| + | <code bash> | ||
| + | yum -y install openstack-nova-compute openstack-utils openstack-neutron-openvswitch sysfsutils | ||
| + | yum -y update iproute | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Preliminary networking setup ===== | ||
| + | <code bash> | ||
| + | sed -i ' | ||
| + | sed -i ' | ||
| + | cat << EOF >> / | ||
| + | net.ipv4.conf.all.rp_filter=0 | ||
| + | net.ipv4.conf.default.rp_filter=0 | ||
| + | EOF | ||
| + | sysctl -p | ||
| + | service network restart | ||
| + | </ | ||
| + | ===== Configure Nova ===== | ||
| + | **nova.conf** | ||
| + | <code bash> | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | |||
| + | # Change the following IP with the actual IP of the current compute node on the management network | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | # vncserver_listen MUST be 0.0.0.0 otherwise the live migration won't work correctly | ||
| + | # (http:// | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | |||
| + | # Change the following IP with the actual IP of the current compute node on the management network | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | # the following 3 lines enable admin' | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | |||
| + | |||
| + | # this is a temporary workaround untill we understand a problem of cpu not compatible when live-migrating VMs | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | |||
| + | </ | ||
| + | **api-paste.ini** | ||
| + | <code bash> | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | |||
| + | </ | ||
| + | ===== Configure LibVirt to support Live Migration ===== | ||
| + | Turn OFF the '' | ||
| + | <code bash> | ||
| + | service libvirtd stop | ||
| + | </ | ||
| + | Execute: | ||
| + | <code bash> | ||
| + | cat << EOF >> / | ||
| + | listen_tls = 0 | ||
| + | listen_tcp = 1 | ||
| + | auth_tcp = " | ||
| + | EOF | ||
| + | </ | ||
| + | and | ||
| + | <code bash> | ||
| + | cat << EOF >> / | ||
| + | LIBVIRTD_ARGS=" | ||
| + | EOF | ||
| + | </ | ||
| + | Modify '' | ||
| + | <code bash> | ||
| + | cat << EOF >> / | ||
| + | user=" | ||
| + | group=" | ||
| + | dynamic_ownership = 0 | ||
| + | EOF | ||
| + | </ | ||
| + | ===== Configure Neutron' | ||
| + | As in the compute node the Neutron' | ||
| + | |||
| + | **neutron.conf** | ||
| + | <code bash> | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | </ | ||
| + | **ovs_neutron_plugin.ini** | ||
| + | <code bash> | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | |||
| + | # Change the following IP with the actual current compute node's IP on the data network | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | ln -s / | ||
| + | </ | ||
| + | (Neutron L2 agent' | ||
| + | <code bash> | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | </ | ||
| + | ===== Bridge creation and start of the services ===== | ||
| + | Open vSwitch start and bridge creation | ||
| + | <code bash> | ||
| + | service openvswitch start | ||
| + | chkconfig openvswitch on | ||
| + | ovs-vsctl add-br br-int | ||
| + | </ | ||
| + | L2 Agent start: | ||
| + | <code bash> | ||
| + | service neutron-openvswitch-agent start | ||
| + | chkconfig neutron-openvswitch-agent on | ||
| + | chkconfig neutron-ovs-cleanup on | ||
| + | </ | ||
| + | Start Services: | ||
| + | <code bash> | ||
| + | service libvirtd start | ||
| + | service messagebus start | ||
| + | service openstack-nova-compute start | ||
| + | chkconfig libvirtd on | ||
| + | chkconfig messagebus on | ||
| + | chkconfig openstack-nova-compute on | ||
| + | </ | ||
| + | ===== Check all ===== | ||
| + | When done, log into the controller node, or wherever you've installed the Openstack CLI and copied the '' | ||
| + | <code bash> | ||
| + | [root@controller-01 ~]# neutron agent-list | ||
| + | +--------------------------------------+--------------------+-----------------------------+-------+----------------+ | ||
| + | | id | agent_type | ||
| + | +--------------------------------------+--------------------+-----------------------------+-------+----------------+ | ||
| + | | 188fe879-be8a-4390-b766-04e188e35c3c | L3 agent | network-02.cloud.pd.infn.it | :-) | True | | ||
| + | | 3c460fc1-c111-4be5-a37b-88aa7ffd265a | Open vSwitch agent | compute.cloud.pd.infn.it | ||
| + | | 42647a60-dbd0-4a85-942d-8fdbb0e2ae24 | Open vSwitch agent | network-01.cloud.pd.infn.it | :-) | True | | ||
| + | | cf6f7ec2-8700-498b-b62d-49d8b5616682 | DHCP agent | network-02.cloud.pd.infn.it | :-) | True | | ||
| + | | dc249956-e81d-465c-b51f-cff0e1e04f05 | DHCP agent | network-01.cloud.pd.infn.it | :-) | True | | ||
| + | | e196a6a2-8a3a-4bfe-b048-b50bee14761c | Open vSwitch agent | network-02.cloud.pd.infn.it | :-) | True | | ||
| + | | eb902101-8a16-43b5-87f8-b058530407f6 | L3 agent | network-01.cloud.pd.infn.it | :-) | True | | ||
| + | +--------------------------------------+--------------------+-----------------------------+-------+----------------+ | ||
| + | |||
| + | [root@controller-01 ~]# nova service-list | ||
| + | +------------------+--------------------------------+----------+---------+-------+----------------------------+-----------------+ | ||
| + | | Binary | ||
| + | +------------------+--------------------------------+----------+---------+-------+----------------------------+-----------------+ | ||
| + | | nova-scheduler | ||
| + | | nova-cert | ||
| + | | nova-consoleauth | controller-01.cloud.pd.infn.it | internal | enabled | up | 2014-03-22T10: | ||
| + | | nova-conductor | ||
| + | | nova-compute | ||
| + | | nova-consoleauth | controller-02.cloud.pd.infn.it | internal | enabled | up | 2014-03-22T10: | ||
| + | | nova-conductor | ||
| + | | nova-cert | ||
| + | | nova-scheduler | ||
| + | +------------------+--------------------------------+----------+---------+-------+----------------------------+-----------------+ | ||
| + | </ | ||
| + | |||
| + | ===== Add SSH passwordless access from Compute node to virtual instances ===== | ||
| + | This is needed to allow nova to resize virtual instances. Execute the following commands: | ||
| + | <code bash> | ||
| + | usermod -s /bin/bash nova | ||
| + | mkdir -p -m 700 ~nova/.ssh | ||
| + | chown nova.nova ~nova/.ssh | ||
| + | cd ~nova/.ssh | ||
| + | scp controller-01:/ | ||
| + | chown nova.nova * | ||
| + | </ | ||
| + | |||
| + | ===== Optional: Configure Nova Compute for SSL ===== | ||
| + | <code bash> | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | |||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | |||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | |||
| + | |||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | openstack-config --set / | ||
| + | # | ||
| + | openstack-config --set / | ||
| + | |||
| + | openstack-config --set / | ||
| + | |||
| + | </ | ||
| + | Restart L2 agent and Nova Compute | ||
| + | <code bash> | ||
| + | service openstack-nova-compute restart | ||
| + | service neutron-openvswitch-agent restart | ||
| + | |||
| + | </ | ||
| + | === Fix metadata agent === | ||
| + | To address this [[https:// | ||
| + | <code bash> | ||
| + | curl -o agent.py https:// | ||
| + | mv / | ||
| + | cp agent.py / | ||
| + | |||
| + | service openstack-nova-compute restart | ||
| + | service neutron-openvswitch-agent restart | ||
| + | |||
| + | </ | ||
| + | |||
| + | === === | ||
