The default subnet exists as can be seen by executing manually the gcloud command:
gcloud compute networks subnets describe default --region europe-west1
However the datalab create command fails as apparently it does not pass through the --region flag to the gcloud compute command, whether it is specified as the --zone flag in the datalab command, or it is selected via the interactive prompt of the datalab create command
DEBUG: (gcloud.compute.networks.subnets.describe) Underspecified resource [default]. Specify the [--region] flag.
Traceback (most recent call last):
File "/google/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 848, in Execute
resources = calliope_command.Run(cli=self, args=args)
File "/google/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 770, in Run
resources = command_instance.Run(args)
File "/google/google-cloud-sdk/lib/surface/compute/networks/subnets/describe.py", line 49, in Run
scope_lister=compute_flags.GetDefaultScopeLister(client))
File "/google/google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/flags.py", line 755, in ResolveAsResource
default_scope, scope_lister)
File "/google/google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/flags.py", line 510, in ResolveResources
api_resource_registry)
File "/google/google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/flags.py", line 421, in _ResolveUnderspecifiedNames
raise UnderSpecifiedResourceError(names, [s.flag for s in self.scopes])
UnderSpecifiedResourceError: Underspecified resource [default]. Specify the [--region] flag.
ERROR: (gcloud.compute.networks.subnets.describe) Underspecified resource [default]. Specify the [--region] flag.
Traceback (most recent call last):
File "./datalab.py", line 420, in run
sdk_version=sdk_version, datalab_version=datalab_version)
File "/home/jmmaldonado/datalabcli/tools/cli/commands/create.py", line 802, in run
disk_cfg = prepare(args, gcloud_compute, gcloud_repos)
File "/home/jmmaldonado/datalabcli/tools/cli/commands/create.py", line 771, in prepare
ensure_subnet_exists(args, gcloud_compute, args.subnet_name)
File "/home/jmmaldonado/datalabcli/tools/cli/commands/create.py", line 585, in ensure_subnet_exists
raise SubnetException(subnet_name)
SubnetException: Failed to find the subnet default.
Ask a project owner to create it for you, or double check your gcloud config for the correct region.
Failed to find the subnet default.
Ask a project owner to create it for you, or double check your gcloud config for the correct region.
As of today the merge that includes the --subnet-name flag is not surfaced in the SDK I have cloned the repo and executed the following command:
./datalab.py create --network-name eci-vpc --subnet-name default --no-connect --verbosity debug --zone europe-west1-b datalabvm01
The
default
subnet exists as can be seen by executing manually the gcloud command:gcloud compute networks subnets describe default --region europe-west1
However the datalab create command fails as apparently it does not pass through the
--region
flag to the gcloud compute command, whether it is specified as the--zone
flag in the datalab command, or it is selected via the interactive prompt of the datalab create commandDEBUG: (gcloud.compute.networks.subnets.describe) Underspecified resource [default]. Specify the [--region] flag. Traceback (most recent call last): File "/google/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 848, in Execute resources = calliope_command.Run(cli=self, args=args) File "/google/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 770, in Run resources = command_instance.Run(args) File "/google/google-cloud-sdk/lib/surface/compute/networks/subnets/describe.py", line 49, in Run scope_lister=compute_flags.GetDefaultScopeLister(client)) File "/google/google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/flags.py", line 755, in ResolveAsResource default_scope, scope_lister) File "/google/google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/flags.py", line 510, in ResolveResources api_resource_registry) File "/google/google-cloud-sdk/lib/googlecloudsdk/command_lib/compute/flags.py", line 421, in _ResolveUnderspecifiedNames raise UnderSpecifiedResourceError(names, [s.flag for s in self.scopes]) UnderSpecifiedResourceError: Underspecified resource [default]. Specify the [--region] flag. ERROR: (gcloud.compute.networks.subnets.describe) Underspecified resource [default]. Specify the [--region] flag. Traceback (most recent call last): File "./datalab.py", line 420, in run sdk_version=sdk_version, datalab_version=datalab_version) File "/home/jmmaldonado/datalabcli/tools/cli/commands/create.py", line 802, in run disk_cfg = prepare(args, gcloud_compute, gcloud_repos) File "/home/jmmaldonado/datalabcli/tools/cli/commands/create.py", line 771, in prepare ensure_subnet_exists(args, gcloud_compute, args.subnet_name) File "/home/jmmaldonado/datalabcli/tools/cli/commands/create.py", line 585, in ensure_subnet_exists raise SubnetException(subnet_name) SubnetException: Failed to find the subnet default.
Ask a project owner to create it for you, or double check your gcloud config for the correct region. Failed to find the subnet default.
Ask a project owner to create it for you, or double check your gcloud config for the correct region.