镜像管理命令:image
列出所有镜像:ls
入口:
lbg image ls
概要:
usage: lbg image ls [-h] [-q] [-fa] [-s] [-pd] [-c] [-d] [-p PLATFORM] [-f FORMAT] [--csv] [--json] [--yaml] [--table] [--noheader]
options:
  -h, --help            show this help message and exit
  -q, --quiet           only show node id
  -fa, --failed         only show failed image
  -s, --scheduling      only show scheduling image
  -pd, --pending        only show pending image
  -c, --completed       only show completed image
  -d, --deleted         only show deleted image
  -p PLATFORM, --platform PLATFORM
                        only show selected platform image
  -f FORMAT, --format FORMAT
                        change header format
  --csv                 output with csv format
  --json                output with json format
  --yaml                output with yaml format
  --table               output with table format
  --noheader            does not print header information
参数说明:
| 参数 | 缩写 | 说明 | 必填 | 
|---|---|---|---|
| --quiet | -q | 只显示Image ID | 否 | 
| --failed | -fa | 只显示失败的镜像 | 否 | 
| --scheduling | -s | 只显示调度中的镜像 | 否 | 
| --pending | -pd | 只显示等待中的镜像 | 否 | 
| --completed | -c | 只显示完成的镜像 | 否 | 
| --platform | -p | 只显示这个平台下可用的镜像 | 否 | 
案例:
$ lbg image ls
$ lbg image ls -p ali # 只显示平台为ali的镜像
快照转镜像:release
入口:
lbg image release
概要:
usage: lbg image release [-h] [-n NAME] [-c COMMENT] image_id
positional arguments:
  image_id              id of the image
options:
  -h, --help            show this help message and exit
  -n NAME, --name NAME  image name
  -c COMMENT, --comment COMMENT
                        image comment
参数说明:
| 参数 | 缩写 | 说明 | 必填 | 
|---|---|---|---|
| --name | -n | 镜像名称 | 否 | 
| --comment | -c | 镜像说明 | 否 | 
案例:
$ lbg image release -n dpgen -c "dpgen备份" 253 # 将快照id 253 转换成自定义镜像名称为dpgen,说明为 "dpgen备份"
删除快照/镜像:rm
入口:
lbg image rm
概要:
usage: lbg image rm [-h] [-f] image_id [image_id ...]
positional arguments:
  image_id     id of the image
options:
  -h, --help   show this help message and exit
  -f, --force  force delete the image
参数说明:
| 参数 | 缩写 | 说明 | 必填 | 
|---|---|---|---|
| --force | -f | 不询问 | 否 | 
| image_id | - | 要删除的镜像id | 否 | 
案例:
$ lbg image rm 546 213 # 删除镜像id 546和213