CN111338763A - 一种基于nova的允许卸载和挂载系统卷的方法 - Google Patents

一种基于nova的允许卸载和挂载系统卷的方法 Download PDF

Info

Publication number
CN111338763A
CN111338763A CN202010165647.5A CN202010165647A CN111338763A CN 111338763 A CN111338763 A CN 111338763A CN 202010165647 A CN202010165647 A CN 202010165647A CN 111338763 A CN111338763 A CN 111338763A
Authority
CN
China
Prior art keywords
volume
virtual machine
nova
unloaded
openstack
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010165647.5A
Other languages
English (en)
Inventor
赵磊
蔡卫卫
谢涛涛
宋伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong Huimao Electronic Port Co Ltd
Original Assignee
Shandong Huimao Electronic Port Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Huimao Electronic Port Co Ltd filed Critical Shandong Huimao Electronic Port Co Ltd
Priority to CN202010165647.5A priority Critical patent/CN111338763A/zh
Publication of CN111338763A publication Critical patent/CN111338763A/zh
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明涉及Openstack领域,具体提供了一种基于nova的允许卸载和挂载系统卷的方法。一种基于nova的允许卸载和挂载系统卷的方法,分为如下步骤:S01、部署多节点环境,规划好控制节点和计算节点;S02、更改控制节点的nova代码;S03、重启控制节点上的nova‑api服务;S04、对要卸载的虚机执行shelve操作;S05、卸载系统卷,然后挂载系统卷;S06、对虚机执行unshelve操作,检查虚机是否正常。本发明相对于现有技术来说,增强了Openstack的功能,满足了用户卸载和挂载系统卷的需求,具有良好的推广价值。

Description

一种基于nova的允许卸载和挂载系统卷的方法
技术领域
本发明涉及Openstack技术领域,具体提供了一种基于nova的允许卸载和挂载系统卷的方法。
背景技术
OpenStack是美国国家航空航天局和Rackspace合作研发的云计算软件,以Apache授权条款授权,并且是自由和开放源代码软件。它对应IaaS服务模式,作为IaaS层的云操作系统,OpenStack为虚拟机提供并管理三大类资源:计算、网络和存储。利用Openstack既可以实现公有云,也能实现私有云。Openstack中open表示各种开源软件,stack表示将它们堆在一起,实现1+1>2的功能。Openstack包含的主要服务是:
1)Compute Service:在Openstack中该服务名为Nova,它管理VM的生命周期,是OpenStack中最核心的服务。
2)NetWork Service:在Openstack中该服务名为Neutron,它为OpenStack提供网络连接服务,负责创建和管理L2、L3网络,为VM提供虚拟网络和物理网络连接。
3)Image Service:在Openstack中该服务名为Glance,它负责管理VM的启动镜像,Nova创建VM时将使用Glance提供的镜像。
4)Block Storage Service:在Openstack中该服务名为Cinder,它为VM提供块存储服务。Cinder提供的每一个Volume在VM看来就是一块虚拟硬盘,一般用作数据盘。
5)Identity Service:在Openstack中该服务名为Keystone,它为OpenStack的各种服务提供认证和权限管理服务。简单的说,OpenStack上的每一个操作都必须通过Keystone的审核。
作为Openstack中最核心的服务,Nova为虚机提供分配浮点IP、挂载/卸载网卡、更改虚机名、卸载/挂载卷、Pause、Suspend、Shelve、Resize、Reboot等功能。但是,目前使用Openstack对虚机进行操作的过程中,Nova无法实现卸载和挂载系统卷的功能,这对一些有卸载系统卷需求的用户造成了使用限制。
发明内容
本发明是针对上述现有技术的不足,提供了一种实用性强的基于nova的允许卸载和挂载系统卷的方法。
本发明解决其技术问题所采用的技术方案是:
一种基于nova的允许卸载和挂载系统卷的方法,分为如下步骤:
S01、部署多节点环境,规划好控制节点和计算节点;
S02、更改控制节点的nova代码;
S03、重启控制节点上的nova-api服务;
S04、对要卸载的虚机执行shelve操作;
S05、卸载系统卷,然后挂载系统卷;
S06、对虚机执行unshelve操作,检查虚机是否正常。
进一步的,在步骤S01中,部署Openstack环境,按功能将Openstack环境分为不同的节点。
作为优选,将Openstack环境分为控制节点、计算节点或者是存储节点。
进一步的,在步骤S02中,更改源代码更改的是虚机在shelved状态时挂载卷和卸载卷的处理逻辑。
进一步的,在步骤S02中,卸载系统卷时,再次判断虚机的状态,若虚机的状态是SHELVED_OFFLOADED,就不会报错,会完成系统盘的卸载。
进一步的,在步骤S02中,虚机是SHELVED_OFFLOADED的状态时,执行挂载操作时先判断挂载的是否是可启动卷,如果不是,直接创建卷设备映射;
如果是,扫描当前的虚机卷设备映射中是否存在系统卷对应的卷设备映射,如果不存在,令boot_index字段设置为0,卷名设置为系统盘的名称,表示要为该虚机挂载一个系统盘,此时,创建一个系统盘的卷设备映射。
进一步的,在步骤S02中,在执行unshelve操作、并且虚机是SHELVED_OFFLOADED状态后,对虚机的卷设备进行扫描,判断是否存在系统卷对应的卷设备映射,如果不存在,则报出Can't unshelve instance without a root device volume的异常。
进一步的,在执行步骤S03时,要将所有的nova-api服务全部重启。
作为优选,在步骤S05中,在使用openstack命令对虚机的卷进行挂载和卸载操作时,需要加上--os-compute-api-version选项并指定版本号为2.20。
本发明的一种基于nova的允许卸载和挂载系统卷的方法和现有技术相比,具有以下突出的有益效果:
针对目前Openstack的Nova服务不支持用户卸载和挂载系统卷的问题,本发明实现了一种基于nova的允许卸载和挂载系统卷的方法,增强了Openstack的功能,满足了用户卸载和挂载系统卷的需求。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
附图1是本发明中的卸载卷流程图;
附图2是现有技术中卸载卷流程图;
附图3是本发明中的挂载卷流程图;
附图4是现有技术中的挂载卷流程图;
附图5是本发明中的unshelve流程图;
附图6是现有技术中的unshelve流程图。
具体实施方式
为了使本技术领域的人员更好的理解本发明的方案,下面结合具体的实施方式对本发明作进一步的详细说明。显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例都属于本发明保护的范围。
下面给出一个最佳实施例:
本实施例中的基于nova的允许卸载和挂载系统卷的方法,分为如下步骤:
S01、部署多节点环境,规划好控制节点和计算节点;
S02、更改控制节点的nova代码;
S03、重启控制节点上的nova-api服务;
S04、对要卸载的虚机执行shelve操作;
S05、卸载系统卷,然后挂载系统卷;
S06、对虚机执行unshelve操作,检查虚机是否正常。
在步骤S01中,部署Openstack环境时,按功能将Openstack环境分为不同的节点,如控制节点、计算节点、存储节点等,这样做的目的是减小集群的压力,同时让集群的架构更加清晰,在后续过程中更加方便地扩展集群。
如图1、2、3、4、5、6所示,在步骤S02中,更改源码更改的是虚机在shelved状态时挂载卷和卸载卷的处理逻辑:
1)在卸载系统卷时,现有技术中的处理逻辑是如果卸载的是系统卷,就会报错,即无法卸载系统卷。而本发明的处理逻辑是如果卸载的是系统卷,再次判断虚机的状态,如果虚机的状态是SHELVED_OFFLOADED,就不会报错,会完成系统盘的卸载。
2)在挂载系统卷时,现有技术的处理逻辑是当虚机是SHELVED_OFFLOADED的状态时,执行挂载操作时直接创建卷设备映射。而本发明的处理逻辑是当虚机是SHELVED_OFFLOADED的状态时,执行挂载操作时先判断挂载的是否是可启动卷,如果不是,直接创建卷设备映射;如果是,扫描当前的虚机卷设备映射中是否存在系统卷对应的卷设备映射,如果不存在,令boot_index字段设置为0,卷名设置为系统盘的名称,表示要为该虚机挂载一个系统盘,此时,创建一个系统盘的卷设备映射。
3)在执行unshelve操作时,现有技术中的处理逻辑是要求虚机是SHELVED_OFFLOADED状态,然后交给nova-scheduler进行调度和发送消息;本发明的处理逻辑是在要求虚机是SHELVED_OFFLOADED状态后,对虚机的卷设备映射进行扫描,判断是否存在系统卷对应的卷设备映射,如果不存在,报出Can't unshelve instance without a root devicevolume的异常。
在步骤S03中,通常Openstack中的nova-api服务可能有多个来实现高可用,要将所有的nova-api服务全部重启。
在步骤S05中,在使用openstack命令对虚机的卷进行挂载和卸载操作时,需要加上--os-compute-api-version选项并指定版本号为2.20。
上述具体的实施方式仅是本发明具体的个案,本发明的专利保护范围包括但不限于上述具体的实施方式,任何符合本发明的权利要求书的基于nova的允许卸载和挂载系统卷的方法且任何所述技术领域普通技术人员对其做出的适当变化或者替换,皆应落入本发明的专利保护范围。
尽管已经示出和描述了本发明的实施例,对于本领域的普通技术人员而言,可以理解在不脱离本发明的原理和精神的情况下可以对这些实施例进行多种变化、修改、替换和变型,本发明的范围由所附权利要求及其等同物限定。

Claims (9)

1.一种基于nova的允许卸载和挂载系统卷的方法,其特征在于,分为如下步骤:
S01、部署多节点环境,规划好控制节点和计算节点;
S02、更改控制节点的nova代码;
S03、重启控制节点上的nova-api服务;
S04、对要卸载的虚机执行shelve操作;
S05、卸载系统卷,然后挂载系统卷;
S06、对虚机执行unshelve操作,检查虚机是否正常。
2.根据权利要求1所述的一种基于nova的允许卸载和挂载系统卷的方法,其特征在于,在步骤S01中,部署Openstack环境,按功能将Openstack环境分为不同的节点。
3.根据权利要求2所述的一种基于nova的允许卸载和挂载系统卷的方法,其特征在于,将Openstack环境分为控制节点、计算节点或者是存储节点。
4.根据权利要求2或3所述的一种基于nova的允许卸载和挂载系统卷的方法,其特征在于,在步骤S02中,更改源代码更改的是虚机在shelved状态时挂载卷和卸载卷的处理逻辑。
5.根据权利要求4所述的一种基于nova的允许卸载和挂载系统卷的方法,其特征在于,在步骤S02中,卸载系统卷时,再次判断虚机的状态,若虚机的状态是SHELVED_OFFLOADED,就不会报错,会完成系统盘的卸载。
6.根据权利要求5所述的一种基于nova的允许卸载和挂载系统卷的方法,其特征在于,在步骤S02中,虚机是SHELVED_OFFLOADED的状态时,执行挂载操作时先判断挂载的是否是可启动卷,如果不是,直接创建卷设备映射;
如果是,扫描当前的虚机卷设备映射中是否存在系统卷对应的卷设备映射,如果不存在,令boot_index字段设置为0,卷名设置为系统盘的名称,表示要为该虚机挂载一个系统盘,此时,创建一个系统盘的卷设备映射。
7.根据权利要求6所述的一种基于nova的允许卸载和挂载系统卷的方法,其特征在于,在步骤S02中,在执行unshelve操作、并且虚机是SHELVED_OFFLOADED状态后,对虚机的卷设备进行扫描,判断是否存在系统卷对应的卷设备映射,如果不存在,则报出Can't unshelveinstance without a root device volume的异常。
8.根据权利要求7所述的一种基于nova的允许卸载和挂载系统卷的方法,其特征在于,在执行步骤S03时,要将所有的nova-api服务全部重启。
9.根据权利要求8所述的一种基于nova的允许卸载和挂载系统卷的方法,其特征在于,在步骤S05中,在使用openstack命令对虚机的卷进行挂载和卸载操作时,需要加上--os-compute-api-version选项并指定版本号为2.20。
CN202010165647.5A 2020-03-11 2020-03-11 一种基于nova的允许卸载和挂载系统卷的方法 Pending CN111338763A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010165647.5A CN111338763A (zh) 2020-03-11 2020-03-11 一种基于nova的允许卸载和挂载系统卷的方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010165647.5A CN111338763A (zh) 2020-03-11 2020-03-11 一种基于nova的允许卸载和挂载系统卷的方法

Publications (1)

Publication Number Publication Date
CN111338763A true CN111338763A (zh) 2020-06-26

Family

ID=71185982

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010165647.5A Pending CN111338763A (zh) 2020-03-11 2020-03-11 一种基于nova的允许卸载和挂载系统卷的方法

Country Status (1)

Country Link
CN (1) CN111338763A (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112000440A (zh) * 2020-08-24 2020-11-27 浪潮云信息技术股份公司 一种基于云平台的多启动卷虚拟机启动顺序变更方法

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160048408A1 (en) * 2014-08-13 2016-02-18 OneCloud Labs, Inc. Replication of virtualized infrastructure within distributed computing environments
CN106708748A (zh) * 2016-12-21 2017-05-24 南京富士通南大软件技术有限公司 提高OpenStack块存储卷挂载性能的方法及系统
CN109254825A (zh) * 2017-07-12 2019-01-22 中兴通讯股份有限公司 一种纳管虚拟机硬盘的方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160048408A1 (en) * 2014-08-13 2016-02-18 OneCloud Labs, Inc. Replication of virtualized infrastructure within distributed computing environments
CN106708748A (zh) * 2016-12-21 2017-05-24 南京富士通南大软件技术有限公司 提高OpenStack块存储卷挂载性能的方法及系统
CN109254825A (zh) * 2017-07-12 2019-01-22 中兴通讯股份有限公司 一种纳管虚拟机硬盘的方法及装置

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
OPENSTACK官方: "Detach and attach boot volumes", 《OPENSTACK DOCUMENTATION》 *
管增辉,曾凡浪: "《OpenStack架构分析与实践》", 31 December 2018, 中国铁道出版社 *
青岛英谷教育科技股份有限公司: "《云计算框架与应用》", 28 February 2019, 西安电子科技大学出版社 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112000440A (zh) * 2020-08-24 2020-11-27 浪潮云信息技术股份公司 一种基于云平台的多启动卷虚拟机启动顺序变更方法

Similar Documents

Publication Publication Date Title
US20210004258A1 (en) Method and Apparatus for Creating Virtual Machine
US10372435B2 (en) System, method and program product for updating virtual machine images
US9946578B2 (en) Managing the persistent data of a pre-installed application in an elastic virtual machine instance
US8104038B1 (en) Matching descriptions of resources with workload requirements
US20180253246A1 (en) Method and system for memory allocation in a disaggregated memory architecture
US20200356402A1 (en) Method and apparatus for deploying virtualized network element device
CN109564524A (zh) 虚拟化管理器的安全引导
CN109564514A (zh) 部分卸载的虚拟化管理器中的存储器分配技术
US20170140315A1 (en) Managing incident tickets in a cloud managed service environment
US11463306B2 (en) Fast provisioning in cloud computing environments
US20180307539A1 (en) Allocating Hosts For Instances With Anti Affinity Rule
CN108132827B (zh) 一种网络切片资源映射方法、相关设备及系统
US20210149699A1 (en) Dynamic Flavor Allocation
US11372549B2 (en) Reclaiming free space in a storage system
US20230342183A1 (en) Management method and apparatus for container cluster
CN111045802B (zh) Redis集群组件调度系统及方法、平台设备
CN111338763A (zh) 一种基于nova的允许卸载和挂载系统卷的方法
EP4006725A1 (en) Virtual machine migration processing and strategy generation method, apparatus and device, and storage medium
CN111831393A (zh) 一种管理虚拟机的方法、一种服务器和存储介质
US11200070B2 (en) Dynamic-link library usage based on memory size
US11483205B1 (en) Defragmentation of licensed resources in a provider network
CN116166413A (zh) 针对异构基础设施上的工作负载的生命周期管理
US10606681B2 (en) Incremental dump with fast reboot
US20230244528A1 (en) Service update management
US20240012631A1 (en) Remediation engine for updating desired state of inventory data to be replicated across multiple software-defined data centers

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200626

RJ01 Rejection of invention patent application after publication