HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/current/help/man/man1/gcloud_compute_images_export.1
.TH "GCLOUD_COMPUTE_IMAGES_EXPORT" 1



.SH "NAME"
.HP
gcloud compute images export \- export a Compute Engine image



.SH "SYNOPSIS"
.HP
\f5gcloud compute images export\fR \fB\-\-destination\-uri\fR=\fIDESTINATION_URI\fR (\fB\-\-image\fR=\fIIMAGE\fR\ |\ \fB\-\-image\-family\fR=\fIIMAGE_FAMILY\fR) [\fB\-\-async\fR] [\fB\-\-cloudbuild\-service\-account\fR=\fICLOUDBUILD_SERVICE_ACCOUNT\fR] [\fB\-\-compute\-service\-account\fR=\fICOMPUTE_SERVICE_ACCOUNT\fR] [\fB\-\-export\-format\fR=\fIEXPORT_FORMAT\fR] [\fB\-\-image\-project\fR=\fIIMAGE_PROJECT\fR] [\fB\-\-log\-location\fR=\fILOG_LOCATION\fR] [\fB\-\-network\fR=\fINETWORK\fR] [\fB\-\-subnet\fR=\fISUBNET\fR] [\fB\-\-timeout\fR=\fITIMEOUT\fR;\ default="2h"] [\fB\-\-zone\fR=\fIZONE\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

\fBgcloud compute images export\fR exports virtual disk images from Compute
Engine.

By default, images are exported in the Compute Engine format, which is a
\f5disk.raw\fR file that is tarred and gzipped.

The \f5\-\-export\-format\fR flag exports the image to a format supported by
QEMU using qemu\-img. Valid formats include \f5vmdk\fR, \f5vhdx\fR, \f5vpc\fR,
\f5vdi\fR, and \f5qcow2\fR.

Before exporting an image, set up access to Cloud Storage and grant required
roles to the user accounts and service accounts. For more information, see
https://cloud.google.com/compute/docs/import/requirements\-export\-import\-images.



.SH "EXAMPLES"

To export a VMDK file \f5\fImy\-image\fR\fR from a project
\f5\fImy\-project\fR\fR to a Cloud Storage bucket \f5\fImy\-bucket\fR\fR, run:

.RS 2m
$ gcloud compute images export \-\-image=my\-image \e
    \-\-destination\-uri=gs://my\-bucket/my\-image.vmdk \e
    \-\-export\-format=vmdk \-\-project=my\-project
.RE



.SH "REQUIRED FLAGS"

.RS 2m
.TP 2m
\fB\-\-destination\-uri\fR=\fIDESTINATION_URI\fR

The Cloud Storage URI destination for the exported virtual disk file.

.TP 2m

Exactly one of these must be specified:


.RS 2m
.TP 2m
\fB\-\-image\fR=\fIIMAGE\fR

The name of the disk image to export.

.TP 2m
\fB\-\-image\-family\fR=\fIIMAGE_FAMILY\fR

The family of the disk image to be exported. When a family is used instead of an
image, the latest non\-deprecated image associated with that family is used.


.RE
.RE
.sp

.SH "OPTIONAL FLAGS"

.RS 2m
.TP 2m
\fB\-\-async\fR

Return immediately, without waiting for the operation in progress to complete.

.TP 2m
\fB\-\-cloudbuild\-service\-account\fR=\fICLOUDBUILD_SERVICE_ACCOUNT\fR

Image import and export tools use Cloud Build to import and export images to and
from your project. Cloud Build uses a specific service account to execute builds
on your behalf. The Cloud Build service account generates an access token for
other service accounts and it is also used for authentication when building the
artifacts for the image import tool.

Use this flag to to specify a user\-managed service account for image import and
export. If you don't specify this flag, Cloud Build runs using your project's
default Cloud Build service account. To set this option, specify the email
address of the desired user\-managed service account. Note: You must specify the
\f5\-\-logs\-location\fR flag when you set a user\-managed service account.

At minimum, the specified user\-managed service account needs to have the
following roles assigned:

.RS 2m
.IP "\(em" 2m
roles/compute.admin
.IP "\(em" 2m
roles/iam.serviceAccountTokenCreator
.IP "\(em" 2m
roles/iam.serviceAccountUser
.RE
.sp

.TP 2m
\fB\-\-compute\-service\-account\fR=\fICOMPUTE_SERVICE_ACCOUNT\fR

A temporary virtual machine instance is created in your project during image
export. Image export tooling on this temporary instance must be authenticated.

A Compute Engine service account is an identity attached to an instance. Its
access tokens can be accessed through the instance metadata server and can be
used to authenticate image export tooling on the instance.

To set this option, specify the email address corresponding to the required
Compute Engine service account. If not provided, the image export on the
temporary instance uses the project's default Compute Engine service account.

At a minimum, you need to grant the following roles to the specified Cloud Build
service account:

.RS 2m
.IP "\(em" 2m
roles/compute.storageAdmin
.IP "\(em" 2m
roles/storage.objectAdmin
.RE
.sp

.TP 2m
\fB\-\-export\-format\fR=\fIEXPORT_FORMAT\fR

Specify the format to export to, such as \f5vmdk\fR, \f5vhdx\fR, \f5vpc\fR, or
\f5qcow2\fR.

.TP 2m
\fB\-\-image\-project\fR=\fIIMAGE_PROJECT\fR

The Google Cloud project against which all image and image family references
will be resolved. It is best practice to define image\-project. A full list of
available projects can be generated by running \f5gcloud projects list\fR.
.RS 2m
.IP "\(em" 2m
If specifying one of our public images, image\-project must be provided.
.IP "\(em" 2m
If there are several of the same image\-family value in multiple projects,
image\-project must be specified to clarify the image to be used.
.IP "\(em" 2m
If not specified and either image or image\-family is provided, the current
default project is used.
.RE
.sp

.TP 2m
\fB\-\-log\-location\fR=\fILOG_LOCATION\fR

Directory in Cloud Storage to hold build logs. If not set, \f5gs://<project
num>.cloudbuild\-logs.googleusercontent.com/\fR is created and used.

.TP 2m
\fB\-\-network\fR=\fINETWORK\fR

The name of the network in your project to use for the image export. When you
export an image, the export tool creates and uses temporary VMs in your project
for the export process. Use this flag to specify the network to use for these
temporary VMs.

.TP 2m
\fB\-\-subnet\fR=\fISUBNET\fR

Name of the subnetwork in your project to use for the image export. When you
export an image, the export tool creates and uses temporary VMs in your project
for the export process. Use this flag to specify the subnetwork to use for these
temporary VMs.
.RS 2m
.IP "\(em" 2m
If the network resource is in legacy mode, do not provide this property.
.IP "\(em" 2m
If the network is in auto subnet mode, specifying the subnetwork is optional.
.IP "\(em" 2m
If the network is in custom subnet mode, then this field must be specified.
.RE
.sp

.TP 2m
\fB\-\-timeout\fR=\fITIMEOUT\fR; default="2h"

Maximum time an export can last before it fails as "TIMEOUT". For example, if
you specify \f52h\fR, the process fails after 2 hours. See $ gcloud topic
datetimes for information about duration formats.

This timeout option has a maximum value of 24 hours.

If you are exporting a large image that takes longer than 24 hours to export,
either use the RAW disk format to reduce the time needed for converting the
image, or split the data into several smaller images.

.TP 2m
\fB\-\-zone\fR=\fIZONE\fR

The zone to use when exporting the image. When you export an image, the export
tool creates and uses temporary VMs in your project for the export process. Use
this flag to specify the zone to use for these temporary VMs. Overrides the
default \fBcompute/zone\fR property value for this command invocation.


.RE
.sp

.SH "GCLOUD WIDE FLAGS"

These flags are available to all commands: \-\-access\-token\-file, \-\-account,
\-\-billing\-project, \-\-configuration, \-\-flags\-file, \-\-flatten,
\-\-format, \-\-help, \-\-impersonate\-service\-account, \-\-log\-http,
\-\-project, \-\-quiet, \-\-trace\-token, \-\-user\-output\-enabled,
\-\-verbosity.

Run \fB$ gcloud help\fR for details.



.SH "NOTES"

These variants are also available:

.RS 2m
$ gcloud alpha compute images export
.RE

.RS 2m
$ gcloud beta compute images export
.RE