Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Deep Learning-VM-Instanz mit der gcloud CLI erstellen
Auf dieser Seite erfahren Sie, wie Sie mithilfe der Google Cloud CLI eine Instanz für Deep Learning-VM-Images erstellen.
Hinweise
Sign in to your Google Cloud account. If you're new to
Google Cloud,
create an account to evaluate how our products perform in
real-world scenarios. New customers also get $300 in free credits to
run, test, and deploy workloads.
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
Damit Sie in dieser Kurzanleitung gcloud in Cloud Shell verwenden können, aktivieren Sie zuerst Cloud Shell. Folgen Sie dazu der Anleitung unter Cloud Shell starten.
Neue Instanz erstellen
Sie erstellen eine Deep Learning-VM-Instanz mit den folgenden Parametern:
Nach einer gewissen Zeit ist die VM-Instanz erstellt und es wird eine Zusammenfassung ihrer Konfiguration angezeigt.
Damit haben Sie die erste Deep Learning VM-Instanz erstellt. Sie können die Instanz nun prüfen und ihren Status ansehen. Listen Sie dazu alle Instanzen mit dem Befehl gcloudlist auf, wie hier gezeigt:
gcloud compute instances list
Damit werden alle Compute Engine-Instanzen aus allen Zonen im aktuellen Projekt angezeigt.
Sie können Ihre Deep Learning-VM-Instanz auch in derGoogle Cloud -Konsole unter Compute Engine-VM-Instanzen aufrufen und verwalten.
So rufen Sie den Status nur dieser Instanz ab:
gcloud compute instances describe $INSTANCE_NAME
Auf neue Instanz zugreifen
Nachdem Sie die Deep Learning-VM-Instanz erstellt haben, wird sie automatisch gestartet. Geben Sie den folgenden Befehl ein, um mit SSH darauf zuzugreifen:
gcloud compute ssh $INSTANCE_NAME
Compute Engine leitet Ihre SSH-Schlüssel weiter und erstellt Ihren Nutzer. Weitere Informationen finden Sie unter Verbindung zu Instanzen herstellen.
Instanz stoppen
Führen Sie vom lokalen Computer (nicht auf der Instanz) den folgenden Befehl aus:
gcloud compute instances stop $INSTANCE_NAME
Die Instanz wird mit dem Befehl stop ordnungsgemäß heruntergefahren.
Instanz starten
Nachdem die Instanz erstellt wurde, wird sie von Compute Engine automatisch gestartet. Wird sie gestoppt, kann sie anschließend manuell gestartet werden. Gehen Sie so vor:
gcloud compute instances start $INSTANCE_NAME
Mit dem Befehl start wird eine gestoppte Instanz der virtuellen Maschine gestartet.
Bereinigen
Mit den folgenden Schritten vermeiden Sie, dass Ihrem Google Cloud -Konto die auf dieser Seite verwendeten Ressourcen in Rechnung gestellt werden:
Geben Sie in der Befehlszeile den folgenden Befehl ein, um die von Ihnen erstellte Deep Learning-VM-Instanz zu löschen:
gcloud compute instances delete $INSTANCE_NAME
Mit dem Befehl delete werden Compute Engine-Instanzen gelöscht.
[[["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-09 (UTC)."],[[["\u003cp\u003eThis guide outlines the process of creating a Deep Learning VM instance using the Google Cloud CLI, including steps for setup and initialization.\u003c/p\u003e\n"],["\u003cp\u003eThe creation process utilizes specific parameters like a TensorFlow image on CUDA 9.2, \u003ccode\u003eus-west1-b\u003c/code\u003e zone, \u003ccode\u003emy-new-instance\u003c/code\u003e name, \u003ccode\u003en1-standard-8\u003c/code\u003e instance type, and an NVIDIA Tesla V100 GPU.\u003c/p\u003e\n"],["\u003cp\u003eAfter creating the instance, you can access it via SSH using the \u003ccode\u003egcloud compute ssh $INSTANCE_NAME\u003c/code\u003e command.\u003c/p\u003e\n"],["\u003cp\u003eThe guide provides commands to stop, start, and delete the created Deep Learning VM instance to manage its lifecycle.\u003c/p\u003e\n"],["\u003cp\u003eTo ensure you don't accrue charges, it's advised to delete the instance via \u003ccode\u003egcloud compute instances delete $INSTANCE_NAME\u003c/code\u003e once you are done.\u003c/p\u003e\n"]]],[],null,["# Quickstart: Create a Deep Learning VM instance by using the gcloud CLI\n\nCreate a Deep Learning VM instance by using the gcloud CLI\n==========================================================\n\nThis page shows you how to create a Deep Learning VM Images instance\nby using the Google Cloud CLI.\n\nBefore you begin\n----------------\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\nTo use the Google Cloud CLI for this quickstart, you must first\ninstall and initialize the [Google Cloud CLI](/sdk/docs):\n\n1. Download and install the Google Cloud CLI using the instructions given on [Installing Google Cloud CLI](/sdk/downloads).\n2. Initialize the SDK using the instructions given on [Initializing Cloud\n SDK](/sdk/docs/initializing).\n\nTo use `gcloud` in Cloud Shell for this quickstart, first activate\nCloud Shell using the instructions given on [Starting Cloud\nShell](/shell/docs/starting-cloud-shell).\n\nCreate a new instance\n---------------------\n\nThese instructions create a Deep Learning VM instance with the\nfollowing parameters:\n\n- Using a TensorFlow on CUDA 9.2 [image](/deep-learning-vm/docs/images): `tf-latest-cu92`.\n- In the US West1-B [zone](/compute/docs/gpus): `us-west1-b`.\n- Named `my-new-instance`.\n- Of the [instance type](/compute/docs/machine-types) `n1-standard-8`.\n- Using an NVIDIA Tesla V100 [GPU](/compute/docs/gpus): `type=nvidia-tesla-v100,count=8`.\n- With a boot disk of 120 GB.\n- With an NVIDIA GPU driver set to install on first run: `install-nvidia-driver=True`.\n\n| **Note:** For more information about additional VM options available to you, see [Choosing an Image](/deep-learning-vm/docs/images).\n\nAt the command line, enter the following: \n\n export IMAGE_FAMILY=\"tf-latest-cu92\"\n export ZONE=\"us-west1-b\"\n export INSTANCE_NAME=\"my-new-instance\"\n export INSTANCE_TYPE=\"n1-standard-8\"\n gcloud compute instances create $INSTANCE_NAME \\\n --zone=$ZONE \\\n --image-family=$IMAGE_FAMILY \\\n --image-project=deeplearning-platform-release \\\n --maintenance-policy=TERMINATE \\\n --accelerator=\"type=nvidia-tesla-v100,count=8\" \\\n --machine-type=$INSTANCE_TYPE \\\n --boot-disk-size=120GB \\\n --metadata=\"install-nvidia-driver=True\"\n\nAfter some time, the VM instance is created and a summary of its configuration\nis shown.\n\nYou've just created your first Deep Learning VM instance. To\nverify the instance and see its status, use the `gcloud`\n[`list`](/sdk/gcloud/reference/compute/instances/list) command as shown here\nto list all instances: \n\n gcloud compute instances list\n\nThis displays all Compute Engine instances from all zones in the current project.\n\nYou can also view and maintain your Deep Learning VM instance on the\nGoogle Cloud console in [Compute Engine VM\ninstances](https://console.cloud.google.com/compute/instances).\n\nTo view the status of just this instance: \n\n gcloud compute instances describe $INSTANCE_NAME\n\nAccess your new instance\n------------------------\n\nAfter you've created your Deep Learning VM instance, it starts\nautomatically. You can access it using SSH using the following command: \n\n gcloud compute ssh $INSTANCE_NAME\n\nCompute Engine will propagate your SSH keys and create your user. For more\ninformation, see [Connecting to\nInstances](/compute/docs/instances/connecting-to-instance).\n\nStop the instance\n-----------------\n\nRun the following command from your local machine (not on the instance): \n\n gcloud compute instances stop $INSTANCE_NAME\n\nThe [`stop`](/sdk/gcloud/reference/compute/instances/stop) command performs a\nclean shutdown.\n\nStart the instance\n------------------\n\nAfter the instance is initially created, Compute Engine starts it. To start the\ninstance manually when it's stopped, run the following command: \n\n gcloud compute instances start $INSTANCE_NAME\n\nThe [`start`](/sdk/gcloud/reference/compute/instances/start) command starts a\nstopped virtual machine instance.\n\nClean up\n--------\n\n\nTo avoid incurring charges to your Google Cloud account for\nthe resources used on this page, follow these steps.\n\nTo delete the Deep Learning VM instance that you created, at the\ncommand line, enter the following command: \n\n gcloud compute instances delete $INSTANCE_NAME\n\nThe [`delete`](/sdk/gcloud/reference/compute/instances/delete) command deletes\nCompute Engine instances.\n\nWhat's next\n-----------\n\n- Read a more in-depth description of this process in [Creating a\n Deep Learning VM instance From the\n CLI](/deep-learning-vm/docs/cli).\n- Learn more about [Images, image families, and\n instances](/deep-learning-vm/docs/concepts-images)."]]