#!/bin/bash set -x #配置aliyun的centos和epel mirror mkdir /etc/yum.repos.d.backup mv /etc/yum.repos.d/* /etc/yum.repos.d.backup curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo #我測時候aliyuncs這個url不通,因此去掉 sed -i '/ http/d' /etc/yum.repos.d/CentOS-Base.repo yum clean all yum makecache #配置ali的pypi mkdir ~/.pip && touch pip.conf cat > ~/.pip/pip.conf << EOF [global] index-url = https://mirrors.aliyun.com/pypi/simple/ [install] trusted-host=mirrors.aliyun.com EOF #建立部署目錄 mkdir /opt/stack cd /opt/stack #clone devstack代碼 yum install git -y git clone https://github.com/openstack-dev/devstack.git cd devstack #建立部署用戶 bash tools/create-stack-user.sh #準備local.conf文件,文件內容是部署變量的配置,默認便可 #stackrc中定義的變量能夠在此文件中賦值 cp ./samples/local.conf . #使用國內的trystack下載OpenStack源碼,提高速度 cat >> local.conf << EOF # Use trystack git mirror GIT_BASE=http://git.trystack.cn NOVNC_REPO=http://git.trystack.cn/kanaka/noVNC.git SPICE_REPO=http://git.trystack.cn/git/spice/spice-html5.git EOF
./stack.sh
訪問 http://iphtml
admin用戶密碼在local.conf中指定html5
參考:linux
https://docs.openstack.org/devstack/latest/guides/single-vm.htmlgit
https://mp.weixin.qq.com/s/A9ZJtBRpBGFh_LuZEemOGggithub
http://blog.51cto.com/wzlinux/1969781centos
pip install --upgrade setuptools
pip install --upgrade six
# rm -rf /var/lib/rabbitmq/mnesia/* # systemctl start rabbitmq-server
sudo yum remove qemu-system-x86
sudo systemctl restart libvirtd
#查看qemu版本
sudo virsh -c qemu:///system version --daemon