Attach a regional disk to a Compute Engine VM instance in read-only mode
Stay organized with collections
Save and categorize content based on your preferences.
Attach a regional disk to a Compute Engine VM instance in read-write mode
Attach a regional disk to a single virtual machine running in Google Compute Engine. The disk also needs to be mounted by the operating system before it can be used.
The disk is attached in read-only mode. The disk can be attached to multiple VM instances simultaneously.
Code sample
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],[],[[["This code sample demonstrates how to attach a regional disk to a Google Compute Engine virtual machine instance."],["The disk is attached in read-only mode, allowing it to be simultaneously attached to multiple VM instances."],["The provided Go code snippet uses the Compute Engine API to perform the disk attachment operation."],["Authentication is required to use the Compute Engine API, using Application Default Credentials for a local development environment."],["Before the disk can be used it needs to be mounted by the operating system."]]],[]]