티스토리 뷰

1. Baremetal 서버의 Bridge Network 설정


먼저 bridge 모듈 설치
yum install bridge-utils

KVM Host 서버의 외부 접속 Ethernet을 Bridge로 변경
(외부 IP. 여기서는 10.0.0.100이 할당된 것)

[root@Tiger ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth7
DEVICE=eth7
HWADDR=A0:D3:C1:EF:F6:30
TYPE=Ethernet
UUID=ceebc5a7-338d-456b-b752-98cae0d7e700
ONBOOT=yes
BOOTPROTO=static
BRIDGE=br7

==> 기존 Ethernet의 IP를 아래 Bridge로 옮김

[root@Tiger ~]# cat /etc/sysconfig/network-scripts/ifcfg-br7
DEVICE=br7
TYPE=Bridge
ONBOOT=yes
BOOTPROTO=static
DELAY=0
IPADDR=192.168.0.240
NETMASK=255.255.255.0
GATEWAY=192.168.0.1

2. CentOs 7 VM 이미지 생성
  http://www.centos.org/download/ 에서 Minimal Install Image 선택
  


  ==> openstack1으로 생성 (마스터 VM 이미지)

3. 생성된 CentOS VM의 NIC 중 하나를 위에 생성된 br7으로 변경

virt-manager의 VM 설정 화면에서...
NIC를 선택하고 Device에 'Specify shared device name'
Bridge name에 'br7' (위에서 br7으로 생성)


4. CentOS VM 에 연결할 수 있는 VNC 할당

다음과 같이 VNC 포트 수정. IP는 KVM Host(Baremetal)의 IP

virsh # edit openstack1

    <graphics type='vnc' port='6901' autoport='no' listen='10.0.0.100'>
      <listen type='address' address='10.0.0.100'/>
    </graphics>

그러면 다음과 같이 VNC Listening 하고 접속 가능

virsh # vncdisplay openstack1
10.0.0.100:1001

[root@Lion ~]# netstat -an | grep 690
tcp        0      0 10.0.0.100:6901              0.0.0.0:*                   LISTEN



파이어월에 의해 69XX 포트가 접속이 안되는 경우가 있으므로 다음과 같이 완전히 OFF 하거나 예외를 추가해야 함

파이어월 OFF
systemctl stop firewalld

69XX 포트 예외 추가
[root@server ~]# firewall-cmd --permanent --zone=public --add-port=69XX/tcp
[root@server ~]# firewall-cmd --reload


5. CentOS VM을 여러 개 복제 생성

다음과 같이 virt-clone 툴 설치

yum install virt-install.noarch

virt-clone --original openstack1 --name openstack2 --file /var/lib/libvirt/images/openstack2.img

4번 과정을 참고해서 각 VM에 맞게 VNC 포트 변경



6. 각자 VM에서 ifcfg-eth0의 IP 및 MAC addr 변경

미리 ip a 또는 ifconfig 명령으로 eth0에 새로 할당된 MAC Addr 확인 후
아래 정보를 각자 환경에 맞게 수정

[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
HWADDR="52:54:00:AB:AF:48"
TYPE="Ethernet"
BOOTPROTO="static"
IPADDR=192.168.0.61
GATEWAY=192.168.0.1
NAME="eth0"
UUID="fed9319b-ef74-4be9-a1bd-9044b6d5641a"
ONBOOT="yes"

DNS 서버를 세팅

[root@localhost ~]# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 10.0.0.2
nameserver 210.94.0.73


7. PackStack으로 OpenStack 설치

root로 로그인 해서

ELEP 패키지 Repository 설정

OpenStack IceHouse 버전 Repository 설정

PackStack 설치
yum install openstack-packstack


8. Answer 파일 준비
 packstack --gen-answer-file=answer.txt

다음 파일을 각자 IP에 맞게 수정
vi에서 일괄 변경:%s/192.168.25.13/<각 서버 IP>/g


9. PackStack에 있는 버그 때문에 MongoDB(Ceilometer의 스토리지로 활용) 설치 중 에러

Workaround로 다음과 같이 작업

cd /var/run/mongodb
ln -s mongodb.pid mongod.pid 


9. 설치 작업

packstack --answer-file=my_answers.txt

==> 약 30분 정도 작업

대략 다음과 같은 화면이 나오면 All In One 설치 완료



10. 접속

대시보드 접속 (horizon): http://10.0.0.51/
  ==> ID/PW는 다음과 같이 keystonerc_admin 파일에 들어 있음
[root@localhost ~]# cat keystonerc_admin
export OS_USERNAME=admin
export OS_TENANT_NAME=admin
export OS_PASSWORD=780a485e394b4013

export OS_AUTH_URL=http://192.168.0.61:5000/v2.0/
export PS1='[\u@\h \W(keystone_admin)]\$ '


Nagios 접속
  ==> ID/PW는 다음과 같이 설치 확인 메시지 참고
 * To use Nagios, browse to http://192.168.0.61/nagios username: nagiosadmin, password: 84093c56484344de


이 패스워드들은 my_answers.txt 파일에 저장이 되어 있으므로 8번 과정에서 미리 Text 파일을 수정해서 원하는 패스워드를 사용할 수도 있음

[root@localhost ~]# ls -l
합계 40
-rw-r--r--. 1 root root   196 12월 16 21:37 a.txt
-rw-------. 1 root root   936 12월 16 20:34 anaconda-ks.cfg
-rw-r--r--. 1 root root   120 12월 16 21:36 b.txt
-rw-------. 1 root root   179 12월 16 22:41 keystonerc_admin
-rw-------. 1 root root   176 12월 16 22:41 keystonerc_demo
-rw-r--r--. 1 root root 17628 12월 16 22:02 my_answers.txt


11. OpenStack 설치 및 동작 상태 확인

[root@localhost ~]# source keystonerc_admin
==> Admin 유저 환경 변수 세팅

[root@localhost ~(keystone_admin)]# openstack-status
== Nova services ==
openstack-nova-api:                     active
openstack-nova-cert:                    active
openstack-nova-compute:                 active
openstack-nova-network:                 inactive  (disabled on boot)
openstack-nova-scheduler:               active
openstack-nova-volume:                  inactive  (disabled on boot)
openstack-nova-conductor:               active
== Glance services ==
openstack-glance-api:                   active
openstack-glance-registry:              active
== Keystone service ==
openstack-keystone:                     active
== Horizon service ==
openstack-dashboard:                    active
== neutron services ==
neutron-server:                         active
neutron-dhcp-agent:                     active
neutron-l3-agent:                       active
neutron-metadata-agent:                 active
neutron-lbaas-agent:                    active
neutron-openvswitch-agent:              active
neutron-linuxbridge-agent:              inactive  (disabled on boot)
neutron-ryu-agent:                      inactive  (disabled on boot)
neutron-nec-agent:                      inactive  (disabled on boot)
neutron-mlnx-agent:                     inactive  (disabled on boot)
== Swift services ==
openstack-swift-proxy:                  active
openstack-swift-account:                active
openstack-swift-container:              active
openstack-swift-object:                 active
== Cinder services ==
openstack-cinder-api:                   active
openstack-cinder-scheduler:             active
openstack-cinder-volume:                active
openstack-cinder-backup:                active
== Ceilometer services ==
openstack-ceilometer-api:               active
openstack-ceilometer-central:           active
openstack-ceilometer-compute:           active
openstack-ceilometer-collector:         active
openstack-ceilometer-alarm-notifier:    active
openstack-ceilometer-alarm-evaluator:   active
== Heat services ==
openstack-heat-api:                     active
openstack-heat-api-cfn:                 active
openstack-heat-api-cloudwatch:          inactive  (disabled on boot)
openstack-heat-engine:                  active
== Support services ==
libvirtd:                               active
openvswitch:                            active
dbus:                                   active
tgtd:                                   inactive  (disabled on boot)
rabbitmq-server:                        active
memcached:                              active
== Keystone users ==
+----------------------------------+------------+---------+----------------------+
|                id                |    name    | enabled |        email         |
+----------------------------------+------------+---------+----------------------+
| d0628dbf8841486d92550a1a411ea6aa |   admin    |   True  |    root@localhost    |
| 6ae674f8ba5047a98a427f043bfac5b4 | ceilometer |   True  | ceilometer@localhost |
| 33ce7a39194244e49b965368d5c77722 |   cinder   |   True  |   cinder@localhost   |
| d1f5c5d4810e4731ad8f335f6dd237bb |    demo    |   True  |                      |
| 5dcd12aceafc4bf8adaf34a657612490 |   glance   |   True  |   glance@localhost   |
| 3e3a0c38357e44fa8f2439b46e3d02b4 |    heat    |   True  |    heat@localhost    |
| bd5cde239e874dc9bbae326981434035 |  heat-cfn  |   True  |  heat-cfn@localhost  |
| dbeb4a46c31d4fa29130b1e19e781f86 | heat_admin |   True  |                      |
| 8884d2eab5b54ceb94deab9c3e45d3db |  neutron   |   True  |  neutron@localhost   |
| 6878401b2b0a43659eec2880317c119e |    nova    |   True  |    nova@localhost    |
| 140ae099f0e341c182d033992c37c9c0 |   swift    |   True  |   swift@localhost    |
+----------------------------------+------------+---------+----------------------+
== Glance images ==
+--------------------------------------+--------+-------------+------------------+----------+--------+
| ID                                   | Name   | Disk Format | Container Format | Size     | Status |
+--------------------------------------+--------+-------------+------------------+----------+--------+
| c874b9cd-d74d-43d2-8acb-703a2a70324d | cirros | qcow2       | bare             | 13147648 | active |
+--------------------------------------+--------+-------------+------------------+----------+--------+
== Nova managed services ==
+------------------+-----------------------+----------+---------+-------+----------------------------+-----------------+
| Binary           | Host                  | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+------------------+-----------------------+----------+---------+-------+----------------------------+-----------------+
| nova-consoleauth | localhost.localdomain | internal | enabled | up    | 2014-12-17T12:23:41.000000 | -               |
| nova-scheduler   | localhost.localdomain | internal | enabled | up    | 2014-12-17T12:23:44.000000 | -               |
| nova-conductor   | localhost.localdomain | internal | enabled | up    | 2014-12-17T12:23:45.000000 | -               |
| nova-compute     | localhost.localdomain | nova     | enabled | up    | 2014-12-17T12:23:43.000000 | -               |
| nova-cert        | localhost.localdomain | internal | enabled | up    | 2014-12-17T12:23:46.000000 | -               |
+------------------+-----------------------+----------+---------+-------+----------------------------+-----------------+
== Nova networks ==
+--------------------------------------+---------+------+
| ID                                   | Label   | Cidr |
+--------------------------------------+---------+------+
| 4ace4285-e254-4c20-b5c2-e07c3cf7939d | private | -    |
| b0e95e38-9762-4774-9946-fd221ca54a48 | public  | -    |
+--------------------------------------+---------+------+
== Nova instance flavors ==
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name      | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| 1  | m1.tiny   | 512       | 1    | 0         |      | 1     | 1.0         | True      |
| 2  | m1.small  | 2048      | 20   | 0         |      | 1     | 1.0         | True      |
| 3  | m1.medium | 4096      | 40   | 0         |      | 2     | 1.0         | True      |
| 4  | m1.large  | 8192      | 80   | 0         |      | 4     | 1.0         | True      |
| 5  | m1.xlarge | 16384     | 160  | 0         |      | 8     | 1.0         | True      |
+----+-----------+-----------+------+-----------+------+-------+-------------+-----------+
== Nova instances ==
+----+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+----+------+--------+------------+-------------+----------+
+----+------+--------+------------+-------------+----------+





댓글
댓글쓰기 폼