创建flavor类型

[root@controller ~]# openstack help  flavor create
usage: openstack flavor create [-h] [-f {json,shell,table,value,yaml}]
[-c COLUMN] [--max-width <integer>]
[--fit-width] [--print-empty] [--noindent]
[--prefix PREFIX] [--id <id>] [--ram <size-mb>]
[--disk <size-gb>] [--ephemeral <size-gb>]
[--swap <size-mb>] [--vcpus <vcpus>]
[--rxtx-factor <factor>] [--public | --private]
[--property <key=value>] [--project <project>]
[--project-domain <project-domain>]
<flavor-name> Create new flavor

使用命令创建一个flavor,10G的硬盘大小,1G内存,2颗vcpu,ID为1,名称为centos

[root@controller ~]#  openstack flavor create --disk 10 --ram 1024  --vcpus 2 --id 1 centos
+----------------------------+--------+
| Field | Value |
+----------------------------+--------+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| disk | 10 |
| id | 1 |
| name | centos |
| os-flavor-access:is_public | True |
| properties | |
| ram | 1024 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 2 |
+----------------------------+--------+

使用“openstack flavor list”命令查看flavor类型列表

[root@controller ~]# openstack flavor list
+----+--------+------+------+-----------+-------+-----------+
| ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public |
+----+--------+------+------+-----------+-------+-----------+
| 1 | centos | 1024 | 10 | 0 | 2 | True |
+----+--------+------+------+-----------+-------+-----------+

通过命令查看创建的“centos”的flavor类型详细信息

[root@controller ~]# openstack flavor show centos
+----------------------------+--------+
| Field | Value |
+----------------------------+--------+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| access_project_ids | None |
| disk | 10 |
| id | 1 |
| name | centos |
| os-flavor-access:is_public | True |
| properties | |
| ram | 1024 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 2 |
+----------------------------+--------+

查看安全组

访问安全组为是OpenStack提供给云主机的一个访问策略控制组,通过安全组中的策略可以控制云主机的出入访问规则。

使用命令“openstack security group list”可以查看当前所创建的访问安全组列表

[root@controller ~]# openstack security group list
+--------------------------+---------+------------------------+------------------+------+
| ID | Name | Description | Project | Tags |
+--------------------------+---------+------------------------+------------------+------+
|896ce430-21f8-4673-8110-af| default | Default security group |1776912d52a7444d8b| [] |
ce97e43715 2d09eb86e8d1d9
+--------------------------+---------+------------------------+------------------+------+

“default”为openstack平台自带的安全组,通过命令可以查看安全组中的安全规则

[root@controller ~]#  openstack  security group rule list default
+--------------------+-------------+-----------+-----------+------------+----------------------+
| ID | IP Protocol | Ethertype | IP Range | Port Range | Remote Security Group|
+--------------------+-------------+-----------+-----------+------------+----------------------+
| 1e6c27ff-b456-4d2a | None | IPv4 | 0.0.0.0/0 | | 896ce430-21f8-4673 |
-a64d-51197fea048e -8110-afce97e43715
| 699e2744-e926-4bb4 | None | IPv6 | ::/0 | | None |
-9e4f-54885f669bc5
| 7aa363c8-5df3-4ce3 | None | IPv6 | ::/0 | | 896ce430-21f8-4673 |
-a775-9e453f086c87 -8110-afce97e43715
| bb08b786-09f4-44f3 | None | IPv4 | 0.0.0.0/0 | | None |
-a030-71b189a0f84f
+--------------------+-------------+-----------+-----------+------------+----------------------+

在安全规则的列表中,不能看出每条规则的具体策略,通过使用命令“openstack security group rule show”查看规则的详细信息

[root@controller ~]# openstack  security group rule show 7aa363c8-5df3-4ce3-a775-9e453f086c87
+-------------------+-------------------------------------------------------------------+
| Field | Value |
+-------------------+-------------------------------------------------------------------+
| created_at | 2022-02-10T03:21:40Z |
| description | None |
| direction | ingress |
| ether_type | IPv6 |
| id | 7aa363c8-5df3-4ce3-a775-9e453f086c87 |
| location | cloud='', project.domain_id=, project.domain_name='000000',
project.id='1776912d52a7444d8b2d09eb86e8d1d9', project.name='admin', region_name='',
zone= |
| name | None |
| port_range_max | None |
| port_range_min | None |
| project_id | 1776912d52a7444d8b2d09eb86e8d1d9 |
| protocol | None |
| remote_group_id | 896ce430-21f8-4673-8110-afce97e43715 |
| remote_ip_prefix | ::/0 |
| revision_number | 0 |
| security_group_id | 896ce430-21f8-4673-8110-afce97e43715 |
| tags | [] |
| updated_at | 2022-02-10T03:21:40Z

创建安全组

创建一个新的安全组,命令格式如下

[root@controller ~]# openstack help security group create
usage: openstack security group create [-h] [-f {json,shell,table,value,yaml}]
[-c COLUMN] [--max-width <integer>]
[--fit-width] [--print-empty]
[--noindent] [--prefix PREFIX]
[--description <description>]
[--project <project>]
[--project-domain <project-domain>]
<name>

使用命令创建新的安全组规则

[root@controller ~]# openstack security group create test
+-----------------+---------------------------------------------------------------------+
| Field | Value |
+-----------------+---------------------------------------------------------------------+
| created_at | 2022-02-10T03:25:18Z |
| description | test |
| id | 96373f68-be50-4819-b9a6-8fc8d3e9dc0a |
| location | cloud='', project.domain_id=, project.domain_name='000000',
project.id='1776912d52a7444d8b2d09eb86e8d1d9', project.name='admin', region_name='',
zone= |
| name | test |
| project_id | 1776912d52a7444d8b2d09eb86e8d1d9 |
| revision_number | 1 |
| rules | created_at='2022-02-10T03:25:18Z', direction='egress', ethertype
='IPv4', id='2bbc98ad-4784-419d-b815-4ee2c6c75b54', updated_at='2022-02-10T03:25:18Z' |
| | created_at='2022-02-10T03:25:19Z', direction='egress', ethertype
='IPv6', id='70fcb5e0-fd86-461e-84a4-2a83b4b90730', updated_at='2022-02-10T03:25:19Z' |
| tags | [] |
| updated_at | 2022-02-10T03:25:18Z |
+-----------------+---------------------------------------------------------------------+

删除安全组

可以使用命令删除不需要使用的访问安全组

[root@controller ~]# openstack security group delete test
[root@controller ~]# openstack security group list
+-------------------------+---------+------------------------+------------------+------+
| ID | Name | Description | Project | Tags |
+-------------------------+---------+------------------------+------------------+------+
| 896ce430-21f8-4673-8110 | default | Default security group | 1776912d52a7444d | [] |
-afce97e43715 8b2d09eb86e8d1d9
+-------------------------+---------+------------------------+------------------+------+

添加安全组规则

在默认安全组中添加三条需要使用的访问规则,使用“openstack security group rule create”命令

[root@controller ~]# openstack  help security group rule create
usage: openstack security group rule create [-h]
[-f {json,shell,table,value,yaml}]
[-c COLUMN]
[--max-width <integer>]
[--fit-width] [--print-empty]
[--noindent] [--prefix PREFIX]
[--remote-ip <ip-address> | --remote-group <group>]
[--description <description>]
[--dst-port <port-range>]
[--icmp-type <icmp-type>]
[--icmp-code <icmp-code>]
[--protocol <protocol>] #策略类型
[--ingress | --egress] #进出口规则
[--ethertype <ethertype>]
[--project <project>]
[--project-domain <project-domain>]
<group>

在“defualt”安全组中添加一条策略,从入口方向放行所有ICMP规则

[root@controller ~]# openstack security group rule create --protocol icmp --ingress  default
+-------------------+-------------------------------------------------------------------+
| Field | Value |
+-------------------+-------------------------------------------------------------------+
| created_at | 2022-02-10T04:47:42Z |
| description | |
| direction | ingress |
| ether_type | IPv4 |
| id | 61014f36-5c20-46ce-b779-7d0c7458e691 |
| location | cloud='', project.domain_id=, project.domain_name='000000',
project.id='1776912d52a7444d8b2d09eb86e8d1d9', project.name='admin', region_name='',
zone= |
| name | None |
| port_range_max | None |
| port_range_min | None |
| project_id | 1776912d52a7444d8b2d09eb86e8d1d9 |
| protocol | icmp |
| remote_group_id | None |
| remote_ip_prefix | 0.0.0.0/0 |
| revision_number | 0 |
| security_group_id | 896ce430-21f8-4673-8110-afce97e43715 |
| tags | [] |
| updated_at | 2022-02-10T04:47:42Z |
+-------------------+-------------------------------------------------------------------+

在“defualt”安全组中添加一条策略,从入口方向放行所有TCP规则

[root@controller ~]# openstack security group rule create --protocol tcp --ingress  default

+-------------------+-------------------------------------------------------------------+
| Field | Value |
+-------------------+-------------------------------------------------------------------+
| created_at | 2022-02-10T04:47:59Z |
| description | |
| direction | ingress |
| ether_type | IPv4 |
| id | 03ace6cf-ec1a-42a9-a754-c21fe887d1c0 |
| location | cloud='', project.domain_id=, project.domain_name='000000',
project.id='1776912d52a7444d8b2d09eb86e8d1d9', project.name='admin', region_name='',
zone= |
| name | None |
| port_range_max | None |
| port_range_min | None |
| project_id | 1776912d52a7444d8b2d09eb86e8d1d9 |
| protocol | tcp |
| remote_group_id | None |
| remote_ip_prefix | 0.0.0.0/0 |
| revision_number | 0 |
| security_group_id | 896ce430-21f8-4673-8110-afce97e43715 |
| tags | [] |
| updated_at | 2022-02-10T04:47:59Z |
+-------------------+-------------------------------------------------------------------+

在“defualt”安全组中添加一条策略,从入口方向放行所有UDP规则

[root@controller ~]# openstack security group rule create --protocol udp --ingress  default
+-------------------+------------------------------------------------------------------+
| Field | Value |
+-------------------+------------------------------------------------------------------+
| created_at | 2022-02-10T04:48:22Z |
| description | |
| direction | ingress |
| ether_type | IPv4 |
| id | 9ec501e5-2c16-4d89-8a15-57a16a8fe3cd |
| location | cloud='', project.domain_id=, project.domain_name='000000',
project.id='1776912d52a7444d8b2d09eb86e8d1d9', project.name='admin', region_name='',
zone= |
| name | None |
| port_range_max | None |
| port_range_min | None |
| project_id | 1776912d52a7444d8b2d09eb86e8d1d9 |
| protocol | udp |
| remote_group_id | None |
| remote_ip_prefix | 0.0.0.0/0 |
| revision_number | 0 |
| security_group_id | 896ce430-21f8-4673-8110-afce97e43715 |
| tags | [] |
| updated_at | 2022-02-10T04:48:22Z |
+-------------------+------------------------------------------------------------------+

查看“default”安全组中所有的规则列表信息

[root@controller ~]# openstack security group rule list default
+--------------------+-----------+---------+------- -+----------+---------------------+
| ID |IP Protocol|Ethertype| IP Range |Port Range|Remote Security Group|
+--------------------+-----------+---------+-----------+----------+---------------------+
| 03ace6cf-ec1a-42a9 | tcp | IPv4 | 0.0.0.0/0 | | None |
-a754-c21fe887d1c0
| 1e6c27ff-b456-4d2a | None | IPv4 | 0.0.0.0/0 | | 896ce430-21f8-4673 |
-a64d-51197fea048e -8110-afce97e43715
| 61014f36-5c20-46ce | icmp | IPv4 | 0.0.0.0/0 | | None |
-b779-7d0c7458e691
| 699e2744-e926-4bb4 | None | IPv6 | ::/0 | | None |
-9e4f-54885f669bc5
| 7aa363c8-5df3-4ce3 | None | IPv6 | ::/0 | | 896ce430-21f8-4673 |
-a775-9e453f086c87 -8110-afce97e43715
| 9ec501e5-2c16-4d89 | udp | IPv4 | 0.0.0.0/0 | | None |
-8a15-57a16a8fe3cd
| bb08b786-09f4-44f3 | None | IPv4 | 0.0.0.0/0 | | None |
-a030-71b189a0f84f
+--------------------+-----------+---------+-----------+----------+---------------------+

nova服务的基本使用的更多相关文章

  1. OpenStack控制节点上搭建Q版nova服务(step5)

    placement组件监听的端口号是:8778 nova组件监听的端口号是:6080.8774.8775 其中6080端口号是novncproxy监听的端口号. 1.安装服务组件 yum instal ...

  2. openstack Q版部署-----nova服务配置-控制节点(5)

    一.创建数据库(控制节点) 创建数据库以及用户: CREATE DATABASE nova_api; CREATE DATABASE nova; CREATE DATABASE nova_cell0; ...

  3. OpenStack 安装:nova服务

    上一篇介绍了glance,并且成功创建了一个镜像,这一篇介绍Nova. 首先创建Nova用户,需要记得先source环境变量,然后创建Nova用户,并设置密码为nova [root@linux-nod ...

  4. OpenStack入门篇(九)之nova服务(控制节点)的部署与测试

    1.Nova介绍 Nova是openstack最早的两块模块之一,另一个是对象存储swift.在openstack体系中一个叫做计算节点,一个叫做控制节点.这个主要和nova相关,我们把安装为计算节点 ...

  5. Openstack(十)部署nova服务(计算节点)

    在计算节点安装 10.1安装nova计算服务 # 阿里云源详见2.3配置 # yum install openstack-nova-compute 10.2配置nova计算服务 10.2.1配置nov ...

  6. Openstack(九)部署nova服务(控制节点)

    9.1nova服务介绍 nova是openstack最早的组件之一,nova分为控制节点和计算节点,计算节点通过nova computer进行虚拟机创建,通过libvirt调用kvm创建虚拟机,nov ...

  7. S1_搭建分布式OpenStack集群_06 nova服务配置 (控制节点)

    一.创建数据库(控制节点)创建数据库以及用户:# mysql -uroot -p12345678MariaDB [(none)]> CREATE DATABASE nova_api;MariaD ...

  8. 配置nova服务使用ceph作为后端存储

    在ceph监视器上执行 1.创建pool池 为nova服务创建pool池(因为我只有一个OSD节点,所以要将副本数设置为1) ceph osd pool create nova-vms 32 ceph ...

  9. openstack Q版部署-----nova服务配置-计算节点(6)

    一.服务安装(计算节点) 安装软件: yum install openstack-nova-compute -y 编辑/etc/nova/nova.conf文件并设置如下内容: [DEFAULT] e ...

  10. Openstack入门篇(十)之nova服务(计算节点)的部署与测试

    1.安装服务软件包 [root@linux-node2 ~]# yum install -y centos-release-openstack-newton [root@linux-node2 ~]# ...

随机推荐

  1. Centos6 编译安装Python3.6

    1. 安装依赖 yum install gcc openssl-devel bzip2-devel 2. 下载Python3.6 cd /usr/src wget https://www.python ...

  2. Linux运维最常用150个命令

    线上查询及帮助命令(2个) man 查看命令帮助,命令的词典,更复杂的还有info,但不常用. help 查看Linux内置命令的帮助,比如cd命令. 文件和目录操作命令(18个) ls 全拼list ...

  3. Tcp的Flags

    在TCP层,有个FLAGS字段,这个字段有以下几个标识:SYN, FIN, ACK, PSH, RST, URG. 其中,对于我们日常的分析有用的就是前面的五个字段. 它们的含义是: SYN表示建立连 ...

  4. -> 在c语言中是什么意思?

    ->在C语言中称为间接引用运算符,是二目运算符,优先级同成员运算符".".用法:p->a,其中p是指向一个结构体的指针,a是这个结构体类型的一个成员.表达式p-> ...

  5. 什么是arduino及.arduino分类

    关于什么是arduino没有什么可说的,想要接触arduino多多少少的都会对arduino有一定的理解,我认为,arduino应该算是一个连接硬件与软件的平台,通过他,你可以将你的想法以代码的形式呈 ...

  6. ip地址与子网掩码概述

    IP地址: IP地址(Internet Protocol):IP地址是IP协议提供的一种统一的地址格式,它为互联网上的每一个网络和每一台主机分配一个逻辑地址,以此来屏蔽物理地址的差异. IP地址分为五 ...

  7. layui表单使用开关滑块和复选框,渲染后台数据方法

    提示:整个表格要在form标签内 定义开关模板 <div class="layui-form" lay-filter="layuiadmin-app-form-li ...

  8. 前端进阶(8) - 前端开发需要了解的工具集合:webpack, eslint, prettier, ...

    前端开发需要了解的工具集合:webpack, eslint, prettier, ... 前端开发需要了解的一些工具,这些工具能够帮助你在项目开发中事半功倍. 1. nrm: npm registry ...

  9. kbengine开源分布式游戏服务端引擎

    一款开源的支持多人同时在线实时游戏的服务端引擎,使用简单的约定协议就能够使客户端与服务端进行交互,使用KBEngine插件能够快速与(Unity3D.OGRE.Cocos2d.HTML5,等等)技术结 ...

  10. H5打造3d场景不完全攻略(一): H5 3d表现形式

    前言 日前,taobao造物节H5放肆地火了一把.相信接下来将3d嵌入网站的这种营销方式会被越来越多的人留意到.工作之余体验了若干个3d H5页面,感觉这类的H5互动体验性明显要比普通的要强,把二维的 ...