nova服务的基本使用
创建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服务的基本使用的更多相关文章
- OpenStack控制节点上搭建Q版nova服务(step5)
placement组件监听的端口号是:8778 nova组件监听的端口号是:6080.8774.8775 其中6080端口号是novncproxy监听的端口号. 1.安装服务组件 yum instal ...
- openstack Q版部署-----nova服务配置-控制节点(5)
一.创建数据库(控制节点) 创建数据库以及用户: CREATE DATABASE nova_api; CREATE DATABASE nova; CREATE DATABASE nova_cell0; ...
- OpenStack 安装:nova服务
上一篇介绍了glance,并且成功创建了一个镜像,这一篇介绍Nova. 首先创建Nova用户,需要记得先source环境变量,然后创建Nova用户,并设置密码为nova [root@linux-nod ...
- OpenStack入门篇(九)之nova服务(控制节点)的部署与测试
1.Nova介绍 Nova是openstack最早的两块模块之一,另一个是对象存储swift.在openstack体系中一个叫做计算节点,一个叫做控制节点.这个主要和nova相关,我们把安装为计算节点 ...
- Openstack(十)部署nova服务(计算节点)
在计算节点安装 10.1安装nova计算服务 # 阿里云源详见2.3配置 # yum install openstack-nova-compute 10.2配置nova计算服务 10.2.1配置nov ...
- Openstack(九)部署nova服务(控制节点)
9.1nova服务介绍 nova是openstack最早的组件之一,nova分为控制节点和计算节点,计算节点通过nova computer进行虚拟机创建,通过libvirt调用kvm创建虚拟机,nov ...
- S1_搭建分布式OpenStack集群_06 nova服务配置 (控制节点)
一.创建数据库(控制节点)创建数据库以及用户:# mysql -uroot -p12345678MariaDB [(none)]> CREATE DATABASE nova_api;MariaD ...
- 配置nova服务使用ceph作为后端存储
在ceph监视器上执行 1.创建pool池 为nova服务创建pool池(因为我只有一个OSD节点,所以要将副本数设置为1) ceph osd pool create nova-vms 32 ceph ...
- openstack Q版部署-----nova服务配置-计算节点(6)
一.服务安装(计算节点) 安装软件: yum install openstack-nova-compute -y 编辑/etc/nova/nova.conf文件并设置如下内容: [DEFAULT] e ...
- Openstack入门篇(十)之nova服务(计算节点)的部署与测试
1.安装服务软件包 [root@linux-node2 ~]# yum install -y centos-release-openstack-newton [root@linux-node2 ~]# ...
随机推荐
- requests库获取图片响应流进行转发
遇到了一个问题,使用requests进行转发 requests响应流的时候,出现各种问题,问题的描述没有记录,不过Debug以下终于解决了问题.......下面简单的描述解决方案 response = ...
- 什么是 Java Timer 类?如何创建一个有特定时间间隔的任务?
java.util.Timer 是一个工具类,可以用于安排一个线程在未来的某个特定时间执 行.Timer 类可以用安排一次性任务或者周期任务. java.util.TimerTask 是一个实现了 R ...
- vue单文件组件data选项的函数体获取vue实例对象
因配置的关系,导致 vue的data选项中存在事件.而事件无法获取 vue 的实例对象:项目是单文件形式的,以下代码只是例子 new Vue({ el:..., data:{ a: { onevent ...
- SSM-learning
架构流程图: 第一步:建立spring框架: 包括:建立所需要的dao层,sevice层和controller层和实体类,建立spring配置文件,配置自动扫描bean AccountDao: @Re ...
- yum下载安装git服务
yum install git 安装成功后,配置 用户 邮箱信息 注: youxiu326 github账号名称 youxiu326@163.com github账号对应邮箱 git confi ...
- 经历了源码的痛苦,掌握DRF的核心序列化器
目录 DRF的核心--序列化器 序列化器 什么是序列化和反序列化? 序列化 序列化demo 字段类型 字段参数 序列化自定制返回字段 方法一:在序列化类(serializers.py)中写 方法二:在 ...
- Architecture Review Board
Architecture Review Board What's an Architecture Review? Architecture design is not a one-time final ...
- ES6-11学习笔记--Promise
Promise是ES6异步编程解决方案之一,简化以前ajax的嵌套地狱,增加代码可读性. 基本用法: resolve,成功 reject,失败 let p = new Promise((resol ...
- jdbc连接MySQL数据库+简单实例(普通JDBC方法实现和连接池方式实现)
jdbc连接数据库 总结内容 1. 基本概念 jdbc的概念 2. 数据库连接 数据库的连接 DAO层思想 重构设计 3. 事务 概念 事务的ACID属性 事务的操作 4. 连接池 为什么要使用连接池 ...
- CentOS系统Tomcat 8.5或9部署SSL证书
本文档介绍了CentOS系统下Tomcat 8.5或9部署SSL证书的操作说明. 环境准备 操作系统:CentOS 7.6 64位 Web服务器:Tomcat 8.5或9 前提条件 已从阿里云SSL证 ...