2014년 9월 3일 수요일

Installation of OpenStack icehouse with Flat Network using devstack

* References
http://blog.felipe-alfaro.com/2014/02/03/openstack-with-devstack-in-ubuntu/
https://wiki.openstack.org/wiki/Obsolete:ConfigureOpenvswitch
http://wiki.stackinsider.org/index.php/DevStack_-_Single_Node_using_Neutron_FLAT_-_Havana


1. Network Configuration

- eth0 : NAT
- eth1 : Bridge

- /etc/network/interfaces
====================================================
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 192.168.186.10
        netmask 255.255.255.0

auto eth1
iface eth1 inet static
        address 10.10.1.190
        netmask 255.255.255.0
        gateway 10.10.1.1
        dns-nameservers 168.126.63.1
====================================================


2. local.conf
====================================================
HOST_IP=10.10.1.190

# network
FLAT_INTERFACE=eth1
FIXED_RANGE=20.1.1.0/24
FIXED_NETWORK_SIZE=256
NETWORK_GATEWAY=20.1.1.1
#FLOATING_RANGE=192.168.100.0/24
#PUBLIC_NETWORK_GATEWAY=192.168.100.1


# Neutron
Q_PLUGIN=ml2
Q_AGENT_EXTRA_OVS_OPTS=(tenant_network_type=vlan)
ENABLE_TENANT_VLANS=True
TENANT_VLAN_RANGE=100:200
#OVS_VLAN_RANGE=physnet1
PHYSICAL_NETWORK=physnet1
OVS_PHYSICAL_BRIDGE=br-eth1


# Services
ENABLED_SERVICES=rabbit,mysql,key
ENABLED_SERVICES+=,n-api,n-crt,n-obj,n-cpu,n-cond,n-sch,n-novnc,n-cauth
ENABLED_SERVICES+=,neutron,q-svc,q-agt,q-dhcp,q-l3,q-meta,q-lbaas
ENABLED_SERVICES+=,s-proxy,s-object,s-container,s-account
ENABLED_SERVICES+=,g-api,g-reg
ENABLED_SERVICES+=,cinder,c-api,c-vol,c-sch,c-bak
ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng
ENABLED_SERVICES+=,trove,tr-api,tr-tmgr,tr-cond
ENABLED_SERVICES+=,horizon
ENABLED_SERVICES+=,ceilometer-acompute,ceilometer-acentral,ceilometer-collector,ceilometer-api
====================================================


3. Post configuration

[Configuration for network interface]
auto eth1
iface eth1 inet manual
        up ifconfig $IFACE 0.0.0.0 up 
        up ip link set $IFACE promisc on 
        down ip link set $IFACE promisc off 
        down ifconfig $IFACE down 

# The Open VSwitch network interface 
auto br-eth1 
iface br-eth1 inet static 
        address 10.10.1.190
        netmask 255.255.255.0
        gateway 10.10.1.1
        dns-nameservers 168.126.63.1
        up ip link set $IFACE promisc on 
        down ip link set $IFACE promisc off

[Restart network interfaces]
# sudo ifdown eth1
# sudo ifup eth1
# sudo ifup br-eth1


[Configuration for Open vSwitch]
# ovs-vsctl add-port br-eth1 eth1
# ifconfig br-eth1 promisc up


4. Authentication

# vi keystone-admin
# put the configuration below
export OS_TENANT_NAME=admin 
export OS_USERNAME=admin 
export OS_PASSWORD=admin
PS1="\u@\h:\w (keystone-$OS_USERNAME)\$ " 
source openrc

# source ./keystone-admin

5. Create a flat network

# neutron net-create --os-tenant-name admin external_flat --shared --provider:network_type flat --provider:physical_network physnet1
# neutron subnet-create --os-tenant-name admin external_flat 10.10.1.0/24 --gateway 10.10.1.1 --dns-nameserver 168.126.63.1 --allocation-pool start=10.10.1.225,end=10.10.1.254

2014년 7월 29일 화요일

Errors and solutions during OpenStack icehouse installation

#######################################################
ERROR: openstackclient.shell Exception raised: six>=1.6.0

Solution:
Updating setuptools to the latest version right after installing pip looks to fix the issue.

sudo pip install --upgrade setuptools
#######################################################

2014년 5월 3일 토요일

Installation of OpenStack icehouse using devstack

###########################
# Network interface configuration
# /etc/network/interfaces
###########################

# The primary network interface
auto eth0
        iface eth0 inet dhcp

auto eth1
        iface eth1 inet manual
        up ifconfig $IFACE 0.0.0.0 up
        up ip link set $IFACE promisc on
        down ip link set $IFACE promisc off
        down ifconfig $IFACE down


############################
Installation steps
###########################

1. ssh root
2. apt-get -y update
3. apt-get -y install git
4. create user stack

# useradd -U -G sudo -s /bin/bash -m stack
# echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
# passwd stack

5. login as user stack
6. git clone https://github.com/openstack-dev/devstack.git -b stable/icehouse
7. cd devstack/
8. copy ./samples/local.conf to root directory
9. Add contents below into local.conf
10. ./stack.sh 
11. Do configuration as below for accessing from local PC to VM instances
      $ sudo ovs-vsctl show
      $ sudo ovs-vsctl add-port br-ex eth1


###########################
local.conf
###########################

# default 
HOST_IP=10.1.100.12

# network
FLAT_INTERFACE=eth0
FIXED_RANGE=10.0.0.0/24
FIXED_NETWORK_SIZE=256
NETWORK_GATEWAY=10.0.0.1
FLOATING_RANGE=192.168.100.0/24

# This IP will be assigned to br-ex interface after installation.
# So MUST check if this IP is not conflict with the IP of virtual port in local PC (e.g. VMnet8 or VMnet1 in case of VMware)
PUBLIC_NETWORK_GATEWAY=192.168.100.1


# Services
ENABLED_SERVICES=rabbit,mysql,key
ENABLED_SERVICES+=,n-api,n-crt,n-obj,n-cpu,n-cond,n-sch,n-novnc,n-cauth
ENABLED_SERVICES+=,neutron,q-svc,q-agt,q-dhcp,q-l3,q-meta,q-lbaas
ENABLED_SERVICES+=,s-proxy,s-object,s-container,s-account
ENABLED_SERVICES+=,g-api,g-reg
ENABLED_SERVICES+=,cinder,c-api,c-vol,c-sch,c-bak
ENABLED_SERVICES+=,heat,h-api,h-api-cfn,h-api-cw,h-eng
ENABLED_SERVICES+=,trove,tr-api,tr-tmgr,tr-cond
ENABLED_SERVICES+=,horizon
ENABLED_SERVICES+=,ceilometer-acompute,ceilometer-acentral,ceilometer-collector,ceilometer-api


2014년 3월 19일 수요일

Linux performance analysis and tools

http://www.slideshare.net/brendangregg/linux-performance-analysis-and-tools

Ubuntu KVM 설치

아래 우분투(Ubuntu) 사이트의 가이드대로만 따라하면 됨.
주의. root 계정으로 설치할 것.

https://help.ubuntu.com/community/KVM/Installation

2014년 3월 17일 월요일

Mac OS X Parallels 에서 CPU 가상화(Virtualization)를 위한 Intel VT-X option enable


정말 이 옵션 찾느라 몇시간을 헤멘거 같다.

Parallels에서 CPU 가상화를 위한 Intel VT-X 옵션을 enable 시키는 방법이다.

사실 처음에 VirtualBox 에 우분투(Ubuntu 64bit 12.04.4)를 깔고 거기에 KVM을 설치하는 과정에서 CPU가 가상화지원을 하지 않아 KVM을 설치하지 못한다는 메세지를 보고, 이걸 해결하려고 열심히 구글링 했다.
결론은 Apple Macbook Pro에서는 기본적으로 VT-X 옵션이 enable되어 있기때문에 별도로 할게 없다는 거다. (윈도우의 경우 BIOS에서 Virtualization Technology 옵션을 체크해야 함)

VirtualBox에서도 VT-x/AMD-V 옵션이 모두 체크되어 있는데도 우분투에서는 계속 CPU가 가상화 지원을 안한다고 나오는데 정말 이상했다.
결국 포기하고 Parallels 를 이용해서 성공했다. 내 생각에 Mac OS용 VirtualBox의 버그가 아닌지 모르겠다.



Mac OS X에서 CPU 가상화를 위한 Intel VT-x support 지원여부 확인


How to check that Intel VT-x is supported in CPU:

# sysctl -a | grep machdep.cpu.features

3. You may see output similar to the one bellow

Mac:~ user$ sysctl -a | grep machdep.cpu.features
kern.exec: unknown type returned
machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM SSE3 MON VMX EST TM2 TPR PDCM


If you see VMX entry then CPU supports Intel VT-x feature, but it still may be disabled.

Please install all firmware updates from Apple to resolve this issue