Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Auf dieser Seite erfahren Sie, wie Sie Labels mit Ihren Filestore-Instanzen verwenden. Mit Labels können Sie verwandte Instanzen gruppieren und Metadaten zu einer Instanz speichern.
Labels einer Instanz hinzufügen oder aktualisieren
Sie können einer Filestore-Instanz beim Erstellen der Instanz Labels hinzufügen.
Nachdem eine Instanz erstellt wurde, können Sie der Instanz weitere Labels hinzufügen und vorhandene Labels aktualisieren oder löschen.
Console
Rufen Sie in der Google Cloud Console die Seite „Filestore-Instanzen“ auf.
Klicken Sie auf das Kästchen neben den Instanzen, deren Labels Sie ändern möchten.
Klicken Sie auf Infofeld anzeigen.
Fügen Sie nach Bedarf Labels hinzu und aktualisieren Sie sie.
Aktion
Anleitung
Label hinzufügen
Klicken Sie auf Label hinzufügen und geben Sie den Schlüssel und den Wert für das Label ein.
Aktualisieren Sie ein Label
Aktualisieren Sie das Feld Wert. Sie können den Key eines vorhandenen Labels nicht aktualisieren.
Labels löschen:
Klicken Sie neben dem Label auf Element löschendelete.
Klicken Sie zum Speichern der Änderungen auf Speichern.
gcloud
Mit dem Befehl instances update können Sie die Labels einer Filestore-Instanz bearbeiten.
Verwenden Sie zum Hinzufügen neuer Labels oder der Werte vorhandener Labels das Flag --update-labels. Verwenden Sie zum Löschen eines oder mehrerer Labels das Flag --remove-labels. Das Flag --clear-labels entfernt alle Labels aus einer Instanz.
instance-id ist die Instanz-ID der Instanz, die Sie bearbeiten möchten.
project-id ist die Projekt-ID des Google Cloud Projekts, das die Filestore-Instanz enthält. Sie können dieses Flag überspringen, wenn sich die Filestore-Instanz im Standardprojekt gcloud befindet. Sie können das Standardprojekt folgendermaßen festlegen:
gcloud config set project project-id
zone ist die Zone, in der sich die Filestore-Instanz befindet. Führen Sie den Befehl gcloud filestore zones list aus, um eine Liste der unterstützten Zonen abzurufen. Sie können dieses Flag überspringen, wenn sich die Filestore-Instanz in der Standardzone gcloud befindet. Sie können das Standardprojekt folgendermaßen festlegen:
gcloud config set filestore/zone zone
key ist ein neues Label oder ein vorhandenes Label, das Sie ändern oder entfernen möchten.
value ist der Wert für ein Label.
Beispiel
Im folgenden Beispiel wird die Instanz "nfs-server" aktualisiert. Hierzu wird das Label status hinzugefügt, der Wert für das Label dept aktualisiert und das Label admin entfernt.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-03 (UTC)."],[[["\u003cp\u003eLabels in Filestore allow for grouping related instances and storing metadata about them.\u003c/p\u003e\n"],["\u003cp\u003eYou can add labels to a Filestore instance during creation, or add, update, or delete them later.\u003c/p\u003e\n"],["\u003cp\u003eUsing the Google Cloud console, you can modify labels by selecting the instance, accessing the info panel, and then using options to add, update, or delete them.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egcloud\u003c/code\u003e command-line tool offers functionality to manage labels, including adding new ones with \u003ccode\u003e--update-labels\u003c/code\u003e, removing them with \u003ccode\u003e--remove-labels\u003c/code\u003e, or clearing all labels using \u003ccode\u003e--clear-labels\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTo update labels with \u003ccode\u003egcloud\u003c/code\u003e, you can specify the instance ID, project ID, zone, the label key and the corresponding value, in addition to removing some via key.\u003c/p\u003e\n"]]],[],null,["# Managing labels\n\nThis page shows you how to use [labels](/filestore/docs/tags-and-labels#labels) with your Filestore\ninstances. Labels let you group related instances and store metadata\nabout an instance.\n\nAdding or updating an instance's labels\n---------------------------------------\n\nYou can add labels to a Filestore instance when you\n[create the instance](/filestore/docs/creating-instances).\nAfter an instance is created, you can add more labels to the instance, as well\nas update or delete existing labels. \n\n### Console\n\n1. In the Google Cloud console, go to the Filestore Instances page.\n\n [Go to the Filestore instances page](https://console.cloud.google.com/filestore/instances)\n2. Select the checkbox next to each instance whose labels you want to modify.\n\n3. Click **Show info panel**.\n\n4. Add and update labels as needed:\n\n5. Click **Save** to save your changes once you are finished with your\n updates.\n\n### gcloud\n\nYou can edit the labels of a Filestore instance's by running the\n[`instances update`](/sdk/gcloud/reference/filestore/instances/update) command.\nTo add new labels or change the values of existing labels, use the\n`--update-labels` flag. To delete one or more labels, use the `--remove-labels`\nflag. The `--clear-labels` flag removes all labels from an instance. \n\n gcloud filestore instances update \u003cvar translate=\"no\"\u003einstance-id\u003c/var\u003e \\\n --project=\u003cvar translate=\"no\"\u003eproject-id\u003c/var\u003e \\\n --zone=\u003cvar translate=\"no\"\u003ezone\u003c/var\u003e \\\n --update-labels \u003cvar translate=\"no\"\u003ekey\u003c/var\u003e=\u003cvar translate=\"no\"\u003evalue\u003c/var\u003e,[\u003cvar translate=\"no\"\u003ekey\u003c/var\u003e=\u003cvar translate=\"no\"\u003evalue\u003c/var\u003e,...] \\\n --remove-labels \u003cvar translate=\"no\"\u003ekey\u003c/var\u003e,[\u003cvar translate=\"no\"\u003ekey\u003c/var\u003e,...] \\\n --clear-labels\n\nwhere:\n\n- \u003cvar translate=\"no\"\u003einstance-id\u003c/var\u003e is the instance ID of the instance you want to edit.\n- \u003cvar translate=\"no\"\u003eproject-id\u003c/var\u003e is the project ID of the Google Cloud project that\n contains the Filestore instance. You can skip this\n flag if the Filestore instance is in the `gcloud` default\n project. You can set the default project by running:\n\n gcloud config set project \u003cvar translate=\"no\"\u003eproject-id\u003c/var\u003e\n\n- \u003cvar translate=\"no\"\u003ezone\u003c/var\u003e is the zone where the Filestore\n instance resides. Run the [`gcloud filestore zones list`](/sdk/gcloud/reference/filestore/zones/list)\n command to get a list of supported zones. You can skip this flag\n if the Filestore instance is in the `gcloud` default\n zone. You can set the default zone by running:\n\n gcloud config set filestore/zone \u003cvar translate=\"no\"\u003ezone\u003c/var\u003e\n\n- \u003cvar translate=\"no\"\u003ekey\u003c/var\u003e is a new label, or an existing label you want to change or remove.\n\n- \u003cvar translate=\"no\"\u003evalue\u003c/var\u003e is the value for a label.\n\n#### Example\n\nThe following example updates the nfs-server instance by adding the **status**\nlabel, updating the **dept** label value, and removing the **admin** label. \n\n gcloud filestore instances update nfs-server \\\n --project=myproject \\\n --zone=us-central1-c \\\n --update-labels status=active \\\n --update-labels dept=accounting \\\n --remove-labels admin\n\nWhat's next\n-----------\n\nLearn how to [edit other properties of a Filestore\ninstance](/filestore/docs/editing-instances)."]]