이 안내에서 경로를 사용하여 MANAGEMENT_API_SERVER{"</var>"}}을 바꿉니다.
디스크 연결 유지
VM이 시작되면 VM의 노드에서 VM의 디스크로 연결을 시작하는 데 몇 초가 걸립니다. VM이 더 빨리 시작되도록 하려면 VM이 종료될 때 디스크 연결이 유지되어야 합니다. 그래야 후속 VM 시작 시 디스크 연결이 다시 시작되지 않습니다. 이를 위해 디스크 연결 유지 기능을 사용 설정하는 명령어를 실행하면 시스템에서 VM의 모든 디스크를 마운트하는 더미 포드를 자동으로 만듭니다.
디스크 연결 유지 사용 설정
PROJECT 프로젝트에서 VM_NAME라는 VM의 디스크 연결을 유지하려면 다음 명령어를 실행합니다. 이렇게 하면 시스템에서 더미 포드를 자동으로 만듭니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eThis is a preview feature for minimizing VM start time, not recommended for production, and lacks SLAs or technical support commitments.\u003c/p\u003e\n"],["\u003cp\u003eTo accelerate VM startup, enable disk connection keep-alive, which creates a dummy pod to maintain disk connections when the VM is shut down.\u003c/p\u003e\n"],["\u003cp\u003eYou can further enhance VM startup speed by automatically setting an inter-VM affinity rule between the VM and its keep-alive pod, minimizing the chance of the Kubernetes scheduler changing the node during restart.\u003c/p\u003e\n"],["\u003cp\u003eSetting the VM's firmware to BIOS instead of UEFI can further reduce the VM start time, but doing so will come at the cost of losing secure boot.\u003c/p\u003e\n"],["\u003cp\u003eEnabling keep-alive comes with resource usage caveats, like increased pod count per node, additional IP usage, and an increased security surface due to persistent disk attachments.\u003c/p\u003e\n"]]],[],null,["# Minimize the VM start time\n\n| **Preview:** Minimize the VM start time is a Preview feature that is available as-is and is not recommended for production environments. Google provides no Service-Level agreements (SLA) or technical support commitments for Preview features.\n\nIf you require your VMs to boot as quickly as possible, minimize your virtual\nmachine (VM) start time with the instructions on this page. Minimizing the start\ntime comes at the cost of resource efficiency---your project consumes additional\nresources, and has an increased security surface.\n\nBefore you begin\n----------------\n\nTo use `gdcloud` command-line interface (CLI) commands, ensure that you have downloaded, installed,\nand configured the [`gdcloud` CLI](/distributed-cloud/hosted/docs/latest/appliance/resources/gdcloud-overview).\nAll commands for GDC air-gapped appliance use the `gdcloud` or\n`kubectl` CLI, and require an operating system (OS) environment.\n\n### Get the kubeconfig file path\n\nTo run commands against the Management API server, ensure you have the following\nresources:\n\n1. Locate the Management API server name, or ask your Platform Administrator (PA)\n what the server name is.\n\n2. [Sign in and generate](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/iam/sign-in#cli) the\n kubeconfig file for the Management API server if you don't have one.\n\n3. Use the path to replace \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER{\"</var>\"}}\u003c/var\u003e in these instructions.\n\nKeep disk connections alive\n---------------------------\n\nWhen a VM starts, initiating a connection from the VM's node to the VM's disk\ntakes a few seconds. To make the VM start up faster, the disk connection must be\nkept alive when the VM is shut down so that the disk connection doesn't\nreinitiate on subsequent VM starts. To achieve this, when you [run the command](#enable-keep-alive)\nto enable disk connection keep-alive the system automatically creates a dummy pod\nthat mounts all the VM's disks.\n\n### Enable disk connection keep-alive\n\nTo keep disk connections alive for a VM called \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e\nin the project \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e, run\nthe following command. When you do, the system automatically creates the dummy\npod: \n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e patch virtualmachines.virtualmachine.gdc.goog \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e -n \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e --type merge --patch $'\n metadata:\n annotations:\n disk.virtualmachine.gdc.goog/enable-connection-keep-alive: \"true\"\n '\n\nReplace the variables throughout these instructions, using the following\ndefinitions.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nWhen the disk connection keep-alive is enabled, a pod named\n`disk-connection-keep-alive-`\u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e is created in the same\nproject as the VM. The next VM restart is faster, as are subsequent start times,\nbecause the VM's disk connections are kept alive by the pod.\n\n### Set up disk connection keep-alive affinity\n\nThe Kubernetes scheduler might select a different node for the VM when it restarts.\nTo reduce the chances of that happening, configure an\ninter-VM affinity rule between the VM and the keep-alive pod. Configure this to happen automatically: \n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e patch virtualmachines.virtualmachine.gdc.goog \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e -n \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e --type merge --patch $'\n metadata:\n annotations:\n disk.virtualmachine.gdc.goog/add-connection-keep-alive-affinity: \"true\"\n '\n\nThis adds a preferred-affinity setting on the VM to the keep-alive pod.\n\n### Caveats\n\nThere are two caveats to keeping disk connections alive:\n\n- The keep-alive pod incurs additional resource usage:\n - It counts towards the limit of the number of pods per node.\n - It uses an additional IP address that is assigned by Kubernetes.\n - It uses a negligible additional amount of CPU and memory.\n- The security surface increases, because the node where the keep-alive pod is present always has the VM's disks attached, even when the VM is shut down.\n\nUse BIOS firmware\n-----------------\n\nIn GDC, starting a VM with Unified Extensible\nFirmware Interface (UEFI) firmware is slower than starting a VM with BIOS\nfirmware.\n\n1. To ensure that the start time is minimal, set the VM's firmware type to\n BIOS:\n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER\u003c/var\u003e patch virtualmachines.virtualmachine.gdc.goog \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e -n \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e --type merge --patch $'\n spec:\n firmware:\n type: bios\n enableSecureBoot:\n '\n\n2. If the VM is running, restart it using the instructions to\n [restart the VM](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/vms/manage-vms/operations-and-lifecycle/start-and-stop-vm#restart-a-vm).\n\n### Caveats\n\nThe caveat to using BIOS firmware is that it doesn't support [secure boot](/distributed-cloud/hosted/docs/latest/appliance/application/ao-user/vms/manage-vms/secure-vms/secure-boot).\n\nUse a large boot disk\n---------------------\n\nTo minimize the VM start time, attach a boot disk with a size of 500 GB or\ngreater to the VM."]]