Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Criar uma instância de VM de aprendizado profundo usando a CLI gcloud
Nesta página, mostramos como criar uma instância de Deep Learning VM Image usando a Google Cloud CLI.
Antes de começar
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.
Após algum tempo, a instância de VM é criada e um resumo de sua configuração é mostrado.
Você acabou de criar sua primeira instância de VM de aprendizado profundo. Para verificar a instância e ver o status dela, use o comando list da gcloud conforme mostrado aqui para listar todas as instâncias:
gcloud compute instances list
Isso exibe todas as instâncias do Compute Engine de todas as zonas no projeto atual.
Também é possível ver e manter sua instância de VM de aprendizado profundo no
console doGoogle Cloud em instâncias de VM do
Compute Engine.
Para visualizar o status dessa instância:
gcloud compute instances describe $INSTANCE_NAME
Acessar sua nova instância
Depois de criar sua instância de VM de aprendizado profundo, ela é iniciada automaticamente. É possível acessá-la usando SSH com o comando a seguir:
gcloud compute ssh $INSTANCE_NAME
O Compute Engine propagará suas chaves SSH e criará seu usuário. Para mais informações, consulte Como se conectar a instâncias.
Interromper a instância
Execute o comando a seguir na sua máquina local, não na instância:
Depois que a instância é criada inicialmente, o Compute Engine a inicia. Para iniciar a instância manualmente quando ela estiver parada, execute o comando a seguir:
gcloud compute instances start $INSTANCE_NAME
O comando start inicia uma instância interrompida de máquina virtual.
Limpar
Para evitar cobranças na sua conta do Google Cloud pelos
recursos usados nesta página, siga estas etapas.
Para excluir a instância de VM de aprendizado profundo que você criou, na linha de comando, digite o comando a seguir:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-17 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)."]]