Copy disk

Uploading and configuring a disk image is a time consuming process. When configuring an Access Gateway cluster, a disk is required per instance. Okta recommends the best practice of creating and uploading a disk and then replicating that disk as many times as required using snapshots.


During this task you will:

  • Create a snapshot
  • Create a disk from a snapshot
  • Repeat the disk creation as required for your Access Gateway cluster

 

Caution

Caution

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.

 

Create a snapshot

  1. Sign in or return to the Microsoft Azure Portal
  2. From the menu, select All Services and search for Disks.
    Alternatively, select Disks from the favorites list.
  3. Select the disk you created in the prior step.
    The Disk page for the disk opens.
  4. From the menu, select Create snapshot.
  5. Enter a name for the snapshot.
    Okta recommends a name that represents the version of Access Gateway the disk is based. For example,
    Okta-AccessGateway-2020.5.0-Snapshot.
  6. Choose a Resource group for the snapshot.
    Okta recommends you use the Resource Group used to hold the parent disk.
  7. For Account type, select Standard (HDD).
  8. Click Create. A snapshot of the disk is created.
    It can take a few minutes for the snapshot process to complete.

Create a disk copy

  1. Select Create a resource in the left menu.
  2. In the search box, enter managed disk and then select Managed Disks from the list.
    The Managed Disks page opens.
  3. Click Create.
  4. Enter a name for the new disk.
    Okta recommends using a name that represents the disks intended use. For example, Okta-AccessGateway-2020.5.0-Admin, Okta-AccessGateway-2020.5.0-Worker1, Okta-AccessGateway-2020.5.0-Worker2, and so on.
  5. Choose a Resource group for the disk.
    Okta recommends you use the Resource Group used to hold the parent disk.
  6. For Account type, select either Standard (HDD) or Premium (SSD) storage.
    Okta recommends you use the Premium storage for disk and Standard storage for snapshots.
  7. In Source type, ensure Snapshot is selected.
  8. In the Source snapshot drop-down box, select the snapshot you created earlier.
  1. Sign in or return to the Microsoft Azure command line interface.

    az login

     

  2. Use the az disk list command to list the details of available disks.

    az disk list --resource-group <resource-group>

    Where:

    • <resource-group> is the name of the previously created resource group. For example, AccessGateway.

     

    For example:

    az disk list --resource-group AccessGateway 

     

    Which produces the following results:

    {
    . . .
    "encryptionSettingsCollection": null,"hyperVgeneration": "V1", "id": "/subscriptions/8bc.../resourceGroups/AccessGateway. . ./disks/AG2020-05-00", "location": "eastus",     . . . }

     

  3. Use the az snapshot create command to create a snapshot of the existing disk.

    az snapshot create --resource-group <resource-group> \
                       --source <diskid> \
                       --name <disk-name>

    Where:

    • <resource-group> is the name of the previously created resource group. For example, AccessGateway.
    • <disk-id> is the value of the ID field from the az disk list.
    • <disk-name> is the name of the snapshot being created. For example, AccessGateway-2020.05.0-Snapshot.

     

    For example:

    az snapshot create --resource-group AccessGateway \
       --source /subscriptions/8bc9effd-. . ..AG2020-05-00 \
       --name AccessGateway2020-05-00.snapshot

     

    Which produces the following results:

    {
    . . .
    encryptionSettingsCollection": null, hyperVgeneration": "V1", "id": "/subscriptions/8bc9effd-.../snapshots/OAG2020-05-0.snapshot", . . . }

     

  4. Use the az disk create command to create a disk from an existing snapshot

    az disk create --resource-group <resource-group> \
                    --name <disk-name>
                    --source <snapshot-id>

    Where:

    • <resource-group> is the name of the previously created resource group. For example, AccessGateway.
    • <snapshot-id> is the value of the ID field from the az snapshot create.
      You can use az snapshot list --resource-group <resource-group> to list the known snapshots.
    • <disk-name> is the name of the disk being created. For example, AccessGateway-2020.05.0-Admin.

     

    For example:

    az disk create --resource-group AccessGateway \
       --source /subscriptions/8bc9effd-.../snapshots/OAG2020-05-0.snapshot \
       --name AccessGateway2020.05.0-Admin

     

    Which produces the following results:

    {
        "creationData": {
        "createOption": "Copy",
        . . . 
        "id": "/subscriptions/8bc9effd-...e/disks/AccessGateway2020.05.00-Admin",
        "location":"eastus"
        . . .
    } 
    

Repeat as required to create the required number of disks for the intended cluster size.

Tip

Tip

Okta recommends that you reserve the original disk for expanding the cluster instead of using it for any member.