Copy a disk
Uploading and configuring a disk image is a time-consuming process. When configuring an Access Gateway cluster, a disk is required for each instance. Create and upload a disk (primary) and then replicate that disk as many times as required using snapshots (copies for cluster members).
Ensure that you have run the az disk revoke-access command or its UI equivalent, before replicating the disk. Failure to revoke prior access to the disk can cause commands to time out or fail due to the disk being unavailable.
Use the Microsoft Azure Portal
There are two steps to copying a disk using the Microsoft Azure Portal. First you create a snapshot, and then you create the copy of the disk.
Create a snapshot
- Sign in to the Microsoft Azure Portal
- Select All Services from the menu, and then search for Disks.
- Select Disks. Alternatively, select Disks from the favorites list.
- Select the disk that you created in Upload, create, and populate a managed disk. The disk page appears.
- Select Create snapshot.
- Enter a name for the snapshot. Include the version of Access Gateway in the name.
- Choose a resource group for the snapshot. Use the same resource group that holds the parent disk.
- For Account type, select Standard (HDD).
- Click Create.
Create a disk copy
- Select Create a resource in the left menu.
- In the search box, enter managed disk, and then select Managed Disks from the list.
- Click Create.
- Enter a name for the new disk. Use a name that identifies the node type of the disk, like Okta-AccessGateway-<OAG_VERSION>-Admin, Okta-AccessGateway-<OAG_VERSION>-Worker1, and so on.
- Choose a resource group for the disk. Use the same resource group that holds the parent disk.
- For Account type, select either Standard (HDD) or Premium (SSD) storage. Use premium storage for the disk and standard storage for snapshots.
- In Source type, select Snapshot.
- In the Source snapshot dropdown menu, select the snapshot you created earlier in this procedure.
Use the command line
-
Use the az login command to sign in to the Microsoft Azure command-line interface.
-
Use the az disk list command to list the details of available disks.
az disk list --resource-group <resource-group>
In this example, <resource-group> is the name of the previously created resource group.
If you replace <resource-group> with AccessGateway, the following result appears:
{ . . . "encryptionSettingsCollection": null,"hyperVgeneration": "V1", "id": "/subscriptions/8bc.../resourceGroups/AccessGateway. . ./disks/AG2020-05-00", "location": "eastus", . . . }
-
Use the az snapshot create command to create a snapshot of the existing disk.
Copyaz snapshot create --resource-group <resource-group> \
--source <diskid> \
--name <disk-name>- <resource-group>: The name of the previously created resource group.
- <disk-id>: The value of the ID field from the az disk list.
- <disk-name>: The name of the snapshot that you're creating.
If you replace <resource-group> with AccessGateway, and <disk-name> with AG2020-05.0, the following result appears:
{ . . . encryptionSettingsCollection": null, hyperVgeneration": "V1", "id": "/subscriptions/8bc9effd-.../snapshots/. . . .snapshot", . . . }
-
Use the az disk create command to create a disk from an existing snapshot.
Copyaz disk create --resource-group <resource-group> \
--name <disk-name> --source <snapshot-id>- <resource-group>: The name of the previously created resource group.
- <snapshot-id>: The value of the ID field from the az snapshot create command. Use az snapshot list --resource-group <resource-group> to view a list of the snapshots.
- <disk-name>: The name of the disk that you're creating.
If you replace <resource-group> with AccessGateway, <disk-name> with AG2020-05.0, and <snapshot-id> with AccessGateway, the following result appears:
{ "creationData": { "createOption": "Copy", . . . "id": "/subscriptions/8bc9effd-...e/disks/AccessGateway. . .-Admin", "location":"eastus" . . . }
Repeat as required to create the required number of disks for the intended cluster size.
Keep the original disk for creating more copies for the cluster and don't use it as a member of the cluster.