Skip to content

Latest commit

 

History

History
220 lines (143 loc) · 12 KB

create-storage-path.md

File metadata and controls

220 lines (143 loc) · 12 KB
title description author ms.author ms.topic ms.service ms.date
Create storage path for Azure Local virtual machines images
Learn how to create storage path for use with VM images for your Azure Local instance.
alkohli
alkohli
how-to
azure-local
12/02/2024

Create storage path for Azure Local

[!INCLUDE hci-applies-to-23h2]

This article describes how to create storage path for VM images used on your Azure Local instance. Storage paths are an Azure resource and are used to provide a path to store VM configuration files, VM image, and VHDs on your system. You can create a storage path using the Azure CLI or Azure portal.

About storage path

When your Azure Local is deployed, storage paths are created as part of the deployment. The default option automatically selects a storage path with high availability. You might however decide to use a specific storage path. In this case, ensure that the specified storage path has sufficient storage space.

The storage paths on your Azure Local should point to cluster shared volumes that can be accessed by all the machines on your system. In order to be highly available, we strongly recommend that you create storage paths under cluster shared volumes.

The available space in the cluster shared volume determines the size of the store available at the storage path. For example, if the storage path is C:\ClusterStorage\UserStorage_1\Volume01 and the Volume01 is 4 TB, then the size of the storage path is the available space (out of the 4 TB) on Volume01.

Prerequisites

Before you begin, make sure to complete the following prerequisites:

  1. Make sure that complete the Azure Local requirements.

  2. Make sure that a cluster shared volume exists on your Azure Local that is accessible from all the machines in the system. The storage path that you intend to provide on a cluster shared volume should have sufficient space for storing VM images. By default, cluster shared volumes are created during the deployment of Azure Local.

    You can create storage paths only within cluster shared volumes that are available in the system. For more information, see Create a cluster shared volume.

Create a storage path on your system

You can use the Azure CLI or Azure portal to create a storage path on your system.

You can use the stack-hci-vm storagepath cmdlets to create, show, and list the storage paths on your Azure Local.

Review parameters used to create a storage path

The following parameters are required when you create a storage path:

Parameter Description
name Name of the storage path that you create for your Azure Local. Make sure to provide a name that follows the Rules for Azure resources. You can't rename a storage path after it's created.
resource-group Name of the resource group where you create the storage path. For ease of management, we recommend that you use the same resource group as your Azure Local.
subscription Name or ID of the subscription where your Azure Local is deployed. This could also be another subscription you use for storage path on your Azure Local.
custom-location Name or ID of the custom location associated with your Azure Local where you're creating this storage path.
path Path on a disk to create storage path. The selected path should have sufficient space available for storing your VM image.

You could also use the following optional parameters:

Parameter Description
location Azure regions as specified by az locations.

Create a storage path

Follow these steps on one of the machines of your Azure Local instance to create a storage path:

Sign in and set subscription

[!INCLUDE hci-vm-sign-in-set-subscription]

Set parameters

  1. Set parameters for your subscription, resource group, location, OS type for the image. Replace the < > with the appropriate values.

    $storagepathname="<Storage path name>"
    $path="<Path on the disk to cluster shared volume>"
    $subscription="<Subscription ID>"
    $resource_group="<Resource group name>"
    $customLocName="<Custom location of your Azure Local>"
    $customLocationID="/subscriptions/<Subscription ID>/resourceGroups/$resource_group/providers/Microsoft.ExtendedLocation/customLocations/$customLocName"
    $location="<Azure region where the system is deployed>"
    
  2. Create a storage path test-storagepath at the following path: C:\ClusterStorage\test-storagepath. Run the following cmdlet:

    az stack-hci-vm storagepath create --resource-group $resource_group --custom-location $customLocationID --name $storagepathname --path $path
    

    For more information on this cmdlet, see az stack-hci-vm storagepath create.

    Here's a sample output:

    PS C:\windows\system32> $storagepathname="test-storagepath"
    PS C:\windows\system32> $path="C:\ClusterStorage\UserStorage_1\mypath"
    PS C:\windows\system32> $subscription="<Subscription ID>"
    PS C:\windows\system32> $resource_group="mylocal-rg"
    PS C:\windows\system32> $customLocationID="/subscriptions/<Subscription ID>/resourceGroups/mylocal-rg/providers/Microsoft.ExtendedLocation/customLocations/mylocal-cl"
    
    PS C:\windows\system32> az stack-hci-vm storagepath create --name $storagepathname --resource-group $resource_group --custom-location $customLocationID --path $path
    Command group 'stack-hci-vm' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus
    {
      "extendedLocation": {
        "name": "/subscriptions/<Subscription ID>/resourceGroups/mylocal-rg/providers/Microsoft.ExtendedLocation/customLocations/mylocal-cl",
        "type": "CustomLocation"
      },
      "id": "/subscriptions/<Subscription ID>/resourceGroups/mylocal-rg/providers/Microsoft.AzureStackHCI/storagecontainers/test-storagepath",
      "location": "eastus",
      "name": "test-storagepath",
      "properties": {
        "path": "C:\\ClusterStorage\\UserStorage_1\\mypath",
        "provisioningState": "Succeeded",
        "status": {
          "availableSizeMB": 36761,
          "containerSizeMB": 243097
        }
      },
      "resourceGroup": "mylocal-rg",
      "systemData": {
        "createdAt": "2023-10-06T04:45:30.458242+00:00",
        "createdBy": "[email protected]",
        "createdByType": "User",
        "lastModifiedAt": "2023-10-06T04:45:57.386895+00:00",
        "lastModifiedBy": "319f651f-7ddb-4fc6-9857-7aef9250bd05",
        "lastModifiedByType": "Application"
      },
      "tags": null,
      "type": "microsoft.azurestackhci/storagecontainers"
    }

Once the storage path creation is complete, you're ready to create virtual machine images.

Delete a storage path

If a storage path isn't required, you can delete it. To delete a storage path, first remove the associated workloads and then run the following command to delete the storage path:

az stack-hci-vm storagepath delete --resource-group "<resource group name>" --name "<storagepath name>" --yes

To verify that a storage path is deleted, run the following command:

az stack-hci-vm storagepath show --resource-group "<resource group name>" --name "<storagepath name>" 

You receive a notification that the storage path doesn't exist.

To delete a volume, first remove the associated workloads, then remove the storage paths, and then delete the volume. For more information, see Delete a volume.

If there's insufficient space at the storage path, then the VM provisioning using that storage path would fail. You might need to expand the volume associated with the storage path. For more information, see Expand the volume.

To troubleshoot any error when trying to delete a storage path, see Failure deleting storage path.

You can use the Azure portal to create, show, and list the storage paths on your Azure Local instance.

Create a storage path

Follow these steps in Azure portal of your Azure Local.

  1. Go to Azure Local resource and then go to Storage paths. If you chose to create workload volumes during the deployment, default storage paths were also automatically created. You can see these default storage paths that were created during deployment.

  2. From the top command bar in the right pane, select + Create storage path.

    :::image type="content" source="./media/create-storage-path/create-storage-path-1.png" alt-text="Screenshot of select + Create storage path." lightbox="./media/create-storage-path/create-storage-path-1.png":::

  3. In the Create storage path pane, input the following parameters:

    1. Specify a file system path on your disk where the VMs, VM images and other data reside. This path should be on a cluster shared volume (CSV) on your system.
    2. Provide a friendly name for your storage path. The name should be 3 to 64 characters long and should contain letters, numbers, and hyphens.

    :::image type="content" source="./media/create-storage-path/create-storage-path-2.png" alt-text="Screenshot of specifying file path and friendly name." lightbox="./media/create-storage-path/create-storage-path-2.png":::

  4. You'll see a notification that the storage path creation job has started. Once the storage path is created, the list refreshes to display the newly created storage path.

    :::image type="content" source="./media/create-storage-path/create-storage-path-3.png" alt-text="Screenshot of new storage path added to list of storage paths." lightbox="./media/create-storage-path/create-storage-path-3.png":::

View the storage path properties

Follow these steps in Azure portal of your Azure Local.

  1. Go to Azure Local resource and then go to Storage paths.

  2. Select the storage path name. This should drill down in to the storage path properties.

    :::image type="content" source="./media/create-storage-path/view-storage-path-properties-1.png" alt-text="Screenshot of storage path properties." lightbox="./media/create-storage-path/view-storage-path-properties-1.png":::

Delete a storage path

Follow these steps in Azure portal of your Azure Local.

  1. Go to Azure Local resource and then go to Storage paths.

  2. For the storage path that you wish to delete, select the corresponding trashcan icon.

    :::image type="content" source="./media/create-storage-path/delete-storage-path-1.png" alt-text="Screenshot of delete icon selected for the storage path to delete." lightbox="./media/create-storage-path/delete-storage-path-1.png":::

  3. In the confirmation dialog, select Yes to continue.

    :::image type="content" source="./media/create-storage-path/delete-storage-path-2.png" alt-text="Screenshot of deletion confirmation." lightbox="./media/create-storage-path/delete-storage-path-2.png":::

  4. You'll see a notification that the storage path deletion job has started. Once the storage path is deleted, the list refreshes to display the remaining storage paths.

    :::image type="content" source="./media/create-storage-path/delete-storage-path-3.png" alt-text="Screenshot of updated storage path list after the deletion." lightbox="./media/create-storage-path/delete-storage-path-3.png":::


Next steps