Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Crea una instancia de VM de aprendizaje profundo con la CLI de gcloud
En esta página, se muestra cómo crear una instancia de Deep Learning VM Image con Google Cloud CLI.
Antes de comenzar
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.
Si deseas usar gcloud en Cloud Shell para esta guía de inicio rápido, primero debes activar Cloud Shell mediante las instrucciones que se indican en Inicia Cloud Shell.
Crea una instancia nueva
Con estas instrucciones, se crea una instancia de VM de aprendizaje profundo con los siguientes parámetros:
El uso de una imagen en CUDA 9.2 de TensorFlow: tf-latest-cu92
Después de un tiempo, se creará la instancia de VM y se mostrará un resumen de la configuración.
Acabas de crear tu primera instancia de VM de aprendizaje profundo. Si deseas verificar la instancia y ver su estado, usa el comando gcloudlist como se muestra aquí para enumerar todas las instancias:
gcloud compute instances list
En esta lista, se incluyen todas las instancias de Compute Engine de todas las zonas en el proyecto actual.
También puedes ver y mantener tu instancia de VM de aprendizaje profundo en laGoogle Cloud consola en Instancias de VM de Compute Engine.
Para ver solo el estado de esta instancia, ejecuta este comando:
gcloud compute instances describe $INSTANCE_NAME
Accede a tu instancia nueva
Después de que creas tu instancia de VM de aprendizaje profundo, esta se inicia de manera automática. Puedes acceder a ella mediante SSH con el comando siguiente:
gcloud compute ssh $INSTANCE_NAME
Compute Engine propagará tus Llaves SSH y creará tu usuario. Para obtener más información, consulta Conéctate a instancias.
Detén la instancia
Ejecuta el siguiente comando desde tu máquina local (no en la instancia):
Después de que se crea la instancia en primera instancia, Compute Engine la inicia. Para iniciar la instancia de forma manual cuando se detiene, ejecuta el siguiente comando:
gcloud compute instances start $INSTANCE_NAME
El comando start inicia una instancia de máquina virtual detenida.
Limpia
Sigue estos pasos para evitar que se apliquen cargos a tu cuenta de Google Cloud por los recursos que usaste en esta página.
Para borrar la instancia de Deep Learning VM que creaste, ingresa lo siguiente en la línea de comandos:
gcloud compute instances delete $INSTANCE_NAME
El comando delete borra las instancias de Compute Engine.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (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)."]]