OpenStack Nova Release(Rocky to Train)

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/Jmilk/article/details/102461326

目录

前言

在今年(2019)的 9 月 22 号,笔者去参加了 OpenStack Q3 的 Meetup。这次 Meetup 的主题是技术,地点在北京,自然是没有错过的可能。本文主要是对大名鼎鼎的徐 Core 所做的演讲(OpenStack Nova Project Update (Rocky to Train))的一次学习总结与整理。

演进方向

早前,我在《OpenStack 2018 年终盘点》一文中提到过:OPQ 这三个版本的工作重心是稳定性、易用性和运维能力的提升。那么 RST 就是此之上围绕着 Placement 参与到 Nova Scheduling 以及 Cellv2 的操作优化来展开。前者是从 Nova 孵化出来的一个全局的(集中式)资源登记与追踪 API(This is a REST API stack and data model used to track resource provider inventories and usages, along with different classes of resources.),自 Newton 引入,自 Stein 独立,详细可见 《OpenStack Placement Project》一文。

下文中归纳为 Cellv2、Nova Scheduling、NFV、可用性、API 以及 U release 展望等 6 个方面的功能更新。

Cellv2 更新

Rocky

Support disabling a cell

支持执行 Cell 级别(以往只支持 Host 级别)的 Disable,新的请求不会发送到 Disabled Cell。

应用场景:运维人员可以 Disable 掉指定的 Cell,并对其进行管理和运维的工作。

nova-manage cell_v2 --update_cell --cell_uuid <cell_uuid> [--disable]

kill –s SIGHUP <nova-scheduler pid>

NOTE:在 Disabled Cell 之后要对 nova-scheduler service 发一个挂起的信号,让 nova-scheduler service 刷新并 Cache 可用的 Cells。

Stein

Handling a down cell

显示已经 Down 掉的 Cell 中最起码的 Instances 信息(Show minimal info than ignore the instance in the down cell.),例如:UUID、Flavor 等。以此提升用户的操作体验。

Train

Count quota usage from placement

以往 User/Project 的 Quota 信息是持久化到 Cell DB 中的,这就导致了 Disabled Cell 之后会丢失一部分的 Quota 信息。所以将这个 Quota 信息持久化到全局的 Placement API 中,可以解决这个问题。

NOTE:该功能可以通过配置选项 CONF.quota.count_usage_from_placement 来主动开启,默认为 False。在 multiple deployments share same placement(边界)场景中建议关闭,因为 Placement 现在不支持分区域,所以会导致 Quota 计算重复累加;在 Placement 滚动升级场景中建议关闭,因为如果开启的话,那么 Nova API 会先检查一下 Placement 的 Data Migration 是否完成并支持 Count quota usage,如果不支持则 fallback(回退)到查 Cell DB 的方式。这个过程中存在性能损耗,建议都升级完成后开启。

Nova Scheduling 更新

Rocky

Complex Anti-Affinity Policies

以往 Anti-Affinity Server Group 中的每台计算节点上都分别只能启动一个 Instance,现在通过 max_server_per_host 参数,可以设置 Server Group 中每台计算节点上最大的允许启动的 Instances 数量。

Report CPU features to the placement service

支持将计算节点的 CPU features 上报到 Placement,结合 Placement Traits 功能可以实现更加细致的(根据特征的)调度策略。

应用场景:某些虚拟机上运行的应用程序需要指定的 CPU features,那么就应该在 Flavor 上指定 Placement Traits 属性(e.g. HW_CPU_X86_AVX512VNNI)。

NOTE:暂时只支持 Libvirt Driver。

Support traits in Glance

以往只能在 Flavor 上支持自定义 Placement Traits 属性,现在在 Glance Image metadata 上也支持了。

应用场景:同理,如果某些镜像中已有的应用程序对运行环境有特殊要求,就可以为其设定 Placement Traits 属性(e.g. trait:HW_CPU_X86_AVX512VNNI=required)。当然了,前提是 Placement 已经登记了这个 Traits。

Stein

Network Bandwidth resource provider

支持创建具有最小 OvS/SR-IOV 带宽的虚拟机,借助于 Placement,将网络带宽作为一种 Resource Provider 进行登记和追踪。现在支持的功能以及使用条件都有很多限制(e.g. 不支持热迁移),但无碍为一个值得关注的功能。

应用场景:在 NFV、边缘计算等对最小带宽有要求的环境中使用。

文档:https://specs.openstack.org/openstack/nova-specs/specs/rocky/approved/bandwidth-resource-provider.html

Per aggregate scheduling weight

以往 Scheduler weight 的设置 CONF.scheduler.*_weight_multiplier 是全局的,但现在支持 Host Aggregate 级别的更细粒度的 weight 设置,通过 aggregate metadata 来实现。

Expose compute capabilities as traits

支持将 Compute Capabilities(计算能力)上报为 Placement traits 属性。

应用场景:在 Multi-Hypervisor 类型场景中会很有用,例如:在 KVM & VMware 异构资源池的环境中,两种 Hypervisor 类型的计算能力是不一样的。现在同样支持通过为 Flavor 或 Image metadata 设定 Placement traits 属性来选择目标 Hypervisor。

Train

Request Filter for Image Types

添加了 Image Type Scheduler Filter,针对特定的 image type 来调度 Instance 到匹配的 Hypervisor 资源池。依赖于 Expose compute capabilities as traits 功能,Hypervisor 会上报自己支持的 Image Types 并自动生成相应的 Placement traits 属性(e.g. COMPUTE_IMAGE_TYPE_QCOW2)。

应用场景:在 Multi-Hypervisor 场景中无需再将 Image 都统一为 ROW 格式,得以保持 Image 的特色功能。

Standard CPU resources tracking

支持更加可自定义的 CPU Resource Tracker,或者说更加可自定义的 CPU 绑定策略,即:指定计算节点中能够被 share 的 pCPUs,指定计算节点中能够被 dedicate 的 pCPUs。后续社区还会考虑支持创建同时存在两种 CPU 策略的虚拟机。

  • CONF.compute.shared_cpu_set
  • CONF.compute.dedicated_cpu_set

应用场景:以往针对这个问题,会建议划分不同的计算节点资源池,例如:CPU 共享的计算节点资源池、CPU 绑定的计算节点资源池。以此来避免 pCPU 资源的使用超脱预期。有了 Standard CPU resources tracking 之后,就多了一种在计算节点层面进行 CPU 资源池类型划分的方式。

NOTE:在 Nova 滚动升级场景中同样会存在 Data Migration 的问题,建议在升级过程开启 CONF.workaround.disable_fallback_pcpu_query,设置为 False,这样的话 Nova 就是先查 pCPU,若没有则自动 fallback 到查 vCPU,不至于一直创建 dedicate 的虚拟机失败。直到全部节点的 Data Migration 完成后再配置为 True。

Telco/NFV 更新

Rocky

Trusted Virtual Functions

以往是不支持在 GuestOS 层面修改 VF 的 MAC 地址的,直到 Linux Kernel 支持 Trusted Virtual Functions 特性。用户操作层面,只需要在 PF 的白名单中,标记 Trusted 的 VFs,然后在创建 Port 的时候在 binding:profile 中标记使用 Trusted VFs 即可。从 Port 创建该虚拟机的时候会调度到具有 Trusted PF/VFs 的计算节点上。

应用场景:为一个 Instance 透传两个 VFs,并且将它们做成一个 Binding。

Stein

Support High Precision Event Timer (HPET) on x86 guests

支持 Guest 层面的高精度的计时器。在 Image metadata 设置 hw_time_hpet=True 即可。

应用场景:面向边缘计算中对实时性要求高的虚拟机。

Generic os-vif datapath offloads

vRouter Hardware Offload Enablement

Train

Virtual Persistent Memory

现在支持将持久化内存 PCI-e 透传给虚拟机。即:支持虚拟化持久化内存。持久化内存,即:ROM,掉电不丢失,容量大,但速度较 RAM 慢。实现方式是配置持久化内存的 namespace(理解为分区)配置为 nova,然后 Nova 就可以发现并将其作为一个 Resource Provider 以及 Traits 上报给 Placement。e.g.

hw:pmem = $LABEL[,$LABEL]

CONF.libvirt.pmem_namespaces = "$LABEL:$NSNAME[|$NSNAME][,$LABEL:$NSNAME[|$NSNAME]]”

应用场景:用作 Redis 等 DB 的 Cache。

NOTE:暂不支持热迁移,不支持 NUMA 亲和。

NUMA Live migration

支持对 NUMA Instance 进行热迁移。以往对 NUMA Instance 进行热迁移的时候,没有重新计算 InstanceNUMATopology,现在改进了这一缺陷。如果用户希望在 Rocky 版本中使用该功能,可以通过配置 CONF.workaround.enable_numa_live_migration 开启,否则直接返回错误。

文档:https://specs.openstack.org/openstack/nova-specs/specs/rocky/approved/numa-aware-live-migration.html

Add Support for live migration with neutron sriov vnic types

支持对 SR-IOV Instance 进行热迁移。

  • Indirect mode(间接模式):通过 macvtap 来进行转接(具有虚拟 MAC 地址),支持 Hypervisor(Libvirt)层面的热迁移,但性能肯定有损失(20%-30%)。实现方式是:Nova 会先到目的节点上获取 VF 的 MAC 地址等信息,然后重新生成 XML 并在目的节点上启动。

  • direct mode(直接模式):即透传,不支持 Hypervisor(Libvirt)层面的热迁移。因为此类虚拟机的迁移需要从源节点卸载 SR-IOV vNIC、再到目的节点挂载(只有物理 MAC 地址),显然就导致了网络的中断。workaround 的方式是:在热迁移前,先挂在一个 vSwitch vNIC,然后再进行热迁移,由这个 vSwitch vNIC 来承接 SR-IOV vNIC 断掉的流量。

Tenant control of qemu performance monitoring unit

可用性(Usability)更新

Rocky

Use Neutron’s new port binding API

Nova 使用了新的 Neutron Port Binding API。以往虚拟机热迁移是虚拟机数据迁移完之后再进行 Port Binding,现在支持在迁移虚拟机数据之前进行 Port Binding,这样做有效的优化了:

  • Knowing the port binding failed early:无需再等待到虚拟机数据迁移完才只知道 Port Binding 失败。
  • minimal network downtime:更小的网络中断时长。
  • migrate between different ml2 backends:支持在不同的 ML2 backends(openvswitch、linuxbridge)中进行迁移。

Stein

Default allocation ratio configuration

支持默认的 CPU、RAM、Disk 分配超分比。当前支持 nova.conf 和 Placement API 两种方式来修改 allocation ratio,但是后者的数值会被前者覆盖。所以由添加了 3 个新的 Default allocation ratio configuration,代表初始的数值,以此来代替了原来 nova.conf 的 3 个配置选项的作用。这样做之后,对 nova.conf 的修改和 Placement API 的修改就不会互相影响了,当以下三个选项配置为 None 之后,Nova 就只关心 Placement 的数值了。

  • initial_cpu_allocation_ratio
  • initial_ram_allocation_ratio
  • initial_disk_allocation_ratio

Live-Migration force after timeout

虚拟机热迁移支持 force_complete,所谓 force_complete 有两种情况:

  1. Disable Port-Copy Live-Migration:超时,则立即强制暂定 Instance,然后快速热迁移。
  2. Enable Post-Copy Live-Migration:将 Live-Migration 从 Pre-Copy 转换为 Post-Copy 模式。

相关配置:

  • CONF. libvirt.live_migration_timeout_action = abort/force_complete
  • CONF.libvirt.live_migration_completion_timeout

应用场景:针对处理那些数据安全性要求不高,但是内存数据刷新量大导致无法完成热迁移的虚拟机。

Train

Select cpu model from a list of cpu models

支持配置启动 Instance 的 CPU model 的列表,即 cpu_models:

  • Replace CONF.libvirt.cpu_model to CONF.libvirt.cpu_models
  • default choice the first cpu model in the list of CONF.libvirt.cpu_models.
  • With required CPU traits, will choice the first cpu model support that CPU traits.

应用场景:针对 Live-Migration 要求的 Instance CPU model 向下兼容的问题。以往为了降低向下兼容的失败率,所以用户会刻意的将计算节点的 CPU model 配置为最低级别,这就导致一些具有高级 CPU 功能的计算节点发挥不出应有的功效。现在支持 CPU model 列表后,就可以按照 CPU 功能的复杂度依次递增,顺序填写。在对 CPU model 没有要求的情况下,Nova 默认会使用最低级别的 CPU model 来启动 Instance,以此来保证 Instance Live-Migration 的成功率最高。而当希望创建具有高级别的 CPU model 的 Instance 时,则可以通过 Placement Traits 来设定,并进行调度。虚拟机的创建更加灵活了。

API 更新

Rocky

  • Boot instance specific storage backend:支持指定 cinder volume type 来创建虚拟机。
  • Expose virtual device tags in REST API

Stein

  • Remove force flag from live-migrate and evacuate
  • show which server group a server is in “nova show”
  • Support to query nova resources filter by changes-before
  • Support adding description while locking an instance

Train

  • Support for specifying AZ when restore a shelved server
  • Show server numa_topology:支持查看计算节点的 HostNUMATopology。
  • Support config delete_on_termination in server attach volume:支持指定是否要一并删除在线 Attached 的 Volumes。以往在线 Attached Volumes 是不可以被一并删除的。

Others

Rocky

Enhanced KVM Storage QoS

支持 cinder frontend QoS。

Libvirt file backed memory

支持文件类型的持久化内存。配置方式:[libvirt]/file_backed_memory specifies the available capacity in MiB for file backed memory, at the directory configured for memory_backing_dir in libvirt’s qemu.conf.

应用场景:针对追求内存容量而不追求内存速度的场景,是 HPC 用户的需求。

NOTE

  • only can migrate to the host with file backed memory also.
  • can’t overcommit memory

Support for virtio-net rx/tx queue sizes

支持设置 virtio-net 收发队列的大小。配置方式:CONF.libvirt.rx_queue_size/CONF.libvirt.tx_queue_size for vhost/vhostuser

Per-instance serial number

支持虚拟机使用计算节点的 serial number 来作为 instance UUID,配置方式:flavor extra spec hw_unique_serial = True

NOTE:显然,同一计算节点上的 Instances 的 UUID 都是一致的。

应用场景:针对在虚拟机上运行授权软件的场景。

zVM supports

支持 zVM Hypervisor 类型。

Stein

live migraiton support for VMware

支持 VMware VM 的热迁移。

U release 展望

  • Nova NUMA in Placement:通过 Placement 来完成 NUMA 调度,为了支持 vGPU、vPMEM 的 NUMA 亲和性。
  • Nova-Cyborg integration:完成 Nova 和 Cyborg 的集成。
  • Virtual Persistent memory Live migration:虚拟化持久化内存支持热迁移。
  • Mixed dedicated and shared CPU into single instance:支持创建 dedicated/shared CPU 策略共存的虚拟机。
  • Move vGPU into new resource claim framework:将 vGPU 资源加入到新的 Instance Claim 框架,解决并发请求冲突的问题。
  • PCI/SRIOV device management into new resource claim framework, but may not in U.

猜你喜欢

转载自blog.csdn.net/Jmilk/article/details/102461326