Skip to content

OpenStack:RDO

Install introduce

  1. CentOS를 설치한다. (LVM을 사용한다)
  2. CentOS7의 경우 /home에 큰 용량이 할당되므로 해당 LVM파티션을 제거하여 root에 재할당한다: CentOS:ResizeLVM를 참조.
  3. SELinux를 비활성화 한다.
  4. 만약 필요하다면 NVIDIA드라이버를 설치한다.
  5. RDOProject의 Answer파일을 생성한다.
  6. 설치한다. (설치할 때 root 계정의 ssh 접근을 시도한다. 따라서 ssh로 root접근이 가능한지 확인해야 한다.)

How to install

비 영어권에서는 아래의 로케일 설정을 진행한다. /etc/environment

LANG=en_US.utf-8
LC_ALL=en_US.utf-8

SELinux 설정을 변경한다. /etc/sysconfig/selinux파일의 enforcingpermissive로 변경한다.

저장소를 설치한다.

## On RHEL:
$ sudo yum install -y https://www.rdoproject.org/repos/rdo-release.rpm
## On CentOS:
$ sudo yum install -y centos-release-openstack-mitaka

## Add repository
$ sudo yum update -y
$ sudo yum install -y openstack-packstack

네트워크 설정을 바꾸는 NetworkManager서비스를 종료한다.

$ sudo systemctl disable NetworkManager
$ sudo systemctl enable network
$ sudo systemctl stop NetworkManager.service
$ sudo systemctl start network.service

간단한 설치방법은 아래와 같다. (외부 네트워크를 사용하고 싶다면 건너뛴다)

$ sudo packstack --allinone

Using external network

외부 네트워크와 연결하고 싶다면 아래와 같이 설치한다. (아래의 내용중, eth0는 자신의 Ethernet device이름으로 변경한다. e.g. CentOS7의 경우 enp0s31와 같은 느낌.)

$ sudo packstack --allinone --provision-demo=n --os-neutron-ovs-bridge-mappings=extnet:br-ex --os-neutron-ovs-bridge-interfaces=br-ex:eth0 --os-neutron-ml2-type-drivers=vxlan,flat

위에서 extnet은 외부의 물리적 L2 세그먼트에 대한 논리적 이름이다. 나중에 외부네트워크를 정의할 때 이 이름을 참조하게 된다.

또한 위의 설치명령이 지원하는 네트워크 타입은 flat이다. 이 것은 Provider Network가 단순한 flat network일 경우 필요하다. (the most common setup for PoCs). 만약 외부 연결을 휘해 VLAN Segment를 사용할 경우 type driver에 vlan이 필요하다.2

the command is currently broken for Mitaka

참조: Bug 1316856 - packstack fails to configure ovs bridge for CentOS

만약 위 명령이 정상적으로 작동하지 않다면 –os-neutron-ovs-bridge-interfaces=br-ex:eth0인수를 제거하고3 아래의 내용을 진행한다.

After completion, given a single machine with a current IP of 192.168.122.212/24 via DHCP with gateway of 192.168.122.1: Make /etc/sysconfig/network-scripts/ifcfg-br-ex resemble:

DEVICE=br-ex
DEVICETYPE=ovs
TYPE=OVSBridge
BOOTPROTO=static
IPADDR=192.168.122.212 # Old eth0 IP since we want the network restart to not 
                       # kill the connection, otherwise pick something outside your dhcp range
NETMASK=255.255.255.0  # your netmask
GATEWAY=192.168.122.1  # your gateway
DNS1=192.168.122.1     # your nameserver
ONBOOT=yes

The file above will move the network parameters from eth0 to br-ex.

Make /etc/sysconfig/network-scripts/ifcfg-eth0 resemble (no BOOTPROTO):

Note: if on Centos7, the file could be /etc/sysconfig/network-scripts/ifcfg-enp2s0

DEVICE=eth0
TYPE=OVSPort
DEVICETYPE=ovs
OVS_BRIDGE=br-ex
ONBOOT=yes

It is also possible to use a bond. In that case /etc/sysconfig/network-scripts/ifcfg-bond0 may look like this:

DEVICE=bond0
DEVICETYPE=ovs
TYPE=OVSPort
OVS_BRIDGE=br-ex
ONBOOT=yes
BONDING_MASTER=yes
BONDING_OPTS="mode=802.3ad"

This means, we will bring up the interface and plug it into br-ex OVS bridge as a port, providing the uplink connectivity.

Restart the network service

$ sudo service network restart

Neutron명령으로 외부 네트워크를 생성한다. (아래의 extnet L2 segment 이름은 최초 설치시 --os-neutron-ovs-bridge-mappings의 인자로 사용되었다.)

$ . keystonerc_admin
$ neutron net-create external_network --provider:network_type flat --provider:physical_network extnet  --router:external

/etc/sysconfig/network-scripts/ifcfg-br-ex설정에 주의하여, 서브넷을 생성한다.

$ neutron subnet-create --name public_subnet --enable_dhcp=False --allocation-pool=start=192.168.122.10,end=192.168.122.20 --gateway=192.168.122.1 external_network 192.168.122.0/24

데모를 위한 CirrOS를 Glance로 추가한다.

$ curl http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img | glance image-create --name='cirros image' --visibility=public --container-format=bare --disk-format=qcow2

관리를 위한 최소 설정은 이 것으로 완료되었다.

Testing

새로운 사용자를 추가하여 외부 네트워크를 테스트한다. 명령에 대한 자세한 설명은 배제한다.

$ openstack project create --enable internal
$ openstack user create --project internal --password foo --email [email protected] --enable internal

Now, let's switch to the newly created user:

# export OS_USERNAME=internal
# export OS_TENANT_NAME=internal
# export OS_PASSWORD=foo

Then create a router and set its gateway using the external network created by the admin in one of previous steps:

# neutron router-create router1
# neutron router-gateway-set router1 external_network

Now create a private network and a subnet in it, since demo provisioning has been disabled:

# neutron net-create private_network
# neutron subnet-create --name private_subnet private_network 192.168.100.0/24

Finally, connect your new private network to the public network through the router, which will provide floating IP addresses.

# neutron router-interface-add router1 private_subnet

Easiest way to the network and to launch instances is via horizon, which was set up by packstack.

Command

packstack --gen-answer-file=/answer/file/path
Answer 파일을 생성한다.
packstack --answer-file=/path/to/packstack_answers.txt
Reuse an answer file.
packstack --allinone
Shorthand for: --install-hosts=<local ipaddr>--novanetwork-pubif=<dev>--novacompute-privif=lo --novanetwork-privif=lo --os-swift-install=y --nagios--install=y
All in one command.

Configure

CONFIG_CINDER_VOLUMES_SIZE
how to resize cinder size
Cinder 볼륨 크기를 설정한다.
Size of Block Storage volumes group. Actual volume size will be extended with 3% more space for VG metadata. Remember that the size of the volume group will restrict the amount of disk space that you can expose to Compute instances, and that the specified amount must be available on the device used for /var/lib/cinder.
CONFIG_PROVISION_DEMO
Recommand value: n
Command-line flag: --provision-demo=n
테스트 데모를 위한 설정적용 여부.
CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS
Recommand value: extnet: br-ex
Command-line flag: --os-neutron-ovs-bridge-mappings=extnet:br-ex
CONFIG_NEUTRON_OVS_BRIDGE_IFACES
Recommand value: br-ex:enp3s0
Command-line flag: --os-neutron-ovs-bridge-interfaces=br-ex:enp3s0
CONFIG_NEUTRON_ML2_TYPE_DRIVERS
Recommand value: vxlan,flat
Command-line flag: --os-neutron-ml2-type-drivers=vxlan,flat
CONFIG_HORIZON_SSL
Horizon을 SSL로 적용한다.

Horizon SSL

With the current (Oct. 2013) version of packstack the CONFIG_HORIZON_SSL=y fails for both grizzly and havana. Here is a guide to setting up ssl after the installation.

install the ssl module for apache

$ yum -y install mod_ssl

copy the certificate and key files to /etc/httpd/conf.d

update /etc/httpd/conf.d/ssl.conf

     SSLCertificateFile /etc/httpd/conf.d/mycert.crt
     SSLCertificateKeyFile /etc/httpd/conf.d/mycert.key

update /etc/httpd/conf.d/openstack-dashboard.conf

sed -i '1 i\
#these lines force an ssl connection\
RewriteEngine On\
RewriteCond %{HTTPS} !on\
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]\
'  /etc/httpd/conf.d/openstack-dashboard.conf

make a backup of the ssl.conf file (in case packstack is re-run)

$ tar cfz /etc/httpd/conf.d/ssl.tz /etc/httpd/conf.d/ssl.conf

restart the web service

$ service httpd restart

Troubleshooting

rdo cannot remove lib dracut hooks shutdown 30-dm-shutdown readonly file system

RDO설치 후 서버가 정상종료되지 않는 현상이 발생될 수 있다. 이 곳을 참조하면 된다.

Not working external network in VirtualBox

VirtualBox에서 브릿지 어댑터로 설정한 네트워크 어뎁터를 통하여 외부 네트워크와 통신이 안되는 현상이 발생할 수 있다. 이 경우 해당 네트워크 어뎁터를 무작위 모드 (Promiscuous mode)로 변경해야 한다.

See also

Favorite site

Documentation

Guide

References


  1. enp0s3를 eth0와 같은 방식으로 변경하고자 한다면 Ifconfig#CentOS7 : Change network interface name을 참조. 

  2. 참고로, 설치 완료후 직접 설정을 수정하는 방법은 이 곳을 참조. 

  3. 대안으로, packstack –allinone –provision-all-in-one-ovs-bridge=n를 사용하는 대안이 있지만 이 방법은 더 복잡하다.