kolla openstack nova GPU 实现

这篇博客主要介绍了如何利用Kolla部署OpenStack Nova服务,并实现对GPU的支持。通过学习链接提供的资源,读者可以了解详细的步骤和配置方法。
摘要由CSDN通过智能技术生成
###本环境为物理机
controller                eth0,eth1
compute01                 eth0
compute02 (带P40 gpu卡)  eth0


eth0: 管理网段,可上网,下载安装包(nat模式)
eth1: provider网卡,(桥接模式),up with no ip


------------+---------------------------+---------------------------+----------------------
            |                           |                           |                               
        eth0|192.168.200.151        eth0|192.168.200.152        eth0|192.168.200.153          
            |                           |                           |
+-----------+------------+  +-----------+------------+  +-----------+------------+        
|    controller          |  |     compute01          |  |      compute02(GPU  )  |           
|                        |  |                        |  |                        |
|                        |  |                        |  |                        |
|                        |  |                        |  |                        |
+-----------++-----------+  +-----------+------------+  +-----------+------------+
            ||
            ||
        eth1 up with no ip
            ||



===========系统初始化(每个节点)

###1.下载基础工具
yum install -y vim wget net-tools telnet bash-completion.noarch  epel-release   yum-utils  rsync  chrony


###2.关闭fw
systemctl stop firewalld  && systemctl disable firewalld
sed -ri 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
setenforce 0	


###3.更改上海时间
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime


###4. 安装docker

yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install docker-ce -y
systemctl start docker && systemctl enable  docker

mkdir -p /etc/systemd/system/docker.service.d/
tee /etc/systemd/system/docker.service.d/kolla.conf << 'EOF'
[Service]
MountFlags=shared
EOF

cat << EOF > /etc/docker/daemon.json
{
   
  "registry-mirrors": ["https://6u0i88u7.mirror.aliyuncs.com"]
}

EOF

systemctl daemon-reload  && systemctl restart docker




#####安装依赖
yum -y install epel-release
yum -y install python-pip
yum -y install python-devel libffi-devel gcc openssl-devel libselinux-python


####pip源

for line in `cat /etc/hosts  | sed 1,2d  | awk '{print $2}' `
do
echo $line
ssh $line "mkdir ~/.pip"
ssh $line "cat << EOF > ~/.pip/pip.conf
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple/
[install]
trusted-host=pypi.tuna.tsinghua.edu.cn
EOF"
done






#####kolla-controller 免密和ansible

ssh-copy-id -i  kolla-compute01/02



[root@kolla-controller ~]# pip install ansible
[root@kolla-controller ~]# pip --version
pip 20.2.3 from /usr/lib/python2.7/site-packages/pip (python 2.7)



[root@kolla-controller ~]# pip --version
pip 20.2.3 from /usr/lib/python2.7/site-packages/pip (python 2.7)
[root@kolla-controller ~]# ansible --version
/usr/lib/python2.7/site-packages/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
  from cryptography.exceptions import InvalidSignature
ansible 2.10.2
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Apr  2 2020, 13:16:51) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]


[root@kolla-controller ~]#  pip install kolla-ansible==9.0.1 --ignore-installed PyYAML


[root@kolla-controller ~]#  cp -r /usr/share/kolla-ansible/etc_examples/kolla /etc/
[root@kolla-controller~]#  cp /usr/share/kolla-ansible/ansible/inventory/* /etc/kolla/
[root@kolla-controller ~]#   ls /etc/kolla/
all-in-one  globals.yml  multinode  passwords.yml





######controller 节点上也部署cinder-volume

[root@kolla-controller ~]# pvs
  PV         VG             Fmt  Attr PSize    PFree  
  /dev/sda2  centos         lvm2 a--   854.00g      0 
  /dev/sdb1  cinder-volumes lvm2 a--  <931.51g  46.35g
  /dev/sdc1                 lvm2 ---   800.00g 800.00g
[root@kolla-controller ~]# vgs
  VG             #PV #LV #SN Attr   VSize    VFree 
  centos           1   3   0 wz--n-  854.00g     0 
  cinder-volumes   1   2   0 wz--n- <931.51g 46.35g





#######配置multi

[root@kolla-controller ~]# more /etc/kolla/multinode 
# These initial groups are the only groups required to be modified. The
# additional groups are for more control of the environment.
[control]
# These hostname must be resolvable from your deployment host
kolla-controller
# The above can also be specified as follows:
#control[01:03]     ansible_user=kolla

# The network nodes are where your l3-agent and loadbalancers will run
# This can be the same as a host in the control group
[network]
kolla-controller


[compute]
kolla-compute01
kolla-compute02
[monitoring]
kolla-controller

# When compute nodes and control nodes use different interfaces,
# you need to comment out "api_interface" and other interfaces from the globals.yml
# and specify like below:
#compute01 neutron_external_interface=eth0 api_interface=em1 storage_interface=em1 tunnel_interface=em1


[storage]
kolla-controller

[deployment]
#localhost       ansible_connection=local
kolla-controller


#######部署 (可参考我那kolla-ceph集群部署步骤,这大致写下)

####1.修改OpenStack各服务的密码
[root@kolla-controller ~]#  kolla-genpwd
vim /etc/kolla/passwords.yml

keystone_admin_password: admin.123     修改


####2. 编辑global.yml
 vim /etc/kolla/globals.yml


//第14行和第15行,选择下载的基础镜像,5选1
# Valid options are ['centos', 'debian', 'oraclelinux', 'rhel', 'ubuntu']
kolla_base_distro: "centos"
  
//第17行和第18行,选择的安装方法,2选1。binary二进制安装,source源码安装
# Valid options are [ binary, source ]
kolla_install_type: "source"
  
//第20行和第21行,选择OpenStack的版本标签,详细请看:https://releases.openstack.org/
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值