Options for the create command

This page describes the datalab create command.


datalab create [-h] [--image-name IMAGE_NAME] [--disk-name DISK_NAME]
               [--disk-size-gb DISK_SIZE_GB]  [--network-name NETWORK_NAME]
               [--subnet-name SUBNET_NAME] [--idle-timeout IDLE_TIMEOUT]
               [--machine-type MACHINE_TYPE] [--no-connect] [--no-swap]
               [--no-backups] [--beta-no-external-ip] [--no-create-repository]
               [--log-level {trace,debug,info,warn,error,fatal}]
               [--for-user FOR_USER] [--service-account SERVICE_ACCOUNT]
               [--port PORT] [--max-reconnects MAX_RECONNECTS]
               [--connection-health-timeout-seconds CONNECTION_HEALTH_TIMEOUT_SECONDS]
               [--ssh-log-level {quiet,fatal,error,info,verbose,debug,debug1,debug2,debug3}]
               [--no-launch-browser] [--beta-internal-ip]
               [--project PROJECT] [--quiet]
               [--verbosity {debug,info,default,warning,error,critical,none}]
               [--zone ZONE]

datalab create creates a new Datalab instance running in a Google Compute Engine VM.

This command also creates the datalab-network network if necessary.

By default, the command creates a persistent connection to the newly created instance. You can disable that behavior by passing in the --no-connect flag.



Show a help message and exit

--image-name IMAGE_NAME

Name of the Datalab image to run.

If not specified, this defaults to the most recently published image.

--disk-name DISK_NAME

Name of the persistent disk used to store notebooks.

If not specified, this defaults to having a name based on the instance name.

--disk-size-gb DISK_SIZE_GB

Size of the persistent disk in GB.

--network-name NETWORK_NAME

Name of the network to which the instance will be attached.

--subnet-name SUBNET_NAME

Name of the subnet to which the instance will be attached.

--idle-timeout IDLE_TIMEOUT

Interval after which an idle Datalab instance will shut down.

You can specify a mix of days, hours, minutes and seconds using those names or d, h, m and s, for example "1h 30m". Specify 0s to disable.

--machine-type MACHINE_TYPE

The machine type of the instance.

To get a list of available machine types, run gcloud compute machine-types list or see Machine Types.

If not specified, the default type is n1-standard-1.


Do not connect to the newly created instance


Do not enable swap on the newly created instance.


Do not automatically backup the disk contents to Cloud Storage


Do not assign the instance an external IP address if set to true (default false) If true, unless not connecting to the newly created instance using the --no-connect or --for-user flags, you must also use the --beta-internal-ip flag for both the creation of the instance as well as for any subsequent connections using datalab connect.

For machines to connect to the newly created Datalab instance, they must exist on the same VPC network (the one specified via the --network-name flag).


Do not create the datalab-notebooks repository if it is missing

--log-level {trace,debug,info,warn,error,fatal}

The log level for Datalab instance.

This is the threshold under which log entries from the Datalab instance will not be written to StackDriver logging.

The default log level is "warn".

--for-user FOR_USER

Create the datalab instance on behalf of the specified user

--service-account SERVICE_ACCOUNT

A service account is an identity attached to the instance. Its access tokens can be accessed through the instance metadata server and are used to authenticate API calls made from Cloud Datalab. The account can be either an email address or an alias corresponding to a service account. You can explicitly specify the Compute Engine default service account using the 'default' alias.

If not provided, the instance will get project's default service account.

--port PORT

Local port on which Cloud Datalab is accessible

--max-reconnects MAX_RECONNECTS

Maximum number of times to reconnect.

A negative value means no limit.

--connection-health-timeout-seconds CONNECTION_HEALTH_TIMEOUT_SECONDS]

Maximum amount of time in seconds, to wait for a connection to become healthy before giving up and retrying.

--ssh-log-level {quiet,fatal,error,info,verbose,debug,debug1,debug2,debug3}

The log level for the SSH command.

This may be useful for debugging issues with an SSH connection.

The default log level is "error".


Do not open a browser connected to Cloud Datalab


If connecting to the instance after creation, connect using its internal IP address. In order for the connection to succeed, the machine used to run the command must exist on the same VPC network (the network specified with the --network-name flag).

--project PROJECT

The Google Cloud Platform project name to use for this invocation.

If omitted then the current project is assumed.


Do not issue any interactive prompts

--verbosity {debug,info,default,warning,error,critical,none}

Override the default output verbosity for this command.

--zone ZONE

The zone containing the instance. If not specified, you may be prompted to select a zone.

To avoid prompting when this flag is omitted, you can set the compute/zone property:

$ gcloud config set compute/zone ZONE

A list of zones can be fetched by running:

$ gcloud compute zones list

To unset the property, run:

$ gcloud config unset compute/zone

Alternatively, the zone can be stored in the environment variable CLOUDSDK_COMPUTE_ZONE.