赞
踩
本篇文章主要介绍Neutron、Cinder服务的功能,学习其基础命令。利用其完成相关运维任务。
Neutron 是 Openstack 的虚拟网络服务。
Neutron 的设计目标是实现“网络即服务(Networking as a Service)”。为了达到这一目标,在设计上遵循了基于 SDN 实现网络虚拟化的原则,在实现上充分利用了 Linux 系统上的各种网络相关的技术。
Neutron 为整个 OpenStack 环境提供网络支持,包括二层交换,三层路由,负载均衡,防火墙等。Neutron 提供了一个灵活的框架,通过配置,无论是开源还是商业软件都可以被用来实现这些功能。
与openstack其他服务和组件的设计思路一样,Neutron也采用分布式架构,由多个组件(服务)共同对外提供网络服务,Neutron架构非常灵活,层次多,一方面是为了支持各种现有或者将来会出现的先进网络技术,另一方面支持分布式部署,获得足够的拓展性。示意图如下:
neutron server:对外提供 OpenStack 网络API,接收请求,并调用Plugin处理请求。
queue:Neutron Server,Plugin 和 Agent 之间通过 Messaging Queue 通信和调用。
neutron plugin:处理 Neutron Server 发来的请求,维护 OpenStack 逻辑网络的状态, 并调用 Agent 处理请求。
neutron agent:处理 Plugin请求,负责在 network provider 上真正实现各种网络功能。
neutron provider:提供网络服务的虚拟或物理网络设备,例如 Linux Bridge,Open vSwitch或者其他支持 Neutron 的物理交换机。
neutron database:存放 OpenStack 的网络状态信息,包括 Network, Subnet, Port, Router等。
1.使用Neutron相关命令查询网络服务列表中的“binary”一列
[root@controller ~]# neutron agent-list -c binary
+---------------------------+
| binary |
+---------------------------+
| neutron-openvswitch-agent |
| neutron-dhcp-agent |
| neutron-l3-agent |
| neutron-metadata-agent |
| neutron-lbaas-agent |
+---------------------------+
//如果一开始查报错,建议重启一下服务
[root@controller ~]# systemctl restart neutron-server.service
2.查询网络详细信息
[root@xiandian ~]# neutron net-list //列出当前租户所有的网络
+--------------------------------------+------------+---------+
| id | name | subnets |
+--------------------------------------+------------+---------+
| bd923693-d9b1-4094-bd5b-22a038c44827 | sharednet1 | |
+--------------------------------------+------------+---------+
[root@xiandian ~]# neutron net-show bd923693-d9b1-4094-bd5b-22a038c44827
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | True |
| availability_zone_hints | |
| availability_zones | |
| created_at | 2017-02-23T04:58:17 |
| description | |
| id | bd923693-d9b1-4094-bd5b-22a038c44827 |
| ipv4_address_scope | |
| ipv6_address_scope | |
| mtu | 1500 |
| name | sharednet1 |
| port_security_enabled | True |
| provider:network_type | flat |
| provider:physical_network | physnet1 |
| provider:segmentation_id | |
| router:external | False |
| shared | True |
| status | ACTIVE |
| subnets | |
| tags | |
| tenant_id | 20b1ab08ea644670addb52f6d2f2ed61 |
| updated_at | 2017-02-23T04:58:17 |
+---------------------------+--------------------------------------+
3.查询Neutron相关命令查询网络服务DHCP agent的详细信息
[root@controller ~]# neutron agent-list
+--------------------------------------+--------------------+------------+-------------------+-------+----------------+---------------------------+
| id | agent_type | host | availability_zone | alive | admin_state_up | binary |
+--------------------------------------+--------------------+------------+-------------------+-------+----------------+---------------------------+
| 1ccc8d2d-b40a-4406-b15b-ab4b2b8e8398 | Open vSwitch agent | controller | | :-) | True | neutron-openvswitch-agent |
| 245ae2f9-6220-4c00-a36d-542a746a3f9e | DHCP agent | controller | nova | :-) | True | neutron-dhcp-agent |
| 26f38d05-3553-46f6-8740-847f97741f89 | L3 agent | controller | nova | :-) | True | neutron-l3-agent |
| 5bd0c9e2-a2ef-4890-a4ac-a4cb6bccf71b | Metadata agent | controller | | :-) | True | neutron-metadata-agent |
| f1d1fc34-6e9d-46b5-8370-0579f3b46b6f | Loadbalancer agent | controller | | :-) | True | neutron-lbaas-agent |
+--------------------------------------+--------------------+------------+-------------------+-------+----------------+---------------------------+
[root@controller ~]# neutron agent-show 245ae2f9-6220-4c00-a36d-542a746a3f9e
+---------------------+----------------------------------------------------------+
| Field | Value |
+---------------------+----------------------------------------------------------+
| admin_state_up | True |
| agent_type | DHCP agent |
| alive | True |
| availability_zone | nova |
| binary | neutron-dhcp-agent |
| configurations | { |
| | "subnets": 0, |
| | "dhcp_lease_duration": 86400, |
| | "dhcp_driver": "neutron.agent.linux.dhcp.Dnsmasq", |
| | "networks": 0, |
| | "log_agent_heartbeats": false, |
| | "ports": 0 |
| | } |
| created_at | 2019-12-03 17:43:37 |
| description | |
| heartbeat_timestamp | 2022-04-10 22:41:26 |
| host | controller |
| id | 245ae2f9-6220-4c00-a36d-542a746a3f9e |
| started_at | 2022-04-10 22:38:56 |
| topic | dhcp_agent |
+---------------------+----------------------------------------------------------+
cinder 是提供块存储的服务。存储的分配和消耗是由块存储驱动器或者多后端配置的驱动器决定的。还有很多驱动程序可以用:NAS/SAN、NFS、CEPH等。一般运行在openstack的控制节点上。其驱动可以运行在控制节点、计算节点或者单独的存储节点上。
cinder的核心功能是对卷的管理,允许对卷、卷的类型、卷的快照、卷备份进行处理。它为后端不同的存储设备提供了统一的接口,不同的块设备服务厂商在 cinder 中实现其驱动支持以与 OpenStack 进行整合。
1.创建云硬盘
创建一个2 GB的云硬盘extend-demo,并且查看云硬盘信息。
[root@controller ~]# cinder create --name cinder-volume-demo 2
[root@controller ~]# cinder list
2.创建云硬盘类型
创建了一个名为“lvm”的卷类型。通过cinder命令查看现有的卷类型。
[root@controller ~]# cinder type-create lvm
[root@controller ~]# cinder type-list
3.创建带标识云硬盘
创建一块带“lvm”标识名为type_test_demo的云硬盘,最后使用命令查看所创建的云硬盘。
[root@controller ~]# cinder create --name type_test_demo --volume-type lvm 1
[root@controller ~]# cinder show type_test_demo
4.删除指定的Cinder卷
[root@controller ~]# cinder delete cinder-volume-demo
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。