distro mirrors

ubuntu

22.04

清华源

1
2
3
4
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse

20.04

清华源

1
2
3
4
5
6
7
8
9
10
11
12
13
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse

18.04

清华源

1
2
3
4
5
6
7
8
9
10
11
12
13
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

安装 Arch Linux

创建并挂载分区

  1. 查看硬盘
1
$ fdisk -l
  1. 使用 fdisk 创建分区表
1
2
3
$ fdisk /dev/sda
(fdisk) p # 打印分区信息
(fdisk) g # 创建 GPT 分区表

2.1 创建分区

创建 /boot 分区

1
2
3
4
(fdisk) n  # 创建分区
(fdisk) Partition number...: # 回车
(fdisk) First section...: # 回车
(fdisk) Last section...: +1G

创建 / 分区

1
2
3
4
(fdisk) n  # 创建分区
(fdisk) Partition number...: # 回车, 默认值
(fdisk) First section...: # 回车
(fdisk) Last section...: # 回车, 使用最大 section number

确认

1
(fdisk) p   # 重新打印分区,有新创建的两个分区

保存

1
(fdisk) w
  1. 格式化分区
1
2
$ mkfs.fat -F32 /dev/sda1   # 格式化 /boot 分区(假设为 /dev/sda1)
$ mkfs.ext4 /dev/sda2 # 格式化 / 分区(假设为 /dev/sda2)
  1. 挂载
1
2
3
$ mount /dev/sda2 /mnt       # 挂载根分区
$ mkdir /mnt/boot # 创建 boot 挂载点
$ mount /dev/sda1 /mnt/boot # 挂载 /boot 分区

安装

1
$ pacstrap -K /mnt base linux linux-firmware

配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# fstab
$ genfstab -U /mnt >> /mnt/etc/fstab

# Chroot
$ arch-chroot /mnt

# Time
$ ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
$ hwclock --systohc

# root passwd
$ passwd

# 安装 vim
$ pacman -S vim

# Localization
$ vim /etc/locale.conf # 写入如下内容
LANG=en_US.UTF-8

# hostname
$ vim /etc/hostname

Boot loader

1
2
3
4
5
6
7
# GRUB
$ pacman -S grub efibootmgr
$ grub-install --target=x86_64-efi --efi-directory=esp --bootloader-id=ArchLinux

## 配置 GRUB
$ grub-mkconfig -o /boot/grub/grub.cfg

重启

1
$ exit

Arch Linux 初始化

中文

1
2
3
4
5
6
7
8
# 修改文件 /etc/locale.gen
en_US.UTF-8 UTF-8
zh_CN.UTF-8 UTF-8
zh_CN.GBK GBK
zh_CN GB2312

# locale-gen
$ sudo locale-gen

zsh

1
2
3
# 文件 ~/.zshrc
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

网络设置

使用 systemd-networkd 管理网络

新增文件 /etc/systemd/network/20-wired.network,下面是静态 IP 配置示例。

1
2
3
4
5
6
7
[Match]
Name=enp1s0

[Network]
Address=192.168.6.2/24
Gateway=192.168.6.1
DNS=192.168.6.1

启动 systemd-networkd

1
2
$ systemctl enable systemd-networkd
$ systemctl start systemd-networkd

配置 SSH 远程登录

1
2
3
4
$ pacman -S openssh
$ vim /etc/ssh/sshd_config # 添加如下内容
PasswordAuthentication yes
PermitRootLogin yes # 允许 Root 用户远程登录(密钥、密码均可)

启动 sshd

1
2
systemctl enable sshd.service
systemctl start sshd.service

创建用户及用户组

1
2
$ groupadd -g 100 wii
$ useradd -m -d /home/wii -s /bin/zsh -g wii wii

普通用户获取超级管理员权限

1
2
3
4
$ pacman -S sudo
$ chmod 0600 /etc/sudoers
$ vim /etc/sudoers # 添加如下内容, 最好在文件最后
wii ALL=(ALL:ALL) NOPASSWD: ALL # wii 用户使用 sudo 获取所有权限,且不需要密码

必备

1
2
3
$ pacman -S sudo git curl wget zip unzip base-devel
# C++ 开发
$ pacman -S gdb cmake ninja texinfo

centos 初始化

配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 关闭 selinux
$ sudo vim /etc/selinux/config
SELINUX=enforcing -> SELINUX=disabled
$ sudo setenforce 0

# 关闭 swap
$ sudo vim /etc/fstab
注释掉行 /dev/mapper/centos-swap

# 关闭防火墙
$ systemctl stop firewalld
$ systemctl disable firewalld

# 设置 DNS
# centos 8
$ vim /etc/resolve.conf
nameserver 192.168.6.1 # 或其他

开启 EPEL repository

1
sudo yum -y install epel-release

centos network

DNS

1
2
3
# centos 8
$ vim /etc/resolve.conf
nameserver 192.168.6.1 # 或其他

resolveconf

1

修改网络配置

1
2
3
4
5
6
7
8
9
10
11
12
13
# 文件
$ vi /etc/sysconfig/network-scripts/ifcfg-[network_device_name]

# 配置
ONBOOT=yes
BOOTPROTO=dhcp
GATEWAY=...
DNS1=...
DNS2=...

# 重启网络
$ systemctl restart network
$ systemctl restart NetworkManager # centos 8

sudo 权限无需密码

1
2
3
$ sudo visudo
# 添加如下内容,替换掉下面的用户名
<username> ALL=(ALL) NOPASSWD:ALL

ubuntu cloud

初始化

使用 cloud init 初始化时,在实例启动后,可能需要等一小会,才能生效。

1
2
3
4
5
6
#cloud-config
chpasswd:
list: |
ubuntu:ubuntu
wii:wii
expire: False

sudo 命令较慢

1
2
sudo vim /etc/hosts
# 在 127.0.0.1 后面追加 hostname

开启 ssh 密码登录

1
2
3
$ sudo vi /etc/ssh/sshd_config
PasswordAuthentication yes
$ sudo service ssh restart # 重启 ssh server

设置时区

1
2
sudo dpkg-reconfigure tzdata
# 选择 Asia -> Shanghai

设置 DNS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
sudo vim /etc/netplan/50_cloud_init.yaml

# 添加 nameserver
network:
version: 2
ethernets:
ens3:
dhcp4: true
match:
macaddress: fa:16:3e:6c:21:ff
mtu: 1450
set-name: ens3
nameservers:
addresses: [223.5.5.5, 223.6.6.6]

配置更新源

sudo vim /etc/apt/sources.list

20.04

aliyun

1
2
3
4
5
6
7
8
9
10
11
12
13
14
deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

# deb https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

openstack images

镜像下载

Openstack 官方镜像文档

  • 优先下载 img 镜像,导入时类型选择 qcow2

ubuntu

对于 ubuntu cloud 的初始化文档参考这里,对于 cloud init 参考这里 还有这里

配置账号密码

1
2
3
4
5
#cloud-config
chpasswd:
list: |
ubuntu:ubuntu
expire: False
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#cloud-config
groups:
- ubuntu: [root,sys]
- cloud-users
users:
- default
- name: ubuntu
gecos: ubuntu
sudo: ALL=(ALL) NOPASSWD:ALL
primary_group: ubuntu
groups: users
lock_passwd: false
# ubuntu
hashed_passwd: $6$rounds=4096$F/colBvEPXvBa$cz4/dBg7R/jGVVPoAzQi/vydQ3H3h.iXIVDJrXczbDfXy/nGIHyaFA14Ee7e0pSJfWJNMlJGvwo4Kpi6NXFf00

使用如下命令生成加密密码。

1
2
3
# mkpasswd --method=SHA-512 --rounds=4096
Password:
$6$rounds=4096$F/colBvEPXvBa$cz4/dBg7R/jGVVPoAzQi/vydQ3H3h.iXIVDJrXczbDfXy/nGIHyaFA14Ee7e0pSJfWJNMlJGvwo4Kpi6NXFf00

numpy

array

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 一维
>>> np.array([1, 2, 3])
array([1, 2, 3])

# 多维
>>> np.array([[1, 2, 3]], dtype=np.float32)
array([[1., 2., 3.]], dtype=float32)

# df: np.array
# head 数据
df[:3]

# 基于其他列创建新列
def trans(row):
return row['old']
df['new'] = df.apply(trans, axis=1) # axis=0 行; axis=1 列
df['Label'] = pd.Series(data=df.apply(trans, axis=1), dtype='int')
df.concat(pd.Series(data=df.apply(trans, axis=1))

# 选取行
df[:3] # 前三行

# 选取列
df[:, 0] # 选取第一列

# 选取行和列
df[:3, 0] # 选取前三行第一列

mariadb 常见问题

too many connections

客户端报错 too many connections,问题修复参考这里.

查看当前连接数限制

1
2
3
4
5
6
7
$ mysql -u root -p
> show variables like "max_connections";
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 214 |
+-----------------+-------+

临时配置

1
> set GLOBAL max_connections=1024;

永久配置

1
2
3
4
5
6
7
8
9
10
11
12
# step 1: 修改数据库最大连接数
# vim /etc/my.cnf
[mysqld]
# ...
max_connections=1024

# step 2: 修改 mariadb 默认打开文件数限制
# vim /usr/lib/systemd/system/mariadb.service
[Service]
# ...
LimitNOFILE=10000
LimitNPROC=10000

openstack

安装

安装教程仅供个人学习用,请谨慎用于生产环境。对于 Ubuntu 安装 openstack,推荐按照官网指引操作,这里 是一个不错的辅助。

环境检查

打开安装指引,在 Environment 章节下方,有 OpenStack packages 连接,在下方有不同 linux 发行版的 package 说明,比如 centos,里面有对发行版版本的要求说明,这里 有所有的 openstack 版本。比如,centos 7 只能安装 Ussuri 之前的版本,即 Train 及之前。

此外其他配置也要进行,比如 mariadb、rabbitmq、memcached、etcd。

环境准备

以 centos 7 + openstack train 为例。这里 是 train 的发布页,这里 是安装引导页面,里面有 train 的安装指引连接 Minimal deployment for Train,以最小安装为例,先安装 Identity Service 服务,点击去之后会有常用发行版的安装教程,点击 centos 的 Install and configure,在上方会有 note,提示先进行 Openstack Install Guide 的先决条件安装步骤。

1
2
3
4
5
6
# 不要忘了安装 openstack client
$ yum install python-openstackclient

# 使用 pip 安装 openstack client
$ yum install python-devel python-pip
$ pip install python-openstackclient

安装仓库

如果我们直接使用命令安装,会报错。

1
2
3
4
5
6
7
8
9
$ yum install openstack-keystone -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.bupt.edu.cn
* epel: mirrors.bfsu.edu.cn
* extras: mirrors.bupt.edu.cn
* updates: mirrors.bupt.edu.cn
No package openstack-keystone available.
Error: Nothing to do

搜下仓库。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$ yum search openstack
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.bupt.edu.cn
* epel: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.bupt.edu.cn
* updates: mirrors.bupt.edu.cn
============================================ N/S matched: openstack ============================================
ansible-openstack-modules.noarch : Unofficial Ansible modules for managing Openstack
centos-release-openstack-queens.noarch : OpenStack from the CentOS Cloud SIG repo configs
centos-release-openstack-rocky.noarch : OpenStack from the CentOS Cloud SIG repo configs
centos-release-openstack-stein.noarch : OpenStack from the CentOS Cloud SIG repo configs
centos-release-openstack-train.noarch : OpenStack from the CentOS Cloud SIG repo configs
diskimage-builder.noarch : Image building tools for OpenStack
golang-github-rackspace-gophercloud-devel.noarch : The Go SDK for Openstack http://gophercloud.io
php-opencloud.noarch : PHP SDK for OpenStack/Rackspace APIs
php-opencloud-doc.noarch : Documentation for PHP SDK for OpenStack/Rackspace APIs
python2-oslo-sphinx.noarch : OpenStack Sphinx Extensions and Theme for Python 2

Name and summary matches only, use "search all" for everything.

我们安装 train 对应的 noarch。

1
$ yum install centos-release-openstack-train.noarch

继续下面的流程。

安装 keystone

1
2
3
4
5
6
7
8
# 先创建用户 keystone
$ useradd -g keystone keystone

# 安装 glance 之前,创建 domain、project
# 创建 domain
$ openstack domain create --description "Default Domain" default
# 创建 project
$ openstack project create --domain default --description "Service Project" service

按教程安装到最后,会有如下内容。

1
2
3
4
5
6
7
export OS_USERNAME=admin
export OS_PASSWORD=ADMIN_PASS
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_AUTH_URL=http://controller:5000/v3
export OS_IDENTITY_API_VERSION=3

修改 ADMIN_PASS 之后,保存到文件 admin-openrc,后面会用到。

安装指引有创建 domain、project、user、role 的教程,后续安装尽量不要使用新创建的项目,使用默认即可。

项目
domain / domain_id default
domain_name Default
project service

安装 glance

1
# 第二步有个 source admin-openrc,即为安装 keystone 时最后给出的内容

安装 placement

验证

验证时如果出现 Expecting value: line 1 column 1 (char 0) ,可以参考这篇文章

安装 horizon

如果访问 http://controller/dashboard 提示 404,在配置 local_settings 时添加如下内容。

1
WEBROOT = '/dashboard'

创建实例

先决条件

  • 创建镜像
  • 创建实例类型
  • 创建网络
    • 选 vxlan

LVM

对磁盘创建 lvm。

1
2
3
4
5
6
7
8
9
10
11
# 创建
$ pvcreate /dev/sda
$ vgcreate cinder-volumes /dev/sda

# 删除
## 移除卷
$ lvremove cinder--volumes-cinder--volumes--pool_tmeta
## 删除组
$ vgremove cinder-volumes
## 删除物理卷
$ pvremove /dev/sda

如果出现 pvcreate 时出现 execlude by a filter,检查 /etc/lvm/lvm.conf 下的 filters

1
filter = [ "a/sda/", "a/nvme/", "r/.*/" ]

如果想要接受一个块设备,使用类似下面的配置。

1
"a|.*|"

如果想要拒绝一个块设备,使用类似下面的配置。

1
"r|/dev/cdrom|"

Ubuntu 安装

参考安装指南,下面是在单机安装,IP 为 192.168.6.55

版本信息

软件/系统 版本
Ubuntu 22.04.2
Openstack antelope

安装依赖

1
# apt install apache2 libapache2-mod-uwsgi tgt 

环境配置

Hosts

1
2
3
# vim /etc/hosts
## 添加如下内容, 注意替换 ip
192.168.6.55 controller

安装仓库

参考这里,选择一个版本即可,比如。

1
2
3
# add-apt-repository cloud-archive:antelope
# apt install nova-compute
# apt install python3-openstackclient

SQL Database

1
# apt install mariadb-server python3-pymysql

配置

1
2
3
4
5
6
7
8
9
10
# vim /etc/mysql/mariadb.conf.d/99-openstack.cnf
## 添加如下内容
[mysqld]
bind-address = 192.168.6.55

default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8

bind-address 为 Controller Node 的 ip

重启服务

1
# service mysql restart

初始化 mariadb

1
# mysql_secure_installation

Message Queue

注意

  • 替换掉命令中的 RABBIT_PASS
1
2
3
# apt install rabbitmq-server
# rabbitmqctl add_user openstack RABBIT_PASS
# rabbitmqctl set_permissions openstack ".*" ".*" ".*"

Memcached

1
2
3
4
# apt install memcached python3-memcache
# vim /etc/memcached.conf
## 将 -l 127.0.0.1 替换为 Controller 的 ip
-l 192.168.6.55

Etcd

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# apt install etcd
# vim /etc/default/etcd
## 参考如下内容修改
ETCD_NAME="controller"
ETCD_DATA_DIR="/var/lib/etcd"
ETCD_INITIAL_CLUSTER_STATE="new"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01"
ETCD_INITIAL_CLUSTER="controller=http://192.168.6.55:2380"
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.6.55:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://192.168.6.55:2379"
ETCD_LISTEN_PEER_URLS="http://0.0.0.0:2380"
ETCD_LISTEN_CLIENT_URLS="http://192.168.6.55:2379"
# systemctl enable etcd
# systemctl restart etcd

安装 Openstack 服务

参考这里,我们选择最小部署。

Identity service

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# mysql
MariaDB [(none)]> CREATE DATABASE keystone;
## 注意替换掉下面的 KEYSTONE_DBPASS
MariaDB [(none)]> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' \
IDENTIFIED BY 'KEYSTONE_DBPASS';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' \
IDENTIFIED BY 'KEYSTONE_DBPASS';
MariaDB [(none)]> exit

# apt install keystone
# vim /etc/keystone/keystone.conf
## 修改如下内容, 注意替换 KEYSTONE_DBPASS
[database]
# ...
connection = mysql+pymysql://keystone:KEYSTONE_DBPASS@controller/keystone
[token]
# ...
provider = fernet

# su -s /bin/sh -c "keystone-manage db_sync" keystone
# keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
# keystone-manage credential_setup --keystone-user keystone --keystone-group keystone
# keystone-manage bootstrap --bootstrap-password ADMIN_PASS \
--bootstrap-admin-url http://controller:5000/v3/ \
--bootstrap-internal-url http://controller:5000/v3/ \
--bootstrap-public-url http://controller:5000/v3/ \
--bootstrap-region-id RegionOne
# vim /etc/apache2/apache2.conf
## 添加如下内容
ServerName controller

## 环境变量中添加如下内容
$ export OS_USERNAME=admin, 注意替换 ADMIN_PASS
$ export OS_PASSWORD=ADMIN_PASS
$ export OS_PROJECT_NAME=admin
$ export OS_USER_DOMAIN_NAME=Default
$ export OS_PROJECT_DOMAIN_NAME=Default
$ export OS_AUTH_URL=http://controller:5000/v3
$ export OS_IDENTITY_API_VERSION=3

Glance

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# mysql
## 注意修改 GLANCE_DBPASS
MariaDB [(none)]> CREATE DATABASE glance;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' \
IDENTIFIED BY 'GLANCE_DBPASS';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' \
IDENTIFIED BY 'GLANCE_DBPASS';
MariaDB [(none)]> exit
## 注意保持上面设置的环境变量
$ openstack user create --domain default --password-prompt glance
$ openstack role add --project service --user glance admin
$ openstack service create --name glance \
--description "OpenStack Image" image
$ openstack endpoint create --region RegionOne \
image public http://controller:9292
# apt install glance

Placement

Compute

注意

  • nova.confauth_url 填写 http://controller:5000/v3

Networking

Dashboard

Block Storage

其他配置

tgt 配置

1
2
3
$ vim /etc/tgt/targets.conf
# 添加如下内容
include /var/lib/cinder/volumes/*