Home  >  Article  >  Operation and Maintenance  >  How to use the ECS image specification detection tool to shorten the image production and instance creation cycle

How to use the ECS image specification detection tool to shorten the image production and instance creation cycle

坏嘻嘻
坏嘻嘻Original
2018-09-18 14:26:441451browse

本篇文章给大家带来的内容是关于为缩短镜像制作及创建实例的周期应该怎么使用ECS镜像规范检测工具,有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助。

镜像规范检测工具

ECS支持使用自定义镜像创建实例。该自定义镜像可以是您基于线下服务器、虚拟机或者其他云平台的云主机创建的。您导入的镜像需要满足一定镜像要求,更多详情,请参阅导入镜像必读。为缩短镜像制作及创建实例的周期,我们推荐您使用ECS镜像规范检测工具,本文简称检测工具,制作符合规范的镜像。检测工具能基于服务器环境检测各项配置指标、定位不合规原因、生成TXT和JSON格式检测报告并给出解决意见。

使用限制

目前检测工具仅支持检测Linux类型镜像,包括Ubuntu、CentOS、Debian、RedHat、SLES(SUSE Linux Enterprise Server)、OpenSUSE、FreeBSD、CoreOS和Others Linux发行版本。

使用示例

以CentOS 7.4 64位服务器为例。

登录您的服务器、虚拟机或者其他云平台的云主机。

下载检测工具。

使用root权限运行image_check,避免检测工具无法读取有权限控制的配置文件。

chmod +x image_check
sudo image_check –p [目标路径]

    说明

您可以使用-p [目标路径]指定检测报告的生成路径,不指定则默认输出在检测工具所在的路径。

等待检测工具检测系统配置。

Begin check your system...
 The report is generating.
 -----------------------------------------
 The information you need to input when you import your image to Alibaba Cloud website:
 Current system: CentOS         # 系统信息1:服务器操作系统
 Architecture: x86_64           # 系统信息2:系统架构
 System disk size: 42 GB        # 系统信息3:服务器系统盘容量
 -----------------------------------------
 # 检测项
 Check driver                          [ OK ]
 Check shadow file authority           [ OK ]
 Check security                        [ OK ]
 Check qemu-ga                         [ OK ]
 Check network                         [ OK ]
 Check ssh                             [ OK ]
 Check firewall                        [ OK ]
 Check filesystem                      [ OK ]
 Check device id                       [ OK ]
 Check root account                    [ OK ]
 Check password                        [ OK ]
 Check partition table                 [ OK ]
 Check lvm                             [ FAILED ]
 Check lib                             [ OK ]
 Check disk size                       [ OK ]
 Check disk use rate                   [ WARNING ]
 Check inode use rate                  [ OK ]
 -----------------------------------------
 15 items are OK
 1 items are failed
 1 items are warning
 -----------------------------------------
 The report is generated: /root/image_check_report_2018-05-14_18-18-10.txt
 Please read the report to check the details

在相应位置查看检测报告。报告格式为image_check_report_日期_时间.txt或image_check_report.json。

检测项

为避免使用您的自定义镜像创建的ECS实例功能不全,检测工具主要检测服务器中以下配置项。

How to use the ECS image specification detection tool to shorten the image production and instance creation cycle

How to use the ECS image specification detection tool to shorten the image production and instance creation cycle

检测工具会根据检测项给出OK、FAILED或者WARNING检测结果。

OK:检测项均符合要求。

FAILED:检测项不符合要求,使用该自定义镜像创建的ECS实例无法正常启动。建议您修复报错项后再制作镜像,以提高实例启动效率。

WARNING:检测项不符合要求,使用该自定义镜像创建的ECS实例可以安全启动,但ECS无法通过有效途径干预您的实例配置。您可以选择立即修复,也可以暂时忽略问题前往制作镜像环节。

输出项

检测系统环境后,会输出TXT和JSON两种格式检测报告。输出路径可以使用-p [目标路径]指定,不指定则默认输出在检测工具所在的路径。

TXT格式报告名称为image_check_report_日期_时间.txt,报告内容包括服务器配置信息以及检测结果。以CentOS 7.4 64位服务器为例:

The information you need to input when you import your image to Alibaba Cloud Website:
  Current system is: CentOS     #服务器操作系统
  Architecture: x86_64          #系统架构
  System disk size: 42 GB       #服务器系统盘容量
  -----------------------------------------
   Check driver                 #检测项名称
   Pass: kvm drive is exist     #检测结果
   Alibaba Cloud supports kvm virtualization technology
   We strongly recommend installing kvm driver.

JSON格式报告名称为image_check_report.json,报告内容包括服务器配置信息以及检测结果。以CentOS 7.4 64位服务器为例:

"platform": "CentOS",      \\服务器操作系统
  "os_big_version": "7",     \\操作系统版本号(高位)
  "os_small_version": "4",   \\操作系统版本号(低位)
  "architecture": "x86_64",  \\系统架构
  "system_disk_size": "42",  \\服务器系统盘容量
  "version": "1.0.2",        \\检测工具版本
  "time": "2018-05-14_19-18-10", \\检测时间
  "check_items": [{
      "name": "driver",      \\检测项名称
      "result": "OK",        \\检测结果
      "error_code": "0",     \\错误码
      "description": "Pass: kvm driver exists.", \\描述
      "comment": "Alibaba Cloud supports kvm virtualization technology. We strongly recommend installing kvm driver."
  }]
}

下一步

查看导入镜像注意事项

安装virtio驱动

(可选)转换镜像格式

导入镜像

使用自定义镜像创建实例

The above is the detailed content of How to use the ECS image specification detection tool to shorten the image production and instance creation cycle. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn