CN111708677A - 一种云计算环境下的云硬盘使用量采集方法 - Google Patents

一种云计算环境下的云硬盘使用量采集方法 Download PDF

Info

Publication number
CN111708677A
CN111708677A CN202010562966.XA CN202010562966A CN111708677A CN 111708677 A CN111708677 A CN 111708677A CN 202010562966 A CN202010562966 A CN 202010562966A CN 111708677 A CN111708677 A CN 111708677A
Authority
CN
China
Prior art keywords
data
virtual machine
cloud
acquisition
hard disk
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.)
Granted
Application number
CN202010562966.XA
Other languages
English (en)
Other versions
CN111708677B (zh
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.)
Inspur Cloud Information Technology Co Ltd
Original Assignee
Inspur Cloud Information Technology 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 Inspur Cloud Information Technology Co Ltd filed Critical Inspur Cloud Information Technology Co Ltd
Priority to CN202010562966.XA priority Critical patent/CN111708677B/zh
Publication of CN111708677A publication Critical patent/CN111708677A/zh
Application granted granted Critical
Publication of CN111708677B publication Critical patent/CN111708677B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3034Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a storage system, e.g. DASD based or network based
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/301Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is a virtual computing platform, e.g. logically partitioned systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
    • G06F11/3093Configuration details thereof, e.g. installation, enabling, spatial arrangement of the probes
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本发明提供一种云计算环境下的云硬盘使用量采集方法,属于云计算运营计费、运维监控技术领域,本发明通过在采集机上部署自动化运维工具ansible来调用虚拟化层的libvirt接口采集虚机配置信息,通过自动登录FCSAN存储管理台采集磁盘使用量信息,将两者数据进行整合处理,就得到了云硬盘的实际使用量,再和已有的租户信息进行关联,就得到了租户粒度的云硬盘实际使用量,满足了计费和监控对数据的需求。

Description

一种云计算环境下的云硬盘使用量采集方法
技术领域
本发明涉及云计算运营计费、运维监控技术,尤其涉及一种云计算环境下的云硬盘使用量采集方法。
背景技术
随着云计算的发展,基于IaaS、PaaS和SaaS的服务应用越来越广泛,他们为各行各业不同的用户提供持续稳定的云计算服务。越来越多的公司将他们的计算与存储相关的需求服务上云。但由于各公司的需求和使用场景各不相同,因此对于不同用户实现差异化计费的需求日益突出。这就要求云服务商要准确、快速的收集计费收据,如使用的硬件资源、网络服务等来计算服务费用。
针对FCSAN存储架构实际使用量指标,由于FCSAN G2平台没有提供公用的磁盘使用量数据接口,导致磁盘阵列类型的云硬盘的实际使用量指标无法获取。
目前的现有技术存在以下几个难点:
1)云中心为用户开的虚机,只有用户有权限登录使用,云服务商无法登录,不能部署数据agent。
2)虚机配置信息变动,信息更新不及时。
发明内容
为了解决以上技术问题,本发明提供了一种云计算环境下的云硬盘使用量采集方法,实现了对磁盘阵列类型的云硬盘的实际使用量指标采集的功能,用来满足计费和监控的数据需求。
本发明的技术方案是:
一种云计算环境下的云硬盘使用量采集方法,包括如下步骤:
a)在采集机上部署自动化运维工具ansible来调用libvirt接口采集虚机配置信息,其中包含了云硬盘的配置信息;
b)自动登录FCSAN存储管理台采集云磁盘的使用量数据;
c)将两者数据进行整合处理,可以得到虚机使用的云硬盘的实际使用量,再和已有的租户信息进行管联,就可以得到租户粒度的云硬盘实际使用量。
进一步的,
采集机有三个功能模块:数据采集模块、解析处理模块、入库模块。要求网络既能和FCSAN管理平台相通,又要和宿主机相通。
采集模块包括FCSAN数据采集、虚机配置采集。
分析模块分析上述两部分数据,通过关键字将2部分数据关联起来。
入库模块将结果数据入库,再和其他数据表关联把租户等信息补全。
进一步的,所述虚机配置信息采集特征
虚机运行在宿主机上,每个宿主机一般开多个虚机。虚机的配置需要在宿主机上遍历各个虚机进行采集。主要步骤如下:
a)采集机部署ansible工具和所有宿主机配置好互信关系。配置/etc/ansible/hosts文件,把所有宿主机的IP配置到[compute]规则下。
b)通过ansible在所有宿主机上先执行virsh list列出所有的虚机,然后针对每个虚机再执行:virsh dumpxml采集这个虚机的配置数据。
c)虚机配置数据返回结果是xml格式的。<disk></disk>部分就是磁盘数据,如下所示:
Figure BDA0002546768060000021
Figure BDA0002546768060000031
其中target dev是云硬盘名称,<serial>云硬盘的唯一id,用来和FCSAN数据作关联。
进一步的,所述云硬盘使用量采集特征
FCSAN采集通过linux环境下的expect工具实现自动ssh登录管理台,使用管理台自带的管理命令采集使用量数据。
FCSAN采集到的原始数据包含如下关键字段:vdisk_id,vdisk_name,capacity,used_capacity,real_capacity,free_capacity。其中vdisk_id是在FCSAN系统里的唯一id,vdisk_name是云硬盘id,这个字段用来和虚机配置数据进行关联。
两部分的数据关联之后的数据模型如下:
Figure BDA0002546768060000032
上表中订单容量就是申请虚机时申请的磁盘容量,真实容量就是在精简制备模式下,物理存储上实际占用的容量。
本发明的有益效果是
不需要登录租户的虚机,不需要在虚机上安装其他采集Agent服务,部署轻量化运行高效;本方法可以定时运行,也可以供其他模块远程调用,满足了云服务商在资源用量维度上的计费需求。
附图说明
图1是本发明在云环境中的位置;
图2是采集虚机流程图;
图3是FCSAN磁盘卷信息采集流程图;
图4是采集数据流图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例,基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明通过在采集机上部署自动化运维工具ansible来调用虚拟化层的libvirt接口采集虚机配置信息,通过自动登录FCSAN存储管理台采集磁盘使用量信息,将两者数据进行整合处理,就得到了云硬盘的实际使用量,再和已有的租户信息进行关联,就得到了租户粒度的云硬盘实际使用量,满足了计费和监控对数据的需求。
首先部署一台linux服务器作为部署本产品的运行环境,称作采集机。配置要求:CPU 8核,内存16G,系统盘容量100G,数据盘容量200G。网络要求既要和宿主机通,又要和FCSAN管理台通。
安装ansible、mysql、expect、perl工具。
配置ansible的配置文件:/etc/ansible/hosts,把所有宿主机添加进去并配置秘钥。配置完验证是否可以免密登录。
上传采集压缩包,并修改配置文件中的:数据库配置、FCSAN登录账号。手工执行采集脚本,验证采集、入库是否正常。
验证正常后,把采集程序的shell脚本添加到crontab自动执行。
本采集方法,框架使用shell脚本开发,用到了ansible、expect等自动化工具,分析过程使用perl作文本解析,利用虚拟化层现有的libvirt API接口,可以定时自动执行,也可以被其他模块调用,整个采集轻量化、执行效率高、安装移植方便,可以满足秒级的采集周期,为运营计费、运维监控提供了基础数据。
如图1所示,本发明属于云管平台运维模块的一个子模块,A接口调用虚拟化层的libvirt接口采集虚机配置信息;B接口调用FCSAN存储操作系统的接口,采集磁盘的使用量数据。
如图2所示,虚机配置数据采集接口需要事先安装部署ansible工具,然后配置好与所有宿主机的信任关系,就可以在所有宿主机上自动执行获取虚机的配置命令:virshdumpxml instance。数据采集后经过解析,入库到云管数据库。
FCSAN存储有专门的储操作系统,并自带管理软件。如图3所示,本发明方法自动ssh登录浪潮G2管理台,自动执行采集命令:mcsinq lssevdiskcopy-delim,数据经过分析处理后,得到volume粒度的使用量信息,入库到云管数据库。
两个接口采集到的原始数据,需要作处理和关联,如图4数据流图所示,FCSAN采集到的数据是csv格式,需要筛选出带volume关键字的使用量、总容量数据。虚机配置信息是xml格式的,里面含有虚机的所有配置信息,需要筛选出disk磁盘信息和虚机id。
FCSAN数据volume-后面的id和虚机磁盘的serialid是一致的。通过这个id将两部分数据关联。再利用虚机id,和租户信息表关联,就能得到:租户、虚机、磁盘、使用量这几个关键信息。最终的数据保存在数据库,供运维/运营平台使用。
以上所述仅为本发明的较佳实施例,仅用于说明本发明的技术方案,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所做的任何修改、等同替换、改进等,均包含在本发明的保护范围内。

Claims (8)

1.一种云计算环境下的云硬盘使用量采集方法,其特征在于,
1)在采集机上部署自动化运维工具ansible来调用libvirt接口采集虚机配置信息,其中包含云硬盘的配置信息;
2)自动登录FCSAN存储管理台采集云磁盘的使用量数据;
3)将两者数据进行整合处理,得到虚机使用的云硬盘的实际使用量,再和已有的租户信息进行管联,得到租户粒度的云硬盘实际使用量。
2.根据权利要求1所述的方法,其特征在于,
在采集机上设置三个功能模块:数据采集模块、解析处理模块、入库模块;要求网络既能和FCSAN管理平台相通,又要和宿主机相通。
3.根据权利要求1所述的方法,其特征在于,
其中,
采集模块包括FCSAN数据采集、虚机配置采集;
分析模块分析上述两部分数据,通过关键字将两部分数据关联起来;
入库模块将结果数据入库,再和其他数据表关联把信息补全。
4.根据权利要求1所述的方法,其特征在于:
虚机配置信息采集特征
虚机运行在宿主机上,每个宿主机开一个以上的虚机;虚机的配置需要在宿主机上遍历各个虚机进行采集。
5.根据权利要求4所述的方法,其特征在于,
主要步骤如下:
采集机部署ansible工具和所有宿主机配置好互信关系;配置/etc/ansible/hosts文件,把所有宿主机的IP配置到[compute]规则下;
通过ansible在所有宿主机上先执行virsh list列出所有的虚机,然后针对每个虚机再执行:virsh dumpxml采集这个虚机的配置数据;
虚机配置数据返回结果是xml格式。
6.根据权利要求4所述的方法,其特征在于,
云硬盘使用量采集特征
FCSAN采集通过linux环境下的expect工具实现自动ssh登录管理台,使用管理台自带的管理命令采集使用量数据。
7.根据权利要求5所述的方法,其特征在于,
FCSAN采集到的原始数据包含如下关键字段:vdisk_id,vdisk_name,capacity,used_capacity,real_capacity,free_capacity;其中vdisk_id是在FCSAN系统里的唯一id,vdisk_name是云硬盘id,这个字段用来和虚机配置数据进行关联。
8.根据权利要求6所述的方法,其特征在于,
两部分的数据关联之后,再利用虚机id,和租户信息表关联,就能得到:租户、虚机、磁盘、使用量的关键信息;最终的数据保存在数据库,供运维/运营平台使用。
CN202010562966.XA 2020-06-19 2020-06-19 一种云计算环境下的云硬盘使用量采集方法 Active CN111708677B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010562966.XA CN111708677B (zh) 2020-06-19 2020-06-19 一种云计算环境下的云硬盘使用量采集方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010562966.XA CN111708677B (zh) 2020-06-19 2020-06-19 一种云计算环境下的云硬盘使用量采集方法

Publications (2)

Publication Number Publication Date
CN111708677A true CN111708677A (zh) 2020-09-25
CN111708677B CN111708677B (zh) 2023-07-07

Family

ID=72542031

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010562966.XA Active CN111708677B (zh) 2020-06-19 2020-06-19 一种云计算环境下的云硬盘使用量采集方法

Country Status (1)

Country Link
CN (1) CN111708677B (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112257040A (zh) * 2020-10-19 2021-01-22 久盈世纪(北京)科技有限公司 一种基于ssh协议实现对目标机运维的方法、系统与设备

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130179563A1 (en) * 2012-01-05 2013-07-11 Hitachi, Ltd. Information system, computer and method for identifying cause of phenomenon
CN103984619A (zh) * 2014-06-06 2014-08-13 山东超越数控电子有限公司 一种网络存储系统性能监测方法
US20160099844A1 (en) * 2014-10-02 2016-04-07 Pure Storage, Inc. Cloud assist for storage systems
US9454539B1 (en) * 2013-03-13 2016-09-27 Ca, Inc. System and method for protecting operating system zones
DE202016008054U1 (de) * 2015-11-13 2017-02-16 Google Inc. Leistungsüberwachung in einem verteilten Speichersystem
CN108228422A (zh) * 2017-12-29 2018-06-29 佛山市幻云科技有限公司 存储型服务器管理系统与方法
US10083100B1 (en) * 2017-11-30 2018-09-25 Hitachi, Ltd. Storage system and control software deployment method
US20180373615A1 (en) * 2017-06-23 2018-12-27 Linkedin Corporation Tunable, efficient monitoring of capacity usage in distributed storage systems
US20190163759A1 (en) * 2017-11-29 2019-05-30 International Business Machines Corporation Predicting storage requirements of a database management system based on application behavior and behavior of database queries

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130179563A1 (en) * 2012-01-05 2013-07-11 Hitachi, Ltd. Information system, computer and method for identifying cause of phenomenon
US9454539B1 (en) * 2013-03-13 2016-09-27 Ca, Inc. System and method for protecting operating system zones
CN103984619A (zh) * 2014-06-06 2014-08-13 山东超越数控电子有限公司 一种网络存储系统性能监测方法
US20160099844A1 (en) * 2014-10-02 2016-04-07 Pure Storage, Inc. Cloud assist for storage systems
DE202016008054U1 (de) * 2015-11-13 2017-02-16 Google Inc. Leistungsüberwachung in einem verteilten Speichersystem
US20180373615A1 (en) * 2017-06-23 2018-12-27 Linkedin Corporation Tunable, efficient monitoring of capacity usage in distributed storage systems
US20190163759A1 (en) * 2017-11-29 2019-05-30 International Business Machines Corporation Predicting storage requirements of a database management system based on application behavior and behavior of database queries
US10083100B1 (en) * 2017-11-30 2018-09-25 Hitachi, Ltd. Storage system and control software deployment method
CN108228422A (zh) * 2017-12-29 2018-06-29 佛山市幻云科技有限公司 存储型服务器管理系统与方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112257040A (zh) * 2020-10-19 2021-01-22 久盈世纪(北京)科技有限公司 一种基于ssh协议实现对目标机运维的方法、系统与设备

Also Published As

Publication number Publication date
CN111708677B (zh) 2023-07-07

Similar Documents

Publication Publication Date Title
WO2020253347A1 (zh) 一种容器集群管理方法、装置及系统
US20210311858A1 (en) System and method for providing a test manager for use with a mainframe rehosting platform
CN107995169B (zh) 一种基于微服务架构的手机游戏服务端框架系统
US7502850B2 (en) Verifying resource functionality before use by a grid job submitted to a grid environment
US9781020B2 (en) Deploying applications in a networked computing environment
US8909769B2 (en) Determining optimal component location in a networked computing environment
US8868749B2 (en) Workload placement on an optimal platform in a networked computing environment
US10158743B2 (en) Compute node cluster management
CN110245078A (zh) 一种软件的压力测试方法、装置、存储介质和服务器
US11500713B2 (en) Methods and systems that rank and display log/event messages and transactions
CN103763117A (zh) 服务和运营管理系统
US11055568B2 (en) Method and system that measure application response time
Chung et al. Unearthing inter-job dependencies for better cluster scheduling
US20210286647A1 (en) Embedded persistent queue
CN111984505A (zh) 一种运维数据采集引擎及采集方法
Li et al. Research and application of server cluster load balancing technology
US11184251B2 (en) Data center cartography bootstrapping from process table data
CN111708677B (zh) 一种云计算环境下的云硬盘使用量采集方法
EP4152715A1 (en) Method and apparatus for determining resource configuration of cloud service system
US20160036632A1 (en) Computer system
CN110650063A (zh) 一种集中式的银行第三方软件仿真系统及方法
US12001864B2 (en) Containerized software discovery and identification
Garcia-Carmona et al. A multi-level monitoring approach for the dynamic management of private iaas platforms
CN109995617A (zh) 主机管理特性的自动化测试方法、装置、设备及存储介质
US11288291B2 (en) Method and system for relation discovery from operation data

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
GR01 Patent grant
GR01 Patent grant