15.2. 在 Satellite 服务器中添加 Google Compute Engine 镜像

要使用基于镜像的置备来创建主机,您必须将镜像的相关信息(如访问详细信息和镜像位置)添加到您的卫星服务器。

流程

  1. 在 Satellite Web UI 中,进入 Infrastructure > Compute Resources 并点 Google Compute Engine 连接的名称。
  2. Create Image
  3. Name 字段中输入镜像的名称。
  4. Operating System 列表中,选择镜像的基本操作系统。
  5. Architecture 列表中,选择操作系统架构。
  6. Username 字段中输入镜像访问的 SSH 用户名。指定 root 以外的用户,因为 root 用户无法使用 SSH 密钥连接到 GCE 实例。用户名必须以字母开头,并且由小写字母和数字组成。
  7. Image 列表中,从 Google Compute Engine 计算资源中选择镜像。
  8. 可选:如果镜像支持用户数据输入,如 cloud-init 数据,请选择 User Data 复选框。
  9. 单击 Submit 以保存镜像详情。

对于 CLI 用户

  • 使用 hammer compute-resource image create 命令创建镜像。使用 --username 选项指定 root 以外的用户,因为 root 用户无法使用 SSH 密钥连接到 GCE 实例。用户名必须以字母开头,并且由小写字母和数字组成。

    # hammer compute-resource image create \
    --name 'gce_image_name' \
    --compute-resource 'gce_cr' \
    --operatingsystem-id 1 \
    --architecture-id 1 \
    --uuid '3780108136525169178' \
    --username 'admin'