您好,登錄后才能下訂單哦!
小編給大家分享一下openstack havana vlan如何安裝,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!
Local模式:一般測試時使用,只需一臺物理機即可。 GRE模式:隧道數量沒有限制,性能有點問題。 Vlan模式:vlan數量有4096的限制 VXlan模式:vlan數量沒有限制,性能比GRE好。 Flat模式:管理員創建租戶直接到外網,不需要NAT了。 目前的幾個項目正好用到了這種Flat模式的網絡結構,我覺得小項目中還是比較方便的,Openstack的體系和框架越來越穩定,項目中用用虛擬化和存儲,直接借助Openstack還是很方便。這時網絡結構可能就不需要用租戶、或者在細分其它,Flat模式反而更簡潔直觀,畢竟外網IP直接到了instance。 下面以我實驗環境配置為例,存儲部分配置省略。 環境:controller node一臺 compute node一臺 OS:Centos6.4 系統邏輯結構如下
一、controller node 配置 1、網絡 [root@controller ~]# more /etc/hosts 192.168.3.98 controller 192.168.3.95 compute [root@controller ~]# more /etc/sysconfig/network-scripts/ifcfg-eth0 #外部網絡 DEVICE=eth0 HWADDR=10:BF:48:B7:8F:A0 TYPE=Ethernet ONBOOT=yes BOOTPROTO=none IPADDR=192.168.3.98 NETMASK=255.255.255.0 GATEWAY=192.168.3.1 [root@controller ~]# more /etc/sysconfig/network-scripts/ifcfg-eth2 #vm 及node之間通訊使用 DEVICE=eth2 TYPE=Ethernet ONBOOT=yes [root@controller ~]# more /etc/sysconfig/network NETWORKING=yes HOSTNAME=controller GATEWAY=192.168.3.1 [root@controller ~]# more /etc/resolv.conf nameserver 202.102.134.68 nameserver 202.102.128.68
2、添加源 yum install wget cd /etc/yum.repos.d/ wget yum list
3、LVM配置 [我單獨拿出一個分區給cinder使用,同時我的控制和計算節點也都是cinder節點] [root@controller ~]# umount /dev/sda5 [root@controller ~]# pvcreate /dev/sda5 Physical volume "/dev/sda5" successfully created [root@controller ~]# vgcreate cinder-volumes /dev/sda5 Volume group "cinder-volumes" successfully created
4、安裝packstack yum install -y yum install -y openstack-packstack yum -y update 重啟機器
5、Packstack配置 創建一個應答文件
packstack --gen-answer-file=multi-node.txt
修改應答文件,由于我已經有專門的cinder volume, 所以不需要創建。如果沒有手工創建cinder volume,那么這就不修改就可以。
CONFIG_CINDER_VOLUMES_CREATE=n #不在創建volume CONFIG_HEAT_INSTALL=y CONFIG_NAGIOS_INSTALL=y CONFIG_KEYSTONE_ADMIN_PW=admin CONFIG_NOVA_COMPUTE_HOSTS=192.168.3.98 #此處可以添加compute node IP ,號分割 CONFIG_NEUTRON_OVS_TENANT_NETWORK_TYPE=vlan CONFIG_NEUTRON_OVS_VLAN_RANGES=physnet1:100:200 CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=physnet1:br-eth2 CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-eth2:eth2 CONFIG_HEAT_CLOUDWATCH_INSTALL=y CONFIG_HEAT_CFN_INSTALL=y CONFIG_NAGIOS_PW=admin
6、安裝 [RDO的方式部署簡直太簡單了,我值截取部分] [root@controller ~]# packstack --answer-file=multi-node.txt #安裝過程,開始會輸入密碼,多節點的話會依此類推。安裝過程有可能因為源的原因中斷,可以重復運行。 Welcome to Installer setup utility Packstack changed given value to required value /root/.ssh/id_rsa.pub
Installing: Clean Up... [ DONE ]
7、 裝完后,有可能由于RDO的問題,沒有創建br-ex,需要我們手工來創建。 【目前看2014年后,redhat已經修復這個bug,剩下的只是我們對應的創建網卡配置文件和啟動port】 [root@controller network-scripts]# more ifcfg-br-ex DEVICE=br-ex IPADDR=192.168.3.98 PREFIX=24 GATEWAY=192.168.3.1 DNS1=202.102.134.68 ONBOOT=yes 修改 /etc/sysconfig/network-scripts/ifcfg-eth0, 注意:一定要加上eth0 的mac地址,不然會出錯。
[root@controller network-scripts]# more ifcfg-eth0 DEVICE=eth0 HWADDR=00:90:27:E0:61:14 #TYPE=Ethernet ONBOOT=yes #BOOTPROTO=none #IPADDR=192.168.3.98 #NETMASK=255.255.255.0
ovs-vsctl add-port br-ex eth0; service network restart 當運行 ovs-vsctl add-port的時候,網絡就會中斷,所以你兩條命令需要一起執行。
8、改變橋接網絡配置,此處主要修改neutron配置,我們的flat網絡模式是依賴在vlan的基礎上改進的,也是此文重點之處。 編輯 vi /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini 原安裝完初始內容如下 [OVS] network_vlan_ranges=physnet1:100:200 tenant_network_type=vlan enable_tunneling=False integration_bridge=br-int bridge_mappings=physnet1:br-eth2
修改成
[OVS] network_vlan_ranges=physnet1,physnet2:100:200 tenant_network_type=vlan enable_tunneling=False integration_bridge=br-int bridge_mappings=physnet1:br-ex,physnet2:br-eth2
然后重啟相關服務,如果為省事,重啟機器 之后檢查網絡和橋接情況查詢 [root@controller ~]# ovs-vsctl show
9、創建Flat模式網絡,目前都可以在web界面操作 [root@controller ~(keystone_admin)]# neutron net-create Public --provider:network_type flat --provider:physical_network physnet1 Created a new network: +---------------------------+--------------------------------------+ | Field | Value | +---------------------------+--------------------------------------+ | admin_state_up | True | | id | 3c5eca6f-aeb4-451b-9fa2-ed70d8bab9e9 | | name | Public | | provider:network_type | flat | | provider:physical_network | physnet1 | | provider:segmentation_id | | | shared | False | | status | ACTIVE | | subnets | | | tenant_id | 2cfb66b8a9524cc68c2e1bf424bda943 | +---------------------------+--------------------------------------+ [root@controller ~(keystone_admin)]# neutron subnet-create Public 192.168.3.0/24 --disable-dhcp --allocation-pool start=192.168.3.100,end=192.168.3.110 Created a new subnet: +------------------+----------------------------------------------------+ | Field | Value | +------------------+----------------------------------------------------+ | allocation_pools | {"start": "192.168.3.100", "end": "192.168.3.110"} | | cidr | 192.168.3.0/24 | | dns_nameservers | | | enable_dhcp | False | | gateway_ip | 192.168.3.1 | | host_routes | | | id | 8d089754-3764-4249-98f2-402f62a872bc | | ip_version | 4 | | name | | | network_id | 3c5eca6f-aeb4-451b-9fa2-ed70d8bab9e9 | | tenant_id | 2cfb66b8a9524cc68c2e1bf424bda943 | +------------------+----------------------------------------------------+
10、cinder配置 查詢部署的服務是否正常 [root@controller ~(keystone_admin)]# cinder-manage service list Binary Host Zone Status State Updated At cinder-volume controller nova enabled 2014-02-10 07:42:22 cinder-scheduler controller nova enabled 2014-02-10 07:42:30 [root@controller ~(keystone_admin)]# cinder-manage host list host zone controller nova
然后查詢論證是否成功 [root@controller ~(keystone_admin)]# lvdisplay --- Logical volume --- LV Path /dev/cinder-volumes/volume-0a9cc8fc-d3fd-4dd1-9501-9c3813056415 LV Name volume-0a9cc8fc-d3fd-4dd1-9501-9c3813056415 VG Name cinder-volumes LV UUID zbGuJa-3bdk-V6UZ-ZBsx-FWeA-dlys-qMphas LV Write Access read/write LV Creation host, time controller, 2014-02-10 15:46:44 +0800 LV Status available # open 1 LV Size 5.00 GiB Current LE 1280 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 4096 Block device 253:0
[root@controller ~(keystone_admin)]# cinder list +--------------------------------------+-----------+--------------+------+-------------+----------+-------------+ | ID | Status | Display Name | Size | Volume Type | Bootable | Attached to | +--------------------------------------+-----------+--------------+------+-------------+----------+-------------+ | 0a9cc8fc-d3fd-4dd1-9501-9c3813056415 | available | oak | 5 | SSD | false | | +--------------------------------------+-----------+--------------+------+-------------+----------+-------------+ [root@controller ~(keystone_admin)]#
此時,啟動一個instance 可以在云硬盤中,選擇掛載,掛載到相應的instance上。
二、compute node 配置 1、網絡,參考控制節點,其次檢查ntp,時間是否與控制節點同步 2、添加源和Openstack軟件環境都參考控制節點的前期準備 3、RDO應答文件,填寫了compute node IP后,一般nova-compute、openstack-neutron-openvswitch和MySQL-python都已經安裝 4、因為我的環境是Flat模式,所以此處neutron配置文件還需修改,然后創建相應的橋 修改neutron vi /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini [OVS] network_vlan_ranges=physnet1,physnet2:100:200 tenant_network_type=vlan enable_tunneling=False integration_bridge=br-int bridge_mappings=physnet1:br-ex,physnet2:br-eth2
創建橋 [root@compute neutron]# cd /etc/sysconfig/network-scripts/ [root@compute network-scripts]# more ifcfg-br-ex DEVICE=br-ex IPADDR=192.168.3.95 PREFIX=24 GATEWAY=192.168.3.1 DNS1=202.102.134.68 ONBOOT=yes [root@compute network-scripts]# more ifcfg-eth0 DEVICE=eth0 HWADDR=00:90:27:E0:61:14 #TYPE=Ethernet ONBOOT=yes #BOOTPROTO=none #IPADDR=192.168.3.95 #NETMASK=255.255.255.0 #GATEWAY=192.168.3.1 [root@compute network-scripts]# ovs-vsctl add-br br-ex [root@compute network-scripts]# ovs-vsctl add-port br-ex eth0; service network restart
[root@compute network-scripts]# ovs-vsctl show 3875869a-c249-4514-aadc-b95b92e7f304 Bridge br-ex Port br-ex Interface br-ex type: internal Port "eth0" Interface "eth0" Bridge br-int Port br-int Interface br-int type: internal ovs_version: "1.11.0"
5、cinder 配置 [root@compute ~]# umount /dev/sda4 [root@compute ~]# pvcreate /dev/sda4 Physical volume "/dev/sda4" successfully created [root@compute ~]# vgcreate cinder-volumes /dev/sda4 Volume group "cinder-volumes" successfully created
yum install openstack-cinder openstack-utils
vi /etc/cinder/api-paste.ini 參考拷貝控制節點內容 [filter:authtoken] paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory # signing_dir is configurable, but the default behavior of the authtoken # middleware should be sufficient. It will create a temporary directory # in the home directory for the user the cinder process is running as. #signing_dir = /var/lib/cinder/keystone-signing
admin_tenant_name=services auth_host=192.168.3.98 service_port=5000 auth_uri=http://192.168.3.98:5000/ auth_port=35357 service_host=192.168.3.98 service_protocol=http admin_user=cinder auth_protocol=http admin_password=570fe4a9f7bd4e2d
# openstack-config --set /etc/cinder/cinder.conf DEFAULT rpc_backend cinder.openstack.common.rpc.impl_qpid # openstack-config --set /etc/cinder/cinder.conf DEFAULT qpid_hostname 192.168.3.98
vi /etc/cinder/api-paste.ini 參考拷貝控制節點內容
sql_connection=mysql://cinder:0ba1a335f2834e1a@192.168.3.98/cinder qpid_reconnect_timeout=0 qpid_reconnect_limit=0 qpid_reconnect=True qpid_reconnect_interval_max=0 qpid_reconnect_interval_min=0 sql_idle_timeout=3600 qpid_reconnect_interval=0 notification_driver=cinder.openstack.common.notifier.rpc_notifier
vi /etc/tgt/targets.conf 增加如下內容
include /etc/cinder/volumes/*
# service openstack-cinder-volume start # service tgtd start # chkconfig openstack-cinder-volume on # chkconfig tgtd on
[root@controller ~(keystone_admin)]# cinder-manage service list Binary Host Zone Status State Updated At cinder-volume controller nova enabled 2014-02-11 06:31:08 cinder-scheduler controller nova enabled 2014-02-11 06:31:06 cinder-volume compute nova enabled 2014-02-11 06:30:40 [root@controller ~(keystone_admin)]#
以上是“openstack havana vlan如何安裝”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業資訊頻道!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。