A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cloud.google.com/compute/docs/instances/windows/creating-windows-persistent-disk-snapshot below:

Create a Windows application consistent disk snapshot | Compute Engine Documentation

Create a Windows application consistent disk snapshot

Stay organized with collections Save and categorize content based on your preferences.

Windows

In Compute Engine, you can use snapshots to back up your disk data. Because snapshots are incremental, you can create them with higher performance and lower total storage charges compared to creating complete disk images.

Application consistent snapshots capture the state of application data at the time of backup with all application transactions completed and all pending writes flushed to the disk. On Windows VMs, you use the Volume Shadow Copy Service (VSS) to create application consistent snapshots without first stopping the instance or detaching the disk from your VM.

Caution: If you have enabled BitLocker on a boot disk that is based on a Shielded VM image, you can restore a snapshot of that boot disk to another disk, but you can't decrypt the restored instance. This is because the vTPM containing the BitLocker keys is only available to the virtual machine (VM) instance that originated the snapshot. For more information, see Using BitLocker with Shielded VM images. Before you begin Limitations

Disk snapshots on Windows have the following limitations:

Important: When you create a VSS snapshot, Windows Server marks the volume in the snapshot as read-only. Any disks that you create from the VSS snapshot are also in read-only mode. For more information about how to work around this restriction, see Create a writable disk from a VSS snapshot. Create a Windows VSS snapshot

You can create Volume Shadow Copy Service (VSS) snapshots without having to stop the instance or detach the disk from your VM. VSS snapshots are intended for backup and recovery purposes on systems with VSS-aware apps.

VSS snapshots are the same price as normal Persistent Disk or Hyperdisk snapshots, and charge only for the total size of the snapshot.

Create the snapshot Caution: If you try to create a snapshot from a disk and the snapshot creation process fails, you won't be able to delete the original disk volume until you clean up the failed snapshot and capture a clean snapshot. This failsafe helps to prevent the accidental deletion of source data in the event of an unsuccessful backup. Console
  1. Go to the Create a Snapshot page in the Google Cloud console.

    Go to the Create a Snapshot page
  2. Enter a snapshot Name.
  3. Select a Snapshot type. The default is a STANDARD snapshot, which is the best option for long-term back up and disaster recovery.

    Choose Archive snapshot for more cost-efficient data retention.

  4. Optional: Enter a Description of the snapshot.
  5. Under Source disk, select the existing disk that you want to create a snapshot of.
  6. In the Location section, choose your snapshot storage location.

    The predefined or customized default location defined in your snapshot settings is automatically selected. Optionally, you can override the snapshot settings and store your snapshots in a custom storage location by doing the following:

    1. Choose the type of storage location that you want for your snapshot.

      • Choose Multi-regional for higher availability at a higher cost.
      • Choose Regional snapshots for more control over the physical location of your data at a lower cost.
    2. In the Select location field, select the specific region or multi-region that you want to use. To use the region or multi-region that is closest to your source disk, select Based on disk's location.
  7. Check the Enable application consistent snapshot option.
  8. Click Create to create the snapshot.
gcloud

To create a VSS snapshot, use the gcloud compute snapshots create command and include the --guest-flush flag.

You can create your snapshot in the storage location policy defined by your snapshot settings or using an alternative storage location of your choice. For more information, see Choose your snapshot storage location.

Replace the following:

Note: Google recommends using the gcloud compute snapshots create command instead of the gcloud compute disks snapshot command because it supports more features, such as creating snapshots in a project different from the source disk project.

To create a VSS snapshot of a regional Persistent Disk, in the previous examples replace --source-disk-zone= with --source-disk-region=, and specify the region where your regional Persistent Disk is located.

The Google Cloud CLI waits until the operation returns a status of READY, FAILED, or reaches the maximum timeout and returns the last known details of the snapshot.

REST

When creating a snapshot, to indicate that you want to create a VSS snapshot, include the guestFlush property in the request body for your POST request to the compute.snapshots.insert method.

You can create your snapshot in the storage location policy defined by your snapshot settings or using an alternative storage location of your choice. For more information, see Choose your snapshot storage location.

Replace the following:

Note: Google recommends using the snapshots.insert method instead of the disks.createSnapshot method because it supports more features, such as creating snapshots in a project different from the source disk project.

To create a VSS snapshot of a regional Persistent Disk, in the POST requests shown previously, replace the following line:

"sourceDisk": "projects/SOURCE_PROJECT_ID/zones/SOURCE_ZONE/disks/SOURCE_DISK_NAME",
Use this line instead when creating a snapshot of a regional Persistent Disk:
"sourceDisk": "projects/SOURCE_PROJECT_ID/regions/SOURCE_REGION/disks/SOURCE_DISK_NAME",
Create a writable disk from a VSS snapshot

When you create a VSS snapshot, Windows Server marks the volume in the snapshot as read-only. When you create a new disk from the VSS snapshot, that disk is also set to read-only mode.

This might cause issues. For example, if you create a VM instance with a new boot disk from a VSS snapshot of an existing boot disk, the read-only flag on the new boot disk prevents the VM from booting correctly.

To work around this issue, remove the read-only flag from any new disk that you create from a VSS snapshot using the following steps:

  1. Make sure the disk is attached to a VM:

  2. Sign in to the Windows VM that the disk is attached to.

  3. Open a PowerShell command prompt and run the diskpart tool.

    PS C:\> diskpart
    
  4. Identify the disk that you want to mount.

    DISKPART> list disk
    
  5. Use the select disk command to select the disk.

    DISKPART> select disk DISK_NUMBER
    

    Replace DISK_NUMBER with the number of the disk that you want to mount.

  6. Mount the disk.

    DISKPART> online disk
    
  7. List all the volumes in the disk.

    DISKPART> list volume
    
  8. Select the new volume.

    DISKPART> select volume VOLUME_NUMBER
    

    Replace VOLUME_NUMBER with the number of the volume to configure as read and write.

  9. Clear the read-only flag.

    DISKPART> attr volume clear readonly hidden nodefaultdriveletter shadowcopy
    
  10. Exit the diskpart tool.

    DISKPART> exit
    
  11. If the disk is a boot disk for another VM, sync the boot disk files with the new disk signature.

    PS C:\> bcdboot DRIVE_LETTERWindows /s DRIVE_LETTER
    

    Replace DRIVE_LETTER with the drive letter for the volume that you want to sync. For example, F for F:\.

Create a snapshot without using VSS

In some situations, you might want to create snapshots of disks that are attached to Windows VMs without using VSS.

To create a disk snapshot on a Windows VM without using VSS, do the following:

  1. Prepare your system for a clean snapshot
  2. Create the snapshot
  3. Remount your disk
Prepare your system for a clean snapshot

Before you create a disk snapshot, make sure that you are taking a snapshot that is consistent with the state that you want for the disk. If you take a snapshot of your disk in an "unclean" state, it may force a disk check and possibly lead to data loss. Consider syncing and unmounting your file system.

Sync the file system

If unmounting your disk is not an option, such as in scenarios where an application might be writing data to the disk, you can sync your file system to flush the disk buffers. To sync your file system:

  1. Sign in to your Windows VM.
  2. Download and install the Sync tool from Microsoft.
  3. Stop your applications from writing to the disk.
  4. Open an elevated command prompt window.
  5. In the command line window, run:

    PS C:\> sync DRIVE_LETTER
    

    Replace DRIVE_LETTER with the drive letter for the volume that you want to sync. For example, F for F:\.

Unmount the disk
  1. Sign in to your Windows VM.

  2. Open a PowerShell command prompt and run the diskpart tool.

    PS C:\> diskpart
    
  3. Identify the disk that you want to unmount and snapshot.

    DISKPART> list disk
    
  4. Next, select the disk using the disk number that you just found.

    DISKPART> select disk DISK_NUMBER
    

    Replace DISK_NUMBER with the number of the disk that you want to remount.

  5. Unmount the disk.

    DISKPART> offline disk
    
Create a snapshot Remount your disk
  1. Sign in to your Windows VM.

  2. Open a PowerShell command prompt and run the diskpart tool.

    PS C:\> diskpart
    
  3. Identify the disk that you want to mount.

    DISKPART> list disk
    
  4. Use the select disk command to select the disk.

    DISKPART> select disk DISK_NUMBER
    

    Replace DISK_NUMBER with the number of the disk that you want to mount.

  5. Mount the disk.

    DISKPART> online disk
    
What's next

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.

Last updated 2025-08-07 UTC.

[[["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"]],["Last updated 2025-08-07 UTC."],[[["Compute Engine uses snapshots to back up disk data incrementally, offering higher performance and lower storage costs compared to complete disk images."],["Windows VMs utilize the Volume Shadow Copy Service (VSS) to create application-consistent snapshots, capturing application data at the time of backup without requiring instance stoppage or disk detachment."],["VSS snapshots on Windows are only compatible with instances using image version `v20160810` and newer, and the attached disk must use an NTFS, exFAT, or ReFS file system."],["Creating a VSS snapshot will mark the volume as read-only, and disks created from such snapshots are also read-only, which can be resolved by using the diskpart tool to remove the read-only flag."],["Snapshots can also be created on Windows VMs without using VSS, which involves preparing the system by syncing or unmounting the file system before taking the snapshot and marking the disk as available for read/write afterwards."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4