18장. Preparing and uploading custom GCE images to Google Cloud


With RHEL image builder, you can build a gce image, provide credentials for your user or GCP service account, and then upload the gce image directly to the GCP environment.

18.1. Configuring and uploading a gce image to Google Cloud by using the CLI

Set up a configuration file with credentials to upload your gce image to GCP by using the RHEL image builder CLI.

주의

You cannot manually import gce image to Google Cloud, because the image will not boot. You must use either gcloud or RHEL image builder to upload it.

Prerequisites

  • You have a valid Google account and credentials to upload your image to Google Cloud. The credentials can be from a user account or a service account. The account associated with the credentials must have at least the following IAM roles assigned:

    • roles/storage.admin - to create and delete storage objects
    • roles/compute.storageAdmin - to import a VM image to Compute Engine.
  • You have an existing Google Cloud bucket.

Procedure

  1. Use a text editor to create a gcp-config.toml configuration file with the following content:

    provider = "gcp"
    [settings]
    bucket = "<gcp_bucket>"
    region = "<gcp_storage_region>"
    object = "<object_key>"
    credentials = "<gcp_credentials>"
    • <gcp_bucket> points to an existing bucket. It is used to store the intermediate storage object of the image which is being uploaded.
    • <gcp_storage_region> is both a regular Google storage region and a dual or multi-region.
    • <object_key> is the name of an intermediate storage object. It must not exist before the upload, and it is deleted when the upload process is done. If the object name does not end with .tar.gz, the extension is automatically added to the object name.
    • <gcp_credentials> is a Base64-encoded scheme of the credentials JSON file downloaded from Google Cloud. The credentials determine which project the Google Cloud uploads the image to.

      참고

      Specifying <gcp_credentials> in the gcp-config.toml file is optional if you use a different mechanism to authenticate with Google Cloud. For other authentication methods, see Authenticating with Google Cloud.

  2. Retrieve the <gcp_credentials> from the JSON file downloaded from Google Cloud.

    $ sudo base64 -w 0 cee-gcp-nasa-476a1fa485b7.json
  3. Create a compose with an additional image name and cloud provider profile:

    $ sudo image-builder build gce --blueprint <blueprint_name> <image_key> gcp-config.toml

    The image build, upload, and cloud registration processes can take up to ten minutes to complete.

Verification

  • Verify that the image status is FINISHED:

    $ sudo image-builder compose status
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동