3

Trying to copy some data into a newly created GCP Filestore with the gcloud CLI.

gcloud compute scp --recurse /somedirectore/somefile somefilestore-1:/somemount

gcloud seems unable to find the instance:

ERROR: (gcloud.compute.scp) Could not fetch resource:
 - The resource 'projects/k8-spark/zones/us-central1-a/instances/somefilestore-1' was not found

The filestore instance does exist. Wondering if compute scp actually works with filestores? The documentation seems to think so:

https://cloud.google.com/filestore/docs/copying-data

Any help much appreciated!

George
  • 6,886
  • 3
  • 44
  • 56
Paul Wolfe
  • 121
  • 7

1 Answers1

0

The error indicates that "somefilestore-1" is not a name for a Compute Engine (GCE) instance, not a Filestore instance. You can find the instance name in Compute Engine [1]. If your instances were created by the Kubernetes Engine, it will likely start with "gke-< your_K8_cluster_name >".

Some section of the documentation refers to GCE instances as "VM instance", note that the Cloud Filestore fileshare is mounted on a Compute Engine Windows VM instance.


[1] https://console.cloud.google.com/compute/instances

Héctor Neri
  • 1,384
  • 9
  • 13
  • https://cloud.google.com/filestore/docs/copying-data seems to think I can use this and refer directly to a filestore "instance". There is no compute engine instance involved. Basically just trying to copy some data into filestore – Paul Wolfe Aug 12 '18 at 23:16
  • As you can read there, "_Cloud Filestore fileshare [is] mounted on a Compute Engine Windows VM instance_." – Héctor Neri Aug 13 '18 at 14:04
  • The command is `gcloud compute scp [LOCAL_DATA_PATH] \ [INSTANCE_NAME]:/[MOUNT_DIRECTORY] \ --project [PROJECT_ID] --zone [LOCATION]` Where: "_[INSTANCE_NAME] is the name of the client VM instance that the Cloud Filestore fileshare is mounted on_." So you have to provide the GCE Instance name to the command. – Héctor Neri Aug 13 '18 at 14:04
  • Yup, got this far myself, but I wasn't able to see the "instance" on which the fileshare was running anywhere in the console or using the api to list GCE instances. – Paul Wolfe Aug 14 '18 at 02:13
  • Did you mount your fileshare on GCE clients as described [here](https://cloud.google.com/filestore/docs/mounting-fileshares)? or access the fileshare from a Kubernetes Engine cluster as described [here](https://cloud.google.com/filestore/docs/accessing-fileshares)? If you have a GCE instance or a Kubernetes cluster dedicated to have fileshare, you can mount the fileshare on the instance you want to use. For your filestore, do you want to mount your fileshare on a GCE instance or on a GKE cluster? – Héctor Neri Aug 14 '18 at 14:14
  • On a GKE cluster as a PVC. – Paul Wolfe Aug 14 '18 at 15:04
  • Then you can select any of your GKE Nodes and use it to [mount the fileshare](https://cloud.google.com/filestore/docs/mounting-fileshares). Note: a GKE Node is a GCE Instance, you can list them with `gcloud compute instances list`. The name of the instance you select to mount the fileshare is the one you will use in your `gcloud compute scp` command. Overall, the process is: **1)** mount the fileshare to a GKE Node / GCE Instance **2)** upload files to the Node/Instance you used to mount the fileshare. **3)** Create a PV, a PVC and consume the PVC from your Kubernetes object (e.g. a Pod). – Héctor Neri Aug 14 '18 at 19:50
  • Sorry for the slow reply, the last comment really cleared it up conceptually. Thanks for your help. – Paul Wolfe Aug 22 '18 at 23:05