当前位置:   article > 正文

openstack多节点部署运维

openstack的部署方式有哪些?具体介绍一下多节点部署

一、packstack单点部署

1、配置虚拟机NAT网络连接

查看vmware的NAT网络默认配置

vmwarestation软件点击 上方“编辑”,选择“虚拟网络编辑器”
找到vmnet10,是NAT模式,子网地址是172.25.2.0,子网掩码是:255.255.255.0.
再点击“NAT设置”,可看到它的网关:172.25.2.2

配置当前虚拟机的网络配置

vmwarestation软件点击 上方“虚拟机”,选择“设置”;
首先没有NAT网卡的,点击“添加”,添加一个新的网络适配器。
已经创建号NAT网卡的,进行如下配置:
网络连接模式改为:"自定义(U):特定虚拟网络"
在下拉选项中,选中“VMnet10(NAT模式)”

配置linux网络
  1. # 进入网络配置目录
  2. cd /etc/sysconfig/network-scripts
  3. # 编辑nat网卡的配置
  4. vi ifcfg-ens33
  5. # 修改或添加如下信息:
  6. BOOTPROTO=static
  7. ONBOOT=yes
  8. IPADDR=172.25.2.101
  9. NETMASK=255.255.255.0
  10. GATEWAY=172.25.2.2
  11. DNS=8.8.8.8
  12. # 在vi编辑器中,输入:wq进行保存退出
  13. vi /etc/resolv.conf
  14. 加入:
  15. nameserver 8.8.8.8
  16. 输入:wq进行保存退出
  17. # 关闭防火墙
  18. systemctl stop firewalld.service
  19. systemctl disable firewalld.service
  20. # 重启网络
  21. systemctl restart network
  22. # 测试
  23. ping www.baidu.com

2、yum源配置

  1. # 关闭网络管理
  2. systemctl disable NetworkManager
  3. # 关闭selinux,修改文件为disabled
  4. sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
  5. # selinux修改生效
  6. setenforce 0
  7. ##################################更新yum源#################################
  8. # 将官方的yum源备份到一个新目录:
  9. mkdir /etc/yum.repos.d/repo.bak/
  10. mv /etc/yum.repos.d/*.repo repo.bak/
  11. # 更新下载阿里源
  12. curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  13. # 清理yum
  14. yum clean all
  15. yum makecache
  16. # 更新yum信息
  17. yum update -y
  18. # 查看当前存在的openstack版本安装源
  19. yum list | grep openstack
  20. # 安装安装源
  21. yum install -y centos-release-openstack-queens
  22. # 调整仓库配置文件
  23. vi /etc/yum.repos.d/CentOS-QEMU-EV.repo
  24. # 将文件中/$contentdir/改为/centos-7/
  25. # 添加epel-repo源
  26. curl -o /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
  27. # 添加openstack.queens.repo文件信息
  28. cat > /etc/yum.repos.d/openstack-queens.repo << EOF
  29. [queens]
  30. name=queens
  31. baseurl=https://mirrors.aliyun.com/centos/7/cloud/x86_64/openstack-queens/
  32. enabled=1
  33. gpgcheck=0
  34. EOF
  35. # 调整repo文件只保留
  36. CentOS-Base.repo CentOS-QEMU-EV.repo epel-7.repo openstack-queens.repo
  37. # 更新源
  38. yum clean all && yum makecache
  39. # 安装openstack-packstack软件包
  40. yum install -y openstack-packstack
  41. # 安装预备
  42. yum -y install python-pip
  43. # 一键部署openstack
  44. packstack --allinone
  45. # 1.出现error while loading shared libraries: leatherman_curl.so.1.3.0: cannot open shared object file: No such file or directory报错。
  46. # 这种错误是因为,leatherman rpm包版本问题,现有是1.10,实际需要1.3
  47. # 回退leatherman版本
  48. yum downgrade leatherman
  49. yum list | grep leatherman
  50. leatherman.x86_64 1.3.0-9.el7 @queens
  51. leatherman.x86_64 1.10.0-1.el7 epel
  52. leatherman-devel.x86_64 1.10.0-1.el7 epel

二、国赛双节点部署

1、准备虚拟机

创建虚拟机前,创建好vmnet2(仅主机模式),vmnet10(NAT模式)网卡,检查对应的适配器是否创建成功。
准备两台vmware虚拟机,手动最小化安装2台Centos7.2系统,第一个网卡为仅主机模式,第二个网卡为NAT模式,配置CPU虚拟机,4G以上内存,50G以上硬盘。

master节点网卡:

TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eno16777736
UUID=f34abd2e-89c9-4daf-a28c-54765164d59d
DEVICE=eno16777736
ONBOOT=yes
IPADDR=192.168.16.10
NETMASK=255.255.255.0

Node节点网卡:

TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eno16777736
UUID=8bbcc106-d60f-48cc-aafd-2bde0154fa2e
DEVICE=eno16777736
ONBOOT=yes
IPADDR=192.168.16.20
NETMASK=255.255.255.0

2、镜像挂载

镜像上传到master节点,然后完成挂载即可。

  1. # 挂载linux镜像
  2. cd /root/;
  3. mount -o loop CentOS-7-x86_64-DVD-1511.iso /mnt/;
  4. mkdir /opt/centos7.2;
  5. cp -rvf /mnt/* /opt/centos7.2/
  6. umount /mnt/;
  7. # 挂载iaas镜像
  8. cd /root/;
  9. mount -o loop XianDian-IaaS-v2.2.iso /mnt/;
  10. mkdir /opt/iaas;
  11. cp -rvf /mnt/* /opt/iaas;
  12. umount /mnt/;

3、本地yum配置

分别配置控制节点和计算节点的yum

  1. # 控制节点:
  2. rm -rf /etc/yum.repos.d/CentOS-*;
  3. cat > /etc/yum.repos.d/local.repo <<EOF
  4. [centos]
  5. name=centos
  6. baseurl=file:///opt/centos7.2
  7. gpgcheck=0
  8. enabled=1
  9. [iaas]
  10. name=iass
  11. baseurl=file:///opt/iaas/iaas-repo
  12. gpgcheck=0
  13. enabled=1
  14. EOF
  1. # 计算节点:(如果没有可以后面再配)
  2. rm -rf /etc/yum.repos.d/CentOS-*;
  3. cat > /etc/yum.repos.d/local.repo << EOF
  4. [centos]
  5. name=centos
  6. baseurl=ftp://192.168.16.10/centos7.2
  7. gpgcheck=0
  8. enabled=1
  9. [iaas]
  10. name=iass
  11. baseurl=ftp://192.168.16.10/iaas/iaas-repo
  12. gpgcheck=0
  13. enabled=1
  14. EOF

为计算节点提供ftp访问方式

  1. # 控制节点——yum缓存清理
  2. yum clean all
  3. yum makecache
  4. # 控制节点——安装vsftpd和ftp
  5. yum install -y vsftpd
  6. yum install -y ftp
  7. rpm -qa| grep vsftpd
  8. # 控制节点——修改vsftpd配置文件
  9. 在/etc/vsftpd/vsftpd.conf中添加一行代码:
  10. anon_root=/opt
  11. # 控制节点——安装网络工具包
  12. yum install net-tools
  13. # 重启vsftpd服务
  14. systemctl restart vsftpd
  15. # 开机启动vsftpd
  16. systemctl enable vsftpd
  17. # 控制节点、计算节点——关闭防火墙
  18. setenforce 0;
  19. iptables -F;
  20. iptables -X;
  21. iptables -Z;
  22. systemctl stop firewalld;
  23. systemctl disable firewalld;
  24. # 计算节点
  25. yum clean all
  26. yum makecache

4、给计算节点(node)添加新磁盘并分区

在vmware上给计算节点虚拟机添加一个新磁盘。
虚拟机——》设置——》添加——》硬盘——》scsi模式——》创建新虚拟磁盘——》20G,拆分为多个文件——》完成

  1. # 重启计算节点虚拟机
  2. reboot
  3. # 查看当前虚拟机的磁盘情况
  4. fdisk -l
  5. # 可以看到Disk /dev/sdb: 21.5 GB是完全空闲的
  6. # 创建两个空白磁盘空间
  7. fdisk /dev/sdb
  8. n,p,回车,回车,+10G
  9. n,p,回车,回车,回车
  10. w

5、在controller和compute节点安装iaas-xiandian包

  1. # 控制节点、计算节点分别执行,安装软件包
  2. yum install -y iaas-xiandian

控制节点、计算节点编辑修改配置文件/etc/xiandian/openrc.sh

  1. ##--------------------system Config--------------------##
  2. ##Controller Server Manager IP. example:x.x.x.x
  3. HOST_IP=192.168.16.10
  4. ##Controller HOST Password. example:000000
  5. HOST_PASS=000000
  6. ##Controller Server hostname. example:controller
  7. HOST_NAME=controller
  8. ##Compute Node Manager IP. example:x.x.x.x
  9. HOST_IP_NODE=192.168.16.20
  10. ##Compute HOST Password. example:000000
  11. HOST_PASS_NODE=000000
  12. ##Compute Node hostname. example:compute
  13. HOST_NAME_NODE=compute
  14. ##--------------------Chrony Config-------------------##
  15. ##Controller network segment IP. example:x.x.0.0/16(x.x.x.0/24)
  16. network_segment_IP=192.168.16.0/24
  17. ##--------------------Rabbit Config ------------------##
  18. ##user for rabbit. example:openstack
  19. RABBIT_USER=openstack
  20. ##Password for rabbit user .example:000000
  21. RABBIT_PASS=000000
  22. ##--------------------MySQL Config---------------------##
  23. ##Password for MySQL root user . exmaple:000000
  24. DB_PASS=000000
  25. ##--------------------Keystone Config------------------##
  26. ##Password for Keystore admin user. exmaple:000000
  27. DOMAIN_NAME=demo
  28. ADMIN_PASS=000000
  29. DEMO_PASS=000000
  30. ##Password for Mysql keystore user. exmaple:000000
  31. KEYSTONE_DBPASS=000000
  32. ##--------------------Glance Config--------------------##
  33. ##Password for Mysql glance user. exmaple:000000
  34. GLANCE_DBPASS=000000
  35. ##Password for Keystore glance user. exmaple:000000
  36. GLANCE_PASS=000000
  37. ##--------------------Nova Config----------------------##
  38. ##Password for Mysql nova user. exmaple:000000
  39. NOVA_DBPASS=000000
  40. ##Password for Keystore nova user. exmaple:000000
  41. NOVA_PASS=000000
  42. ##--------------------Neturon Config-------------------##
  43. ##Password for Mysql neutron user. exmaple:000000
  44. NEUTRON_DBPASS=000000
  45. ##Password for Keystore neutron user. exmaple:000000
  46. NEUTRON_PASS=000000
  47. ##metadata secret for neutron. exmaple:000000
  48. METADATA_SECRET=000000
  49. ##Tunnel Network Interface. example:x.x.x.x
  50. INTERFACE_IP=192.168.16.10/192.168.16.20
  51. ##External Network Interface. example:eth1 第二张网卡
  52. INTERFACE_NAME=eno33554960
  53. ##External Network The Physical Adapter. example:provider
  54. Physical_NAME=provider
  55. ##First Vlan ID in VLAN RANGE for VLAN Network. exmaple:101
  56. minvlan=1
  57. ##Last Vlan ID in VLAN RANGE for VLAN Network. example:200
  58. maxvlan=2000
  59. ##--------------------Cinder Config--------------------##
  60. ##Password for Mysql cinder user. exmaple:000000
  61. CINDER_DBPASS=000000
  62. ##Password for Keystore cinder user. exmaple:000000
  63. CINDER_PASS=000000
  64. ##Cinder Block Disk. example:md126p3
  65. BLOCK_DISK=sdb1
  66. ##--------------------Swift Config---------------------##
  67. ##Password for Keystore swift user. exmaple:000000
  68. SWIFT_PASS=000000
  69. ##The NODE Object Disk for Swift. example:md126p4.
  70. OBJECT_DISK=sdb2
  71. ##The NODE IP for Swift Storage Network. example:x.x.x.x.
  72. STORAGE_LOCAL_NET_IP=192.168.16.20
  73. ##--------------------Heat Config----------------------##
  74. ##Password for Mysql heat user. exmaple:000000
  75. HEAT_DBPASS=000000
  76. ##Password for Keystore heat user. exmaple:000000
  77. HEAT_PASS=000000
  78. ##--------------------Zun Config-----------------------##
  79. ##Password for Mysql Zun user. exmaple:000000
  80. ZUN_DBPASS=000000
  81. ##Password for Keystore Zun user. exmaple:000000
  82. ZUN_PASS=000000
  83. ##Password for Mysql Kuryr user. exmaple:000000
  84. KURYR_DBPASS=000000
  85. ##Password for Keystore Kuryr user. exmaple:000000
  86. KURYR_PASS=000000
  87. ##--------------------Ceilometer Config----------------##
  88. ##Password for Gnocchi ceilometer user. exmaple:000000
  89. CEILOMETER_DBPASS=000000
  90. ##Password for Keystore ceilometer user. exmaple:000000
  91. CEILOMETER_PASS=000000
  92. ##--------------------AODH Config----------------##
  93. ##Password for Mysql AODH user. exmaple:000000
  94. AODH_DBPASS=000000
  95. ##Password for Keystore AODH user. exmaple:000000
  96. AODH_PASS=000000
  97. ##--------------------Barbican Config----------------##
  98. ##Password for Mysql Barbican user. exmaple:000000
  99. BARBICAN_DBPASS=000000
  100. ##Password for Keystore Barbican user. exmaple:000000
  101. BARBICAN_PASS=000000

6、脚本安装openstack平台

控制节点、计算节点分别执行如下脚本安装基础服务:
iaas-pre-host.sh

控制节点部署mysql数据库服务:
iaas-install-mysql.sh

控制节点部署keystone服务:
iaas-install-keystore.sh

控制节点部署glance服务:
iaas-install-glance.sh

控制节点部署nova服务:
iaas-install-nova-controller.sh
计算节点部署nova服务
iaas-install-nova-compute.sh

控制节点部署neutron
iaas-install-neutron-controller.sh
错误处理——修改脚本:
vi /usr/local/bin/iaas-install-neutron-controller-gre.sh
将最后一行的
systemctl enabled neutron-lbaas-agent 改为 systemctl enable neutron-lbaas-agent
再执行下面的脚本:
iaas-install-neutron-controller-gre.sh

计算节点部署neutron
iaas-install-neutron-compute.sh
iaas-install-neutron-compute-gre.sh

控制节点部署dashboard
iaas-install-dashboard.sh

三、Openstack平台使用

两节点部署,192.168.16.10为控制节点。192.168.16.20为计算节点。

1、创建镜像

  1. # 控制节点上,找到qcow2镜像
  2. [root@controller ~]# cd /opt/iaas/images/
  3. [root@controller images]# ls
  4. CentOS_6.5_x86_64_XD.qcow2 CentOS_7.2_x86_64_XD.qcow2 MySQL_5.6_XD.qcow2
  5. # 上传镜像致Glance服务
  6. # 在控制节点,通过glance命令,将qcow2镜像上传到平台
  7. [root@controller images]# source /etc/keystone/admin-openrc.sh
  8. [root@controller images]# glance image-create --name "centos7.2" --disk-format qcow2 --container-format bare --progress < CentOS_7.2_x86_64_XD.qcow2

2、创建虚拟机

(1)创建外部网络

选择菜单栏 项目——》网络——》网络。单击 创建网络 ,来创建虚拟机网络。
创建网络名net-gre,配置子网名称为net-subnet,网络地址为192.168.20.0/24,网关为192.168.20.2。
再配置DHCP地址池,激活DHCP,配置DNS为114.114.114.114。点击“已创建”创建网络。

选择菜单栏 管理员——》系统——》网络。对已创建的net-gre网络,点击 “编辑网络”,在弹框中勾选“外部网络”。

(2)创建内部网络

选择菜单栏 项目——》网络——》网络。单击 创建网络 ,来创建虚拟机网络。
创建网络名int-gre,配置子网名称为 int-subnet,网络地址为10.10.0.0/24,网关为10.10.0.1。
配置DHCP地址池,激活DHCP。点击“已创建”创建网络。

(3)创建路由器

选择菜单栏 项目——》网络——》路由。单击 新建路由,来创建路由。
创建路由名称为route,外部网络选择 net-gre。点击“新建路由”创建路由。

在route路由中内部网络接口:
单击新建的路由名称,选择 接口 标签。点击 "增加接口"按钮。
在弹框中,选择 int-gre 内部网络,再点击 提交 。

(4)安全组配置

管理访问策略安全组,选择菜单栏 项目——》计算——》访问&安全。单击default安全组 管理规则 按钮。

点击 添加规则 ,选择"所有ICMP协议",单击 添加 按钮;选择"所有TCP协议",单击 添加 按钮;选择"所有UDP协议",单击 添加 按钮。

(5)创建云主机

创建云主机,选择菜单栏 项目——》计算——》云主机。单击右侧 "创建云主机"按钮。

云主机名称为:test,数量:1。选择centos7.2镜像;选择m1.small资源类型;选择int-gre网络。然后单击"启动实例"按钮创建实例。

选择菜单栏 项目——》计算——》云主机。在主机下拉框中选择 "绑定浮动IP"菜单命令。在弹框中点击 "+"分配一个地址,单击 "分配IP"按钮。点击 "关联"按钮,关联浮动IP地址。

(6)连接云主机

打开CMD窗口,通过ping命令测试连通云主机。
使用secureCRT工具,连接云主机,用户名:root,密码:000000。

四、Keystone服务运维

在Openstack框架中,keystone(Openstack Identity Service)的功能是负责验证身份、校验服务规则和发布服务令牌的,它实现了Openstack的Identity API.keystone可分解为两个功能:权限管理和服务目录。

https://www.cnblogs.com/mh20131118/p/12942346.html

https://www.cnblogs.com/linuxk/p/9282996.html

1、keystone运维命令

  1. # 环境配置
  2. source /etc/keystone/admin-openrc.sh
  3. # 创建 hqs用户
  4. openstack user create --password ps1234 --email hqs@example.com --domain demo hqs
  5. # 创建acme项目
  6. openstack project create --domain demo acme
  7. # 创建角色
  8. openstack role create compute-user
  9. # 绑定用户和项目权限
  10. # 添加的用户需要分配一定的权限,需要把用户关联绑定到对应的项目和角色
  11. openstack role add --user hqs --project acme compute-user

2、keystone查询命令

  1. # 用户列表查询
  2. [root@controller ~]# openstack user list
  3. +----------------------------------+---------+
  4. | ID | Name |
  5. +----------------------------------+---------+
  6. | 0f217182b5af448c988f5464c706a337 | admin |
  7. | 1579d0526c8b4cf0ba1158960054fde0 | neutron |
  8. | 408d6f8e000847a3a9a0f799a1ea2ef6 | hqs |
  9. | 560d1dca91184856822e3750ea2f4afb | nova |
  10. | 5ca7355fbe4f4b87b352a72f9c4b4a66 | cinder |
  11. | 93443c8fc497495e8bb9033a1a52fc1d | demo |
  12. | d5bcfce4e83d4ef696bcd87599399429 | swift |
  13. | e255b170101c41d3b839dbb013daef02 | glance |
  14. +----------------------------------+---------+
  15. # 查询hqs用户详细信息
  16. [root@controller ~]# openstack user show hqs
  17. +-----------+----------------------------------+
  18. | Field | Value |
  19. +-----------+----------------------------------+
  20. | domain_id | 90f55d85d1824e2ca27318eefc57535e |
  21. | email | hqs@example.com |
  22. | enabled | True |
  23. | id | 408d6f8e000847a3a9a0f799a1ea2ef6 |
  24. | name | hqs |
  25. +-----------+----------------------------------+
  26. # 查询当前openstack平台所有项目
  27. [root@controller ~]# openstack project list
  28. +----------------------------------+---------+
  29. | ID | Name |
  30. +----------------------------------+---------+
  31. | 015510f69fd74453a700a529b7bee827 | demo |
  32. | 168c9d9e5cf448c2a3dab6335590566a | service |
  33. | 386dbfcf77e444c7872e4e23d5829fcc | admin |
  34. | b66f515463e54b229b1d61d9313717ff | acme |
  35. +----------------------------------+---------+
  36. # 查询acme项目详情
  37. [root@controller ~]# openstack project show acme
  38. +-------------+----------------------------------+
  39. | Field | Value |
  40. +-------------+----------------------------------+
  41. | description | |
  42. | domain_id | 90f55d85d1824e2ca27318eefc57535e |
  43. | enabled | True |
  44. | id | b66f515463e54b229b1d61d9313717ff |
  45. | is_domain | False |
  46. | name | acme |
  47. | parent_id | 90f55d85d1824e2ca27318eefc57535e |
  48. +-------------+----------------------------------+
  49. # 查询所有keystone角色
  50. [root@controller ~]# openstack role list
  51. +----------------------------------+--------------+
  52. | ID | Name |
  53. +----------------------------------+--------------+
  54. | 0190945cf6a84b60bb2f4631f85c30fa | compute-user |
  55. | 4c438257d4a24e4aa4d4fcbeff248bce | user |
  56. | d8ac2f3e57664b7abee701d82c9bbf16 | admin |
  57. +----------------------------------+--------------+
  58. # 查询compute-user角色详细信息
  59. [root@controller ~]# openstack role show compute-user
  60. +-----------+----------------------------------+
  61. | Field | Value |
  62. +-----------+----------------------------------+
  63. | domain_id | None |
  64. | id | 0190945cf6a84b60bb2f4631f85c30fa |
  65. | name | compute-user |
  66. +-----------+----------------------------------+
  67. # 查看平台所有服务所使用的端点地址
  68. [root@controller ~]# openstack endpoint list
  69. +------------+-----------+--------------+--------------+---------+-----------+---------------+
  70. | ID | Region | Service Name | Service Type | Enabled | Interface | URL |
  71. +------------+-----------+--------------+--------------+---------+-----------+---------------+
  72. | 14f90cb0cb | RegionOne | nova | compute | True | internal | http://contro |
  73. ....

五、Nova组件详解

计算节点通过Nova Computer进行虚拟机创建,通过libvirt调用kvm创建虚拟机,nova之间通信通过rabbitMQ队列进行通信。
Nova位于Openstack架构的中心,其他服务或者组件(比如Glance、Cinder、Neutron等)对它提供支持,另外它本身的架构也比较复杂。

作用:

    1. Nova是OpenStack最核心的服务模块,负责管理和维护云计算环境的计算资源,负责整个云环境虚拟机生命周期的管理。
    1. Nova是OpenStack的计算服务,负责维护和管理的网络和存储,提供计算服务。

https://www.cnblogs.com/mh20131118/p/12939358.html

https://www.cnblogs.com/linuxk/p/9454258.html

1、安全组相关操作:

  1. nova
  2. ​ secgroup-add-default-rule Add a rule to the set of rules that will be
  3. ​ added to the 'default' security group for new
  4. ​ tenants (nova-network only).
  5. ​ secgroup-add-group-rule Add a source group rule to a security group.
  6. ​ secgroup-add-rule Add a rule to a security group.
  7. ​ secgroup-create Create a security group.
  8. ​ secgroup-delete Delete a security group.
  9. ​ secgroup-delete-default-rule
  10. ​ Delete a rule from the set of rules that will
  11. ​ be added to the 'default' security group for
  12. ​ new tenants (nova-network only).
  13. ​ secgroup-delete-group-rule Delete a source group rule from a security
  14. ​ group.
  15. ​ secgroup-delete-rule Delete a rule from a security group.
  16. ​ secgroup-list List security groups for the current tenant.
  17. ​ secgroup-list-default-rules
  18. ​ List rules that will be added to the 'default'
  19. ​ security group for new tenants.
  20. ​ secgroup-list-rules List rules for a security group.
  21. ​ secgroup-update Update a security group.
  22. # 安全组查看:
  23. [root@controller ~]# nova secgroup-list
  24. +--------------------------------------+---------+------------------------+
  25. | Id | Name | Description |
  26. +--------------------------------------+---------+------------------------+
  27. | 486eaa38-8e3d-4214-96bc-e6fee9b81be6 | default | Default security group |
  28. +--------------------------------------+---------+------------------------+
  29. # 安全组创建
  30. [root@controller ~]# nova secgroup-create hqs 'Most great security group'
  31. +--------------------------------------+------+---------------------------+
  32. | Id | Name | Description |
  33. +--------------------------------------+------+---------------------------+
  34. | 1f2e9304-2fa0-45ac-a407-9816c72a1190 | hqs | Most great security group |
  35. +--------------------------------------+------+---------------------------+
  36. # 安全组更新
  37. [root@controller ~]# nova secgroup-update 218faa36-c250-40d5-9775-534049e5771a hqs111 'One of the most great security group '
  38. +--------------------------------------+--------+---------------------------------------+
  39. | Id | Name | Description |
  40. +--------------------------------------+--------+---------------------------------------+
  41. | 218faa36-c250-40d5-9775-534049e5771a | hqs111 | One of the most great security group |
  42. +--------------------------------------+--------+---------------------------------------+
  43. # 安全组删除
  44. [root@controller ~]# nova secgroup-delete hqs111
  45. # 安全组规则查看
  46. [root@controller ~]# nova secgroup-list-rules hqs
  47. +-------------+-----------+---------+----------+--------------+
  48. | IP Protocol | From Port | To Port | IP Range | Source Group |
  49. +-------------+-----------+---------+----------+--------------+
  50. +-------------+-----------+---------+----------+--------------+
  51. [root@controller ~]# nova secgroup-list-rules default
  52. +-------------+-----------+---------+-----------+--------------+
  53. | IP Protocol | From Port | To Port | IP Range | Source Group |
  54. +-------------+-----------+---------+-----------+--------------+
  55. | tcp | 1 | 65535 | 0.0.0.0/0 | |
  56. | udp | 1 | 65535 | 0.0.0.0/0 | |
  57. | icmp | -1 | -1 | 0.0.0.0/0 | |
  58. | | | | | default |
  59. | | | | | default |
  60. +-------------+-----------+---------+-----------+--------------+
  61. # 安全组规则添加
  62. [root@controller ~]# nova secgroup-add-rule hqs icmp -1 -1 0.0.0.0/0
  63. +-------------+-----------+---------+-----------+--------------+
  64. | IP Protocol | From Port | To Port | IP Range | Source Group |
  65. +-------------+-----------+---------+-----------+--------------+
  66. | icmp | -1 | -1 | 0.0.0.0/0 | |
  67. +-------------+-----------+---------+-----------+--------------+
  68. [root@controller ~]# nova secgroup-add-rule hqs udp 1 65535 0.0.0.0/0
  69. +-------------+-----------+---------+-----------+--------------+
  70. | IP Protocol | From Port | To Port | IP Range | Source Group |
  71. +-------------+-----------+---------+-----------+--------------+
  72. | udp | 1 | 65535 | 0.0.0.0/0 | |
  73. +-------------+-----------+---------+-----------+--------------+
  74. [root@controller ~]# nova secgroup-add-rule hqs tcp 1 65535 0.0.0.0/0
  75. +-------------+-----------+---------+-----------+--------------+
  76. | IP Protocol | From Port | To Port | IP Range | Source Group |
  77. +-------------+-----------+---------+-----------+--------------+
  78. | tcp | 1 | 65535 | 0.0.0.0/0 | |
  79. +-------------+-----------+---------+-----------+--------------+
  80. # 安全组规则删除
  81. [root@controller ~]# nova secgroup-delete-rule hqs icmp -1 -1 0.0.0.0/0
  82. +-------------+-----------+---------+-----------+--------------+
  83. | IP Protocol | From Port | To Port | IP Range | Source Group |
  84. +-------------+-----------+---------+-----------+--------------+
  85. | icmp | -1 | -1 | 0.0.0.0/0 | |
  86. +-------------+-----------+---------+-----------+--------------+
  87. [root@controller ~]# nova secgroup-list-rules hqs
  88. +-------------+-----------+---------+-----------+--------------+
  89. | IP Protocol | From Port | To Port | IP Range | Source Group |
  90. +-------------+-----------+---------+-----------+--------------+
  91. | udp | 1 | 65535 | 0.0.0.0/0 | |
  92. | tcp | 1 | 65535 | 0.0.0.0/0 | |
  93. +-------------+-----------+---------+-----------+--------------+

2、云主机类型操作

  1. nova
  2. flavor-access-add Add flavor access for the given tenant.
  3. flavor-access-list Print access information about the given
  4. flavor.
  5. flavor-access-remove Remove flavor access for the given tenant.
  6. flavor-create Create a new flavor.
  7. flavor-delete Delete a specific flavor
  8. flavor-key Set or unset extra_spec for a flavor.
  9. flavor-list Print a list of available 'flavors' (sizes of
  10. servers).
  11. flavor-show Show details about the given flavor.
  12. # 云主机类型列表查看
  13. [root@controller ~]# nova flavor-list
  14. +--------------------------------------+-----------+-----------+------+-----------+------+-------+-------------+-----------+
  15. | ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
  16. +--------------------------------------+-----------+-----------+------+-----------+------+-------+-------------+-----------+
  17. | 1 | m1.tiny | 512 | 1 | 0 | | 1 | 1.0 | True |
  18. | 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True |
  19. | 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True |
  20. | 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True |
  21. | 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0 | True |
  22. | 7645393e-4f46-473a-85bf-6ea69669dac2 | m1-hqs | 512 | 10 | 0 | | 1 | 1.0 | True |
  23. +--------------------------------------+-----------+-----------+------+-----------+------+-------+-------------+-----------+
  24. # 云主机类型添加
  25. [root@controller ~]# nova flavor-create m1.hqs 6 1024 10 1
  26. +----+--------+-----------+------+-----------+------+-------+-------------+-----------+
  27. | ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
  28. +----+--------+-----------+------+-----------+------+-------+-------------+-----------+
  29. | 6 | m1.hqs | 1024 | 10 | 0 | | 1 | 1.0 | True |
  30. +----+--------+-----------+------+-----------+------+-------+-------------+-----------+
  31. # 云主机类型详情查看
  32. [root@controller ~]# nova flavor-show m1.hqs
  33. +----------------------------+--------+
  34. | Property | Value |
  35. +----------------------------+--------+
  36. | OS-FLV-DISABLED:disabled | False |
  37. | OS-FLV-EXT-DATA:ephemeral | 0 |
  38. | disk | 10 |
  39. | extra_specs | {} |
  40. | id | 6 |
  41. | name | m1.hqs |
  42. | os-flavor-access:is_public | True |
  43. | ram | 1024 |
  44. | rxtx_factor | 1.0 |
  45. | swap | |
  46. | vcpus | 1 |
  47. +----------------------------+--------+
  48. # 云主机类型删除
  49. [root@controller ~]# nova flavor-delete m1-hqs

3、云主机实例操作

  1. # 实例列表查看
  2. nova list
  3. # 实例详情查看
  4. nova show <server>
  5. # 实例创建
  6. nova boot --image <image> [--volume <volume>] --availability-zone nova --flavor <flavor> --security-groups <secgroup> --nic <net-id=net-uuid> <server-name>
  7. # 1、查看镜像
  8. glance image-list
  9. # 2、查看规格
  10. nova flavor-list
  11. # 3、查看安全组
  12. nova secgroup-list
  13. # 4、查看可用的网络
  14. neutron net-list
  15. nova boot \
  16. --image centos7.2 \
  17. --availability-zone nova \
  18. --flavor m1.hqs \
  19. --security-groups hqs \
  20. --nic net-id=64306052-bcec-4209-ac4c-45b9d2de4dde \
  21. caocao-server1
  22. # 5、实例创建
  23. [root@controller images]# nova boot test-server --image centos7.2 --flavor m1.lxh --availability-zone nova --security-groups hqs --nic net-id=451fd2af-e1eb-4437-bf71-53b5f91c10b5
  24. +--------------------------------------+--------------------------------------------------+
  25. | Property | Value |
  26. +--------------------------------------+--------------------------------------------------+
  27. | OS-DCF:diskConfig | MANUAL |
  28. | OS-EXT-AZ:availability_zone | nova |
  29. | OS-EXT-SRV-ATTR:host | - |
  30. | OS-EXT-SRV-ATTR:hostname | test-server |
  31. | OS-EXT-SRV-ATTR:hypervisor_hostname | - |
  32. | OS-EXT-SRV-ATTR:instance_name | instance-0000000d |
  33. | OS-EXT-SRV-ATTR:kernel_id | |
  34. | OS-EXT-SRV-ATTR:launch_index | 0 |
  35. | OS-EXT-SRV-ATTR:ramdisk_id | |
  36. | OS-EXT-SRV-ATTR:reservation_id | r-zoria5fn |
  37. | OS-EXT-SRV-ATTR:root_device_name | - |
  38. | OS-EXT-SRV-ATTR:user_data | - |
  39. | OS-EXT-STS:power_state | 0 |
  40. | OS-EXT-STS:task_state | scheduling |
  41. | OS-EXT-STS:vm_state | building |
  42. | OS-SRV-USG:launched_at | - |
  43. | OS-SRV-USG:terminated_at | - |
  44. | accessIPv4 | |
  45. | accessIPv6 | |
  46. | adminPass | ejFD96k8DUkW |
  47. | config_drive | |
  48. | created | 2021-10-19T02:09:45Z |
  49. | description | - |
  50. | flavor | m1.lxh (111) |
  51. | hostId | |
  52. | host_status | |
  53. | id | 22d0a54b-2a6f-4ea8-8729-dc07055c19e5 |
  54. | image | centos7.2 (8aec8782-c6af-41d8-a225-ada5a2af13dc) |
  55. | key_name | - |
  56. | locked | False |
  57. | metadata | {} |
  58. | name | test-server |
  59. | os-extended-volumes:volumes_attached | [] |
  60. | progress | 0 |
  61. | security_groups | hqs |
  62. | status | BUILD |
  63. | tenant_id | 386dbfcf77e444c7872e4e23d5829fcc |
  64. | updated | 2021-10-19T02:09:55Z |
  65. | user_id | 0f217182b5af448c988f5464c706a337 |
  66. +--------------------------------------+--------------------------------------------------+
  67. # 实例停止
  68. [root@controller ~]# nova stop hqs_server
  69. Request to stop server hqs_server has been accepted.
  70. # 实例启动
  71. [root@controller ~]# nova start hqs_server
  72. Request to start server hqs_server has been accepted.
  73. # 实例重启
  74. [root@controller ~]# nova reboot hqs_server
  75. Request to reboot server <Server: hqs_server> has been accepted.
  76. [root@controller ~]# nova list
  77. +--------------------------------------+------------+---------+----------------+-------------+----------------------------------+
  78. | ID | Name | Status | Task State | Power State | Networks |
  79. +--------------------------------------+------------+---------+----------------+-------------+----------------------------------+
  80. | b51590fc-33cc-4d54-8e54-c0530e912d2b | hqs_server | REBOOT | reboot_started | Running | int-gre=172.25.2.8 |
  81. | c6cabeed-1176-4634-b493-b6be7c351a03 | test | SHUTOFF | - | Shutdown | int-gre=172.25.2.3, 192.168.20.4 |
  82. +--------------------------------------+------------+---------+----------------+-------------+----------------------------------+
  83. # 实例挂起
  84. [root@controller ~]# nova pause test
  85. [root@controller ~]# nova list
  86. +--------------------------------------+------------+--------+----------------+-------------+----------------------------------+
  87. | ID | Name | Status | Task State | Power State | Networks |
  88. +--------------------------------------+------------+--------+----------------+-------------+----------------------------------+
  89. | b51590fc-33cc-4d54-8e54-c0530e912d2b | hqs_server | REBOOT | reboot_started | Running | int-gre=172.25.2.8 |
  90. | c6cabeed-1176-4634-b493-b6be7c351a03 | test | PAUSED | - | Paused | int-gre=172.25.2.3, 192.168.20.4 |
  91. +--------------------------------------+------------+--------+----------------+-------------+----------------------------------+
  92. # 实例删除
  93. [root@controller ~]# nova delete hqs_server
  94. Request to delete server hqs_server has been accepted.
  95. [root@controller ~]# nova list
  96. +--------------------------------------+------+--------+------------+-------------+----------------------------------+
  97. | ID | Name | Status | Task State | Power State | Networks |
  98. +--------------------------------------+------+--------+------------+-------------+----------------------------------+
  99. | c6cabeed-1176-4634-b493-b6be7c351a03 | test | PAUSED | - | Paused | int-gre=172.25.2.3, 192.168.20.4 |
  100. +--------------------------------------+------+--------+------------+-------------+----------------------------------+

4、浮动IP

  1. nova
  2. floating-ip-associate Associate a floating IP address to a server.
  3. floating-ip-bulk-create Bulk create floating IPs
  4. by range (nova-network only).
  5. floating-ip-bulk-delete Bulk delete floating IPs by range (nova-
  6. network only).
  7. floating-ip-bulk-list List all floating IPs (nova-network only).
  8. floating-ip-create Allocate a floating IP for the current tenant.
  9. floating-ip-delete De-allocate a floating IP.
  10. floating-ip-disassociate Disassociate a floating IP address from a
  11. server.
  12. floating-ip-list List floating IPs.
  13. floating-ip-pool-list List all floating IP pools.
  14. # 创建浮动IP
  15. # 语法:nova floating-ip-create <pool>
  16. [root@controller nova]# nova floating-ip-create net-gre
  17. +--------------------------------------+--------------+-----------+----------+---------+
  18. | Id | IP | Server Id | Fixed IP | Pool |
  19. +--------------------------------------+--------------+-----------+----------+---------+
  20. | fcb2439d-ba4f-4467-ad60-34726d57aba4 | 192.168.37.5 | - | - | net-gre |
  21. +--------------------------------------+--------------+-----------+----------+---------+
  22. # 浮动IP的列表信息
  23. [root@controller nova]# nova floating-ip-list
  24. +--------------------------------------+--------------+-----------+----------+---------+
  25. | Id | IP | Server Id | Fixed IP | Pool |
  26. +--------------------------------------+--------------+-----------+----------+---------+
  27. | fcb2439d-ba4f-4467-ad60-34726d57aba4 | 192.168.37.5 | - | - | net-gre |
  28. +--------------------------------------+--------------+-----------+----------+---------+
  29. # 浮动IP地址池信息
  30. [root@controller nova]# nova floating-ip-pool-list
  31. +---------+
  32. | name |
  33. +---------+
  34. | net-gre |
  35. +---------+
  36. # 查看浮动IP详细信息
  37. [root@controller nova]# openstack ip floating show 192.168.37.5
  38. +---------------------+--------------------------------------+
  39. | Field | Value |
  40. +---------------------+--------------------------------------+
  41. | description | |
  42. | dns_domain | |
  43. | dns_name | |
  44. | fixed_ip_address | None |
  45. | floating_ip_address | 192.168.37.5 |
  46. | floating_network_id | 847163a4-65dd-456e-a839-4f810cce80cf |
  47. | id | fcb2439d-ba4f-4467-ad60-34726d57aba4 |
  48. | port_id | None |
  49. | project_id | 386dbfcf77e444c7872e4e23d5829fcc |
  50. | router_id | None |
  51. | status | DOWN |
  52. +---------------------+--------------------------------------+
  53. # 浮动ip关联给实例
  54. # 语法:nova floating-ip-associate [--fixed-address <fixed_address>] <server> <address>
  55. # 参数:
  56. # <server> Name or ID of server.(nova list)
  57. # <address> IP Address.(nova floating-ip-list)
  58. [root@controller nova]# nova floating-ip-associate caocao-server1 192.168.37.5
  59. [root@controller nova]# nova list
  60. +--------------------------------------+----------------+--------+------------+-------------+---------------------------------+
  61. | ID | Name | Status | Task State | Power State | Networks |
  62. +--------------------------------------+----------------+--------+------------+-------------+---------------------------------+
  63. | e2c75e51-1a3b-4a0b-8765-d7ff6e8188e3 | caocao-server1 | ACTIVE | - | Running | int-gre=10.10.0.3, 192.168.37.5 |
  64. +-----------------------
  65. # 浮动IP解除关联实例
  66. # 语法:nova floating-ip-disassociate <server> <address>
  67. [root@controller nova]# nova floating-ip-disassociate caocao-server1 192.168.37.5
  68. [root@controller nova]# nova list
  69. +--------------------------------------+----------------+--------+------------+-------------+-------------------+
  70. | ID | Name | Status | Task State | Power State | Networks |
  71. +--------------------------------------+----------------+--------+------------+-------------+-------------------+
  72. | e2c75e51-1a3b-4a0b-8765-d7ff6e8188e3 | caocao-server1 | ACTIVE | - | Running | int-gre=10.10.0.3 |
  73. +--------------------------------------+----------------+--------+------------+-------------+-------------------+
  74. # 解除关联并删除浮动IP
  75. [root@controller nova]# nova floating-ip-associate caocao-server1 192.168.37.5
  76. [root@controller nova]# nova floating-ip-delete 192.168.37.5
  77. [root@controller nova]# nova list
  78. +--------------------------------------+----------------+--------+------------+-------------+-------------------+
  79. | ID | Name | Status | Task State | Power State | Networks |
  80. +--------------------------------------+----------------+--------+------------+-------------+-------------------+
  81. | e2c75e51-1a3b-4a0b-8765-d7ff6e8188e3 | caocao-server1 | ACTIVE | - | Running | int-gre=10.10.0.3 |
  82. +---------
  83. [root@controller nova]# nova floating-ip-list
  84. +----+----+-----------+----------+------+
  85. | Id | IP | Server Id | Fixed IP | Pool |
  86. +----+----+-----------+----------+------+
  87. +----+----+-----------+----------+------+

5、密钥管理

  1. nova
  2. keypair-add Create a new key pair for use with servers.
  3. keypair-delete Delete keypair given by its name. (Supported
  4. by API versions '2.0' - '2.latest') [hint: use
  5. '--os-compute-api-version' flag to show help
  6. message for proper version]
  7. keypair-list Print a list of keypairs for a user (Supported
  8. by API versions '2.0' - '2.latest') [hint: use
  9. '--os-compute-api-version' flag to show help
  10. message for proper version]
  11. keypair-show Show details about the given keypair.
  12. (Supported by API versions '2.0' - '2.latest')
  13. [hint: use '--os-compute-api-version' flag to
  14. show help message for proper version]
  15. # 查看密钥列表
  16. [root@controller ~]# nova keypair-list
  17. +------+------+-------------------------------------------------+
  18. | Name | Type | Fingerprint |
  19. +------+------+-------------------------------------------------+
  20. | test | ssh | 5c:7e:d8:bd:b9:33:cb:f9:eb:b8:52:c4:04:7c:8c:1e |
  21. +------+------+-------------------------------------------------+
  22. # 查看密钥详情
  23. [root@controller ~]# nova keypair-show test
  24. +-------------+-------------------------------------------------+
  25. | Property | Value |
  26. +-------------+-------------------------------------------------+
  27. | created_at | 2021-10-28T14:06:12.000000 |
  28. | deleted | False |
  29. | deleted_at | - |
  30. | fingerprint | 5c:7e:d8:bd:b9:33:cb:f9:eb:b8:52:c4:04:7c:8c:1e |
  31. | id | 1 |
  32. | name | test |
  33. | type | ssh |
  34. | updated_at | - |
  35. | user_id | 0f217182b5af448c988f5464c706a337 |
  36. +-------------+-------------------------------------------------+
  37. Public key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDc/qEc2ihvE7aLgSVH0lt5PDBwEYXW0CqMx8sGJPT1p3r0mxdJiti9pJxBRoX+oOhA/LFssaOGvtHDK79Njs3HynrXkxvKo6UfmBNQzt2z5C3nTP2U17JY2wrOh7YyYdhuuRirCLNHQk4hM1YY9BbPrCLjLlQ8Gms6vdgDCgT1gXuRppBTfQKrIKKRk6d5vIqBMoGM3fCaM34DiqwOS/uq8gQM8T/io9h6XrTKWznmZgzaFJ2S3XUZhAliSEgkraxZIM8L3QWumMlBVryYVUX6QEKv29hNWYZF/bxUqfQx50vBuIfHlKgkcccAVDy6OoZNmd6T1rdJXEdW+MWobHu7 Generated-by-Nova
  38. # 创建密钥
  39. [root@controller ~]# nova keypair-add hqs --key-type ssh
  40. -----BEGIN RSA PRIVATE KEY-----
  41. MIIEpwIBAAKCAQEAw3YnZk1ej5j3+CjpWalgmVWxrdAVZGfpC3Qklz+0RW7p4nTn
  42. VlkGL7mWEgx7fmRaBzZuwUuSuvFB79zWhGZqh7Dt0Zeibyy48u3AtZtDY1ZVkvss
  43. Vq7zOdUgg+2C8Em7KTAXsuf1I7KPxgJHX7j9pluN8zBQKiYYi4K+RPCVtisw3ev0
  44. Ey5vi7e1IuUawXpjWnGe+/yzCZWgL8X2uhyYH0cJUmO3PbFuX0aoZr/JsLbMfkeL
  45. 0hCDkpKgkx8L/VD6C8FW+Z3mfJGxJtGwakb+BGyOYZ3j/Sv7bh03QKPgViqJ9CGa
  46. WL5/y8dYmFLYM45Gb60FLWPSHWLmH9SFnmV7UwIDAQABAoIBABkiGUDbU/xs8/2x
  47. 7Qd9cxFkZntuFUIa5ml1nrrgEyMWdvaKh7Cfs97xIy3g8wQ2jSj+Q9GRESX+nbbl
  48. E6RksvANvRbFQ7q96m46ShxQAaNFV62VpIbk6huWnx63rK2PHYTXTUTQ9MGJVVll
  49. s53IYL1CaodJwBUbXu6ZejPNJ8MLoyom7cH89uaP5K8Ej7pHObaxMBCkSylU0vcG
  50. qJp0Gu1NbnQ823EYm5QeEqUfG8xLyXKOvAq3scZHg5hqdD6SDVOYm3uQM8TF8zkY
  51. SSTYrwktj7g7vP6ZQ0zY3k/s/zxMbTIurwwNm8L93tPcgtJUMw+fPYu3OHr9nhBt
  52. aeFJ6AkCggCBANoJLHA6j5Jgj0uLy+ur8BmU8qSCJ7Nmx3JZFj2ELoZcLzjniHqH
  53. 14QHqnBgFxaUAvmpy8wCMnIKrk83FdEkgk2vwSlsr1uEiz+MNHKqapWwiezR87HB
  54. 5XsgtHpOsBlTpzQlOL7TJX7kCtZYgyGbQJvLMeek+cqy2YsNp28AgFulAoIAgQDl
  55. fr5dBmEMBtTVaAjZFlyhJIXpf93QeC9KTtCLJ0QXAVPpCLlnulC8W4JfuZDTFqOr
  56. gnx1y84DfyoZ4/K6zPNfqguRRzE2sxMNDLNZeyZiA10uZwEh+AJtCf54FU2xZtVP
  57. 1eZ7I4QMR2jaDSj5nWgF90DYHoWLxOEeIVnTnFoplwKCAIANyxrGls3SYs1t6BAk
  58. fqIX3DZldd5xGQVxFHW1upD+6wIJxYv6xHE75wg/R7TuNrrhdH5yD4mFcWuJk2CL
  59. 9JVRuNatejS1w3LTuFjxEBriEWMIWlfiXPPZkD4aprO5RnODdv9aAx2SI3cUDFFv
  60. ZNT3hilIEEXFLv9YLqry+MMmCQKCAIBpG+OUN5e7KmXQWBW1V8iVBWVPzICLOoBu
  61. SCq7kQBeiP0lfhlsqKjRnBfaP+NUysmrg9f9G5r/fv6JXR2O8M+GwRsLLtAbfWj8
  62. URTTptOtkFzdI9Ag/rYdurYRybAL0E1ig1VMkLep6Ard06kwqic6lEPeuBvyJ/nz
  63. EtNRWArzgQKCAIAQDXQbP+20nzHoWqy1sFYIpOYrC+pZGX3tZb8DfAKrhrL+FkGe
  64. PSe6bNwgWVDEUwTyvoPUexvAVi7nZ1sqMw/Ar+KxCXcti+dzZZZa3typLQMceOr2
  65. wFfpNMT/Kq2DTrgkXN+jpFczv/R0kNn5bOB/DIm8JUeN44k97lMzIrD7TA==
  66. -----END RSA PRIVATE KEY-----
  67. # 删除密钥
  68. [root@controller ~]# nova keypair-list
  69. +------+------+-------------------------------------------------+
  70. | Name | Type | Fingerprint |
  71. +------+------+-------------------------------------------------+
  72. | hqs | ssh | e2:cc:e9:8f:1d:06:45:b4:52:0b:38:68:0d:15:b8:b9 |
  73. | test | ssh | 5c:7e:d8:bd:b9:33:cb:f9:eb:b8:52:c4:04:7c:8c:1e |
  74. +------+------+-------------------------------------------------+
  75. [root@controller ~]# nova keypair-delete hqs
  76. [root@controller ~]# nova keypair-list
  77. +------+------+-------------------------------------------------+
  78. | Name | Type | Fingerprint |
  79. +------+------+-------------------------------------------------+
  80. | test | ssh | 5c:7e:d8:bd:b9:33:cb:f9:eb:b8:52:c4:04:7c:8c:1e |
  81. +------+------+-------------------------------------------------+

6、配额管理

  1. # 待补全
  2. [root@controller ~]# openstack quota show admin
  3. +----------------------+----------------------------------+
  4. | Field | Value |
  5. +----------------------+----------------------------------+
  6. | backup_gigabytes | 1000 |
  7. | backups | 10 |
  8. | cores | 20 |
  9. | firewall | 10 |
  10. | firewall_policy | 10 |
  11. | firewall_rule | 100 |
  12. | fixed-ips | -1 |
  13. | floating-ips | 50 |
  14. | gigabytes | 1000 |
  15. | health_monitor | -1 |
  16. | injected-file-size | 10240 |
  17. | injected-files | 5 |
  18. | injected-path-size | 255 |
  19. | instances | 10 |
  20. | key-pairs | 100 |
  21. | member | -1 |
  22. | network | 10 |
  23. | per_volume_gigabytes | -1 |
  24. | pool | 10 |
  25. | port | 50 |
  26. | project | 386dbfcf77e444c7872e4e23d5829fcc |
  27. | properties | 128 |
  28. | ram | 51200 |
  29. | rbac_policy | 10 |
  30. | router | 10 |
  31. | secgroup-rules | 100 |
  32. | secgroups | 10 |
  33. | server_group_members | 10 |
  34. | server_groups | 10 |
  35. | snapshots | 10 |
  36. | subnet | 10 |
  37. | subnetpool | -1 |
  38. | vip | 10 |
  39. | volumes | 10 |
  40. +----------------------+----------------------------------+

六、网络neutron

网络管理

  1. # 查看网络列表信息
  2. [root@controller ~]# openstack network list
  3. +--------------------------------------+---------+--------------------------------------+
  4. | ID | Name | Subnets |
  5. +--------------------------------------+---------+--------------------------------------+
  6. | 847163a4-65dd-456e-a839-4f810cce80cf | net-gre | 757f4819-48aa-4026-aff2-8e78b4161691 |
  7. | 64306052-bcec-4209-ac4c-45b9d2de4dde | int-gre | d3aa832b-8bcf-4a7b-9692-540b468a711b |
  8. +--------------------------------------+---------+--------------------------------------+
  9. # 查看网络详细信息
  10. [root@controller ~]# openstack network show net-gre
  11. +---------------------------+--------------------------------------+
  12. | Field | Value |
  13. +---------------------------+--------------------------------------+
  14. | admin_state_up | UP |
  15. | availability_zone_hints | |
  16. | availability_zones | nova |
  17. | created_at | 2021-10-18T18:02:38 |
  18. | description | |
  19. | id | 847163a4-65dd-456e-a839-4f810cce80cf |
  20. | ipv4_address_scope | None |
  21. | ipv6_address_scope | None |
  22. | is_default | False |
  23. | mtu | 1458 |
  24. | name | net-gre |
  25. | port_security_enabled | True |
  26. | project_id | 386dbfcf77e444c7872e4e23d5829fcc |
  27. | provider:network_type | gre |
  28. | provider:physical_network | None |
  29. | provider:segmentation_id | 99 |
  30. | router_external | Internal |
  31. | shared | False |
  32. | status | ACTIVE |
  33. | subnets | 757f4819-48aa-4026-aff2-8e78b4161691 |
  34. | tags | [] |
  35. | updated_at | 2021-10-18T18:15:25 |
  36. +---------------------------+--------------------------------------+
  37. # 创建网络
  38. [root@controller ~]# openstack network create int-gre-test --project admin
  39. +---------------------------+--------------------------------------+
  40. | Field | Value |
  41. +---------------------------+--------------------------------------+
  42. | admin_state_up | UP |
  43. | availability_zone_hints | |
  44. | availability_zones | |
  45. | created_at | 2021-10-28T14:25:07 |
  46. | description | |
  47. | headers | |
  48. | id | 8e16c3a3-53f2-4ab7-b77f-3f1c1bf22dc6 |
  49. | ipv4_address_scope | None |
  50. | ipv6_address_scope | None |
  51. | mtu | 1458 |
  52. | name | int-gre-test |
  53. | port_security_enabled | True |
  54. | project_id | 386dbfcf77e444c7872e4e23d5829fcc |
  55. | provider:network_type | gre |
  56. | provider:physical_network | None |
  57. | provider:segmentation_id | 91 |
  58. | router_external | Internal |
  59. | shared | False |
  60. | status | ACTIVE |
  61. | subnets | |
  62. | tags | [] |
  63. | updated_at | 2021-10-28T14:25:07 |
  64. +---------------------------+--------------------------------------+
  65. # 更新网络
  66. [root@controller ~]# openstack network set int-gre-test --enable --name int-test-gre
  67. [root@controller ~]# openstack network list
  68. +--------------------------------------+--------------+--------------------------------------+
  69. | ID | Name | Subnets |
  70. +--------------------------------------+--------------+--------------------------------------+
  71. | 847163a4-65dd-456e-a839-4f810cce80cf | net-gre | 757f4819-48aa-4026-aff2-8e78b4161691 |
  72. | 64306052-bcec-4209-ac4c-45b9d2de4dde | int-gre | d3aa832b-8bcf-4a7b-9692-540b468a711b |
  73. | 8e16c3a3-53f2-4ab7-b77f-3f1c1bf22dc6 | int-test-gre | |
  74. +--------------------------------------+--------------+--------------------------------------+
  75. [root@controller ~]# openstack network show int-test-gre
  76. +---------------------------+--------------------------------------+
  77. | Field | Value |
  78. +---------------------------+--------------------------------------+
  79. | admin_state_up | UP |
  80. | availability_zone_hints | |
  81. | availability_zones | |
  82. | created_at | 2021-10-28T14:25:07 |
  83. | description | |
  84. | id | 8e16c3a3-53f2-4ab7-b77f-3f1c1bf22dc6 |
  85. | ipv4_address_scope | None |
  86. | ipv6_address_scope | None |
  87. | mtu | 1458 |
  88. | name | int-test-gre |
  89. | port_security_enabled | True |
  90. | project_id | 386dbfcf77e444c7872e4e23d5829fcc |
  91. | provider:network_type | gre |
  92. | provider:physical_network | None |
  93. | provider:segmentation_id | 91 |
  94. | router_external | Internal |
  95. | shared | False |
  96. | status | ACTIVE |
  97. | subnets | |
  98. | tags | [] |
  99. | updated_at | 2021-10-28T14:28:04 |
  100. +---------------------------+--------------------------------------+
  101. # 删除网络
  102. [root@controller ~]# openstack network delete int-gre-test
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/70525
推荐阅读
相关标签
  

闽ICP备14008679号