anjuna-azure-cli disk upload
anjuna-azure-cli disk upload \ --image-gallery <image-gallery> \ --image-version <image-version> \ --resource-group <resource-group> \ --storage-account <storage-account> \ --storage-container <storage-container> [OPTIONS...]
Uploads the local disk image to an Azure Storage Container and creates a shared image in an Azure Shared Image Gallery. The Shared Image is saved as an Image Version of a pre-existing Image Definition.
You need to have the following resources ready before issuing the upload command.
The anjuna-azure-cli
command does not create the resources.
-
Resource Group
-
Storage Account
-
Storage Container
-
Image Gallery
-
Image Definition (settings shown below)
You must be logged in to a valid Azure account permitted to access the cloud storage.
Use the az account show command to confirm that you are logged in.
If you are not logged in, consider using the az login command to initialize your az session.
|
To ensure the disk upload operation proceeds without interruptions, Anjuna recommends to explicitly specify an Azure subscription.
This can be accomplished by providing the --subscription-id option on the anjuna-azure-cli command line or by configuring the default subscription in the Azure CLI,
following Microsoft’s documentation.
If a subscription is not specified, the Azure CLI’s attempt to automatically detect a subscription may not work reliably,
potentially causing the disk upload operation to fail intermittently.
|
Azure requires some resources to be created in the same region/location.
Uploading the disk is a two-step operation, with step one uploading the disk to the storage container,
and step two creating an Image Version.
anjuna-azure-cli combines these steps.
Azure requires the disk and the Image Version to be in the same region.
The disk is associated with the location of the storage container.
If no location or region is set, the Image Version is associated with an inherited location.
Therefore, to prevent unexpected errors,
it is advisable to provide an explicit location or target-region on the anjuna-azure-cli command line.
|
Image Definition settings
The Azure Image Definition must have the following settings to be used with anjuna-azure-cli disk upload
:
Architecture: "x64" Features: { SecurityType: "ConfidentialVmSupported" } HyperVGeneration: "V2" OsState: "Specialized" OsType: "Linux"
Options
Usage
anjuna-azure-cli disk upload \ --image-gallery <image-gallery> \ --image-version <image-version> \ --resource-group <resource-group> \ --storage-account <storage-account> \ --storage-container <storage-container> [OPTIONS...]
--image-definition
The Azure Image Definition to be updated (default: uses the value passed by --image-name
)
--resource-group
(Required) The Azure resource group to be used for the artifacts needed for this operation
--target-regions <region>[=<replica count>][=<storage account type>]
Use <region>[=<replica count>][=<storage account type>]
to set regions and associated properties
Global options
The following options are available for all anjuna-azure-cli
subcommands.
Global options
-h, --help
Prints the help information for the command
--debug
Prints debug messaging
-v, --version
Prints the anjuna-azure-cli
version
Also read:
|
Examples
$ az sig image-definition show -g my-tests -r my_image_gallery --gallery-image-definition my_linux_image
{
"architecture": "x64",
"description": "",
"disallowed": {
"diskTypes": []
},
"endOfLifeDate": null,
"eula": null,
"features": [
{
"name": "SecurityType",
"value": "ConfidentialVmSupported"
}
],
"hyperVGeneration": "V2",
"id": "/subscriptions/****/resourceGroups/my-tests/providers/Microsoft.Compute/galleries/my_image_gallery/images/my_linux_image",
"identifier": {
"offer": "CVMGA",
"publisher": "Anjuna",
"sku": "mylinuxos"
},
"location": "eastus",
"name": "my_linux_image",
"osState": "Specialized",
"osType": "Linux",
"privacyStatementUri": null,
"provisioningState": "Succeeded",
"purchasePlan": null,
"recommended": {
"memory": {
"max": null,
"min": null
},
"vCpUs": {
"max": null,
"min": null
}
},
"releaseNoteUri": null,
"resourceGroup": "my-tests",
"tags": {},
"type": "Microsoft.Compute/galleries/images"
}
$ anjuna-azure-cli disk upload \
--disk hello-world-disk.vhd \
--image-name hello-world-disk.vhd \
--storage-account mystorageaccount \
--storage-container mystoragecontainer \
--resource-group myresourcegroup \
--image-gallery my_image_gallery \
--image-definition my_linux_image \
--image-version 0.1.0 \
--location eastus \
--subscription-id 123abcde-1234-1234-1234-12345678