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 creation of the disk as many times 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. Login or return to the Microsoft Azure Portal
  2. In the upper left corner menu select All Services and search for Disks.
    Alternatively select Disks from the favorites list.
  3. Select the disk that was created in the prior step.
    The Disk page for that disk appears.
  4. From the menu at the top, 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 on such as
    Okta-AccessGateway-2020.5.0-Snapshot.
  6. Choose a Resource group for the snapshot.
    Okta recommends using the same Resource Group used to hold the parent disk.
  7. For Account type, select Standard (HDD).
  8. Click Create. A snapshot of the disk will be created.
    Note that 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 will open.
  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 etc.
  5. Choose a Resource group for the disk.
    Okta recommends using the same Resource Group used to hold the parent disk.
  6. For Account type, select either Standard (HDD) or Premium (SSD) storage. Okta recommends the use of Premium storage for disk and Standard storage for snapshots.
  7. In Source type, ensure Snapshot is selected.
  8. In the Source snapshot drop-down, select the previously created snapshot.
  1. Login or return to the Microsoft Azure command line interface.

    az login

  2. Using the az disk list command 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 will produce results resembling:

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

  3. Using the az snapshot create command 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 such as "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 will produce results resembling:

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

  4. Using the az disk create command 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.
      Note, 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 such as "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 will produce results resembling:

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

Repeat as required, creating the required number of disks for the intended cluster size.

Tip

Tip

Okta recommends that you NOT use the original disk for any member, but rather reserve for later use in expanding the cluster.

See Also