目錄html
我這裏用workstation
建立了一個虛擬機,安裝centos7.5 mini
系統,這臺虛擬機上有兩張網卡,一張作openstack管理網,一張作爲虛擬機的業務網卡。
我用來測試的VM配置是4C,8G,100G
若是想運行ubuntu cloud images的話最好是8C,16G,100G的配置,固然~~若是你用cirros的話那就隨意咯!
基本信息以下python
<table><tr><td bgcolor=orange> 背景色是 1 orange</td></tr></table> [root@queens ~]# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core) [root@queens ~]# uname -r 3.10.0-862.el7.x86_64 [root@queens ~]# egrep '(vmx|svm)' /proc/cpuinfo flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch tpr_shadow vnmi ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 invpcid rtm rdseed adx smap xsaveopt ibpb ibrs stibp arat spec_ctrl intel_stibp arch_capabilities flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch tpr_shadow vnmi ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 invpcid rtm rdseed adx smap xsaveopt ibpb ibrs stibp arat spec_ctrl intel_stibp arch_capabilities flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch tpr_shadow vnmi ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 invpcid rtm rdseed adx smap xsaveopt ibpb ibrs stibp arat spec_ctrl intel_stibp arch_capabilities flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch tpr_shadow vnmi ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 invpcid rtm rdseed adx smap xsaveopt ibpb ibrs stibp arat spec_ctrl intel_stibp arch_capabilities [root@queens ~]# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:50:56:87:a6:a5 brd ff:ff:ff:ff:ff:ff inet 192.168.6.50/24 brd 192.168.6.255 scope global ens192 valid_lft forever preferred_lft forever inet6 fe80::250:56ff:fe87:a6a5/64 scope link valid_lft forever preferred_lft forever 3: ens224: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master ovs-system state UP group default qlen 1000 link/ether 00:50:56:87:7f:15 brd ff:ff:ff:ff:ff:ff inet6 fe80::250:56ff:fe87:7f15/64 scope link valid_lft forever preferred_lft forever
ens192網卡配置了IP地址,ens224什麼都沒有配置linux
[root@queens ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens192 TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=static IPADDR=192.168.6.53 PREFIX=24 GATEWAY=192.168.6.1 DNS1=114.114.114.114 DEFROUTE=yes IPV4_FAILURE_FATAL=no NAME=ens192 UUID=8dd201c9-3c8e-4a01-824c-37f84d6814dd DEVICE=ens192 ONBOOT=yes [root@queens ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens224 TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=dhcp DEFROUTE=yes IPV4_FAILURE_FATAL=no NAME=ens224 DEVICE=ens224 ONBOOT=yes
echo queens > /etc/hostname ipa="$(ip a show ens192 | grep ens192 | grep global | awk '{print $2}' | awk -F/ '{print $1}')" echo -e "$ipa\tqueens" >> /etc/hosts systemctl stop NetworkManager systemctl disable NetworkManager systemctl stop firewalld systemctl disable firewalld sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config setenforce 0 getenforce yum install -y epel-release yum install -y ansible axel vim git curl wget lrzsz gcc python-devel python-pip docker-ce yum install -y iperf sysstat nload net-tools dstat blktrace fio tcpdump ltrace lsof iptraf lshw cpuid numactl mdadm lsscsi sysbench mtr vnstat collectl iftop trafshow nethogs man strace perf iotop atop hping3 systemtap nmon htop bwm-ng glances usbutils pciutils util-linux-ng smartmontools #這個是一些經常使用軟件,徹底不用安裝,我的習慣而已 reboot
重啓完成後,繼續配置git
wget -O /etc/yum.repos.d/docker-ce.repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo pip install --upgrade pip mkdir /etc/systemd/system/docker.service.d tee /etc/systemd/system/docker.service.d/kolla.conf << 'EOF' [Service] MountFlags=shared EOF sed -i '13d' /usr/lib/systemd/system/docker.service sed -i '12a ExecStart=/usr/bin/dockerd --registry-mirror=https://ebu037tr.mirror.aliyuncs.com --storage-driver=overlay2 ' /usr/lib/systemd/system/docker.service systemctl daemon-reload systemctl restart docker systemctl enable docker systemctl status docker docker info git clone https://github.com/openstack/kolla-ansible -b stable/queens cd kolla-ansible/ cp -r etc/kolla/ /etc/kolla/ pip install . -i https://pypi.tuna.tsinghua.edu.cn/simple kolla-genpwd sed -i '/keystone_admin_password:/c\keystone_admin_password: password' /etc/kolla/passwords.yml cat /etc/kolla/passwords.yml | grep keystone_admin_password cp /etc/kolla/globals.yml /etc/kolla/globals.yml.bak ipa="$(ip a show ens192 | grep ens192 | grep global | awk '{print $2}' | awk -F/ '{print $1}')" sed -i '/kolla_base_distro:/c\kolla_base_distro: "centos"' /etc/kolla/globals.yml sed -i '/kolla_install_type:/c\kolla_install_type: "source"' /etc/kolla/globals.yml sed -i '/openstack_release:/c\openstack_release: "queens"' /etc/kolla/globals.yml sed -i '/docker_namespace:/c\docker_namespace: "kolla"' /etc/kolla/globals.yml sed -i '/network_interface:/c\network_interface: "ens192"' /etc/kolla/globals.yml sed -i '/neutron_external_interface:/c\neutron_external_interface: "ens224"' /etc/kolla/globals.yml sed -i '/enable_haproxy:/c\enable_haproxy: "no"' /etc/kolla/globals.yml sed -i '/nova_compute_virt_type:/c\nova_compute_virt_type: "qemu"' /etc/kolla/globals.yml sed -i "s/\(^kolla_internal_vip_address:\).*/\1 \"${ipa}\"/" /etc/kolla/globals.yml
配置完以後檢查下github
[root@queens ~]# egrep "^[^#]" /etc/kolla/globals.yml --- kolla_base_distro: "centos" kolla_install_type: "source" openstack_release: "queens" kolla_internal_vip_address: "192.168.6.50" docker_namespace: "kolla" network_interface: "ens192" neutron_external_interface: "ens224" enable_haproxy: "no" nova_compute_virt_type: "qemu" ironic_dnsmasq_dhcp_range: tempest_image_id: tempest_flavor_ref_id: tempest_public_network_id: tempest_floating_network_name:
必定記得給虛機作個快照,必定記得給虛機作個快照,必定記得給虛機作個快照。docker
kolla-ansible prechecks kolla-ansible pull kolla-ansible deploy kolla-ansible post-deploy pip install --ignore-installed ipaddress PyYAML pip install python-openstackclient
[option]可選執行 若是安裝python-openstackclient出現錯誤能夠臨時指定pip源來從新執行python-openstackclient的安裝,能夠試下下面的命令 pip install -i https://pypi.mirrors.ustc.edu.cn/simple/ python-openstackclient pip install -i https://pypi.tuna.tsinghua.edu.cn/simple python-openstackclient
[option]可選執行 若是想安裝其餘的client,請執行如下命令 pip install python-PROJECTclient 請把PROJECT換成cinder或者glance等等等等等等 barbican - Key Manager Service API ceilometer - Telemetry API cinder - Block Storage API and extensions cloudkitty - Rating service API designate - DNS service API fuel - Deployment service API glance - Image service API gnocchi - Telemetry API v3 heat - Orchestration API magnum - Container Infrastructure Management service API manila - Shared file systems API mistral - Workflow service API monasca - Monitoring API murano - Application catalog API neutron - Networking API nova - Compute API and extensions senlin - Clustering service API swift - Object Storage API trove - Database service API
sed -i.bak "s@\(^EXT_NET_CIDR=\).*@\1='10.10.20.0/24'@g" /usr/share/kolla-ansible/init-runonce sed -i.bak "s@\(^EXT_NET_RANGE=\).*@\1='start=10.10.20.110,end=10.10.20.254'@g" /usr/share/kolla-ansible/init-runonce sed -i.bak "s@\(^EXT_NET_GATEWAY=\).*@\1='10.10.20.1'@g" /usr/share/kolla-ansible/init-runonce
[root@queens ~]# cat /usr/share/kolla-ansible/init-runonce | grep ^EXT_NET EXT_NET_CIDR='10.10.20.0/24' EXT_NET_RANGE='start=10.10.20.110,end=10.10.20.254' EXT_NET_GATEWAY='10.10.20.1'
source /etc/kolla/admin-openrc.sh cd /usr/share/kolla-ansible/ && ./init-runonce
因爲錯誤的出現,可能須要屢次的部署,而有些錯誤從新部署是不會進行修正的,因此須要將整個環境進行清理:ubuntu
tools/cleanup-containers #可用於從系統中移除部署的容器 tools/cleanup-host #可用於移除因爲殘餘網絡變化引起的docker啓動的neutron-agents主機 tools/cleanup-images #可用於從本地緩存中移除全部的docker image
此時就能夠訪問本身的IP地址了
使用瀏覽器訪問Dashboard
,我這裏地址就是192.168.6.50
用戶名爲admin
密碼爲password
1.登陸以後須要本身建立實例類型
2.本身建立網絡
、子網
、路由器
3.導入鏡像
能夠參考https://www.cnblogs.com/tcicy/p/10306306.html
4.建立實例
目前還有個問題,就是我還不知道怎麼給虛擬機分配浮動IP地址
,沒有浮動IP地址
的話就沒有辦法讓外部網絡設備直接訪問ubuntu cloud images instance 18.04.
不過通過這個過程,已經搭建完成OpenStack,比起之前的版原本說那但是至關的簡單簡潔了。
後面開始大家的表演。
若是有問題能夠直接網站內消息
或者tcicy#126.com
順便說下Markdown
真香
swift