From 43ff5e3d2a40af7f49e4b831ab7e5ce9bcbf18f6 Mon Sep 17 00:00:00 2001 From: Jing-song Date: Fri, 1 Nov 2024 10:56:01 +0800 Subject: [PATCH] vm disk tach --- Commands/tree.json | 50 +++ Commands/vm/disk/_attach-detach-data-disk.md | 9 + Commands/vm/disk/readme.md | 23 ++ Commands/vm/readme.md | 3 + .../2024-03-01.json | 1 + .../2024-03-01.xml | 295 ++++++++++++++++++ 6 files changed, 381 insertions(+) create mode 100644 Commands/vm/disk/_attach-detach-data-disk.md create mode 100644 Commands/vm/disk/readme.md create mode 100644 Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL3ZpcnR1YWxtYWNoaW5lcy97fS9hdHRhY2hkZXRhY2hkYXRhZGlza3M=/2024-03-01.json create mode 100644 Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL3ZpcnR1YWxtYWNoaW5lcy97fS9hdHRhY2hkZXRhY2hkYXRhZGlza3M=/2024-03-01.xml diff --git a/Commands/tree.json b/Commands/tree.json index adba55e6c..938728f78 100644 --- a/Commands/tree.json +++ b/Commands/tree.json @@ -212022,6 +212022,56 @@ "availability-set" ] }, + "disk": { + "commands": { + "attach-detach-data-disk": { + "help": { + "short": "Attach and detach data disks to/from the virtual machine." + }, + "names": [ + "vm", + "disk", + "attach-detach-data-disk" + ], + "versions": [ + { + "name": "2024-03-01", + "resources": [ + { + "id": "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/virtualmachines/{}/attachdetachdatadisks", + "plane": "mgmt-plane", + "version": "2024-03-01" + } + ], + "stage": "Preview" + } + ] + } + }, + "help": { + "lines": [ + "Azure Virtual Machines use disks as a place to store an operating system, applications, and", + " data. All Azure virtual machines have at least two disks: An operating system disk, and a", + " temporary disk. The operating system disk is created from an image, and both the operating", + " system disk and the image are actually virtual hard disks (VHDs) stored in an Azure storage", + " account. Virtual machines also can have one or more data disks, that are also stored as", + " VHDs.", + " Azure Managed and Unmanaged Data Disks have a maximum size of 4095 GB (with the exception of", + " larger disks in preview). Azure Unmanaged Disks also have a maximum capacity of 4095 GB.", + " For more information, see:", + " - Azure Disks - https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview.", + " - Larger Managed Disks in Public Preview - https://azure.microsoft.com/blog/introducing-the-", + " public-preview-of-larger-managed-disks-sizes/", + " - Ultra SSD Managed Disks in Public Preview - https://docs.microsoft.com/azure/virtual-", + " machines/disks-types." + ], + "short": "Manage the managed data disks attached to a VM." + }, + "names": [ + "vm", + "disk" + ] + }, "extension": { "commandGroups": { "image": { diff --git a/Commands/vm/disk/_attach-detach-data-disk.md b/Commands/vm/disk/_attach-detach-data-disk.md new file mode 100644 index 000000000..0181b27f6 --- /dev/null +++ b/Commands/vm/disk/_attach-detach-data-disk.md @@ -0,0 +1,9 @@ +# [Command] _vm disk attach-detach-data-disk_ + +Attach and detach data disks to/from the virtual machine. + +## Versions + +### [2024-03-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL3ZpcnR1YWxtYWNoaW5lcy97fS9hdHRhY2hkZXRhY2hkYXRhZGlza3M=/2024-03-01.xml) **Preview** + + diff --git a/Commands/vm/disk/readme.md b/Commands/vm/disk/readme.md new file mode 100644 index 000000000..11e0bf76f --- /dev/null +++ b/Commands/vm/disk/readme.md @@ -0,0 +1,23 @@ +# [Group] _vm disk_ + +Manage the managed data disks attached to a VM. + +Azure Virtual Machines use disks as a place to store an operating system, applications, and\ + data. All Azure virtual machines have at least two disks: An operating system disk, and a\ + temporary disk. The operating system disk is created from an image, and both the operating\ + system disk and the image are actually virtual hard disks (VHDs) stored in an Azure storage\ + account. Virtual machines also can have one or more data disks, that are also stored as\ + VHDs.\ + Azure Managed and Unmanaged Data Disks have a maximum size of 4095 GB (with the exception of\ + larger disks in preview). Azure Unmanaged Disks also have a maximum capacity of 4095 GB.\ + For more information, see:\ + - Azure Disks - https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview.\ + - Larger Managed Disks in Public Preview - https://azure.microsoft.com/blog/introducing-the-\ + public-preview-of-larger-managed-disks-sizes/\ + - Ultra SSD Managed Disks in Public Preview - https://docs.microsoft.com/azure/virtual-\ + machines/disks-types. + +## Commands + +- [attach-detach-data-disk](/Commands/vm/disk/_attach-detach-data-disk.md) +: Attach and detach data disks to/from the virtual machine. diff --git a/Commands/vm/readme.md b/Commands/vm/readme.md index d954d4da6..3bd68036f 100644 --- a/Commands/vm/readme.md +++ b/Commands/vm/readme.md @@ -7,6 +7,9 @@ Manage Linux or Windows virtual machines. - [availability-set](/Commands/vm/availability-set/readme.md) : Group resources into availability sets. +- [disk](/Commands/vm/disk/readme.md) +: Manage the managed data disks attached to a VM. + - [extension](/Commands/vm/extension/readme.md) : Manage extensions on VMs. diff --git a/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL3ZpcnR1YWxtYWNoaW5lcy97fS9hdHRhY2hkZXRhY2hkYXRhZGlza3M=/2024-03-01.json b/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL3ZpcnR1YWxtYWNoaW5lcy97fS9hdHRhY2hkZXRhY2hkYXRhZGlza3M=/2024-03-01.json new file mode 100644 index 000000000..fe7bc1a4b --- /dev/null +++ b/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL3ZpcnR1YWxtYWNoaW5lcy97fS9hdHRhY2hkZXRhY2hkYXRhZGlza3M=/2024-03-01.json @@ -0,0 +1 @@ +{"plane": "mgmt-plane", "resources": [{"id": "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/virtualmachines/{}/attachdetachdatadisks", "version": "2024-03-01", "swagger": "mgmt-plane/compute/ResourceProviders/Microsoft.Compute/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9yZXNvdXJjZUdyb3Vwcy97cmVzb3VyY2VHcm91cE5hbWV9L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS92aXJ0dWFsTWFjaGluZXMve3ZtTmFtZX0vYXR0YWNoRGV0YWNoRGF0YURpc2tz/V/MjAyNC0wMy0wMQ=="}], "commandGroups": [{"name": "vm disk", "commands": [{"name": "attach-detach-data-disk", "version": "2024-03-01", "resources": [{"id": "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/virtualmachines/{}/attachdetachdatadisks", "version": "2024-03-01", "swagger": "mgmt-plane/compute/ResourceProviders/Microsoft.Compute/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9yZXNvdXJjZUdyb3Vwcy97cmVzb3VyY2VHcm91cE5hbWV9L3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS92aXJ0dWFsTWFjaGluZXMve3ZtTmFtZX0vYXR0YWNoRGV0YWNoRGF0YURpc2tz/V/MjAyNC0wMy0wMQ=="}], "argGroups": [{"name": "", "args": [{"type": "ResourceGroupName", "var": "$Path.resourceGroupName", "options": ["g", "resource-group"], "required": true, "idPart": "resource_group"}, {"type": "SubscriptionId", "var": "$Path.subscriptionId", "options": ["subscription"], "required": true, "idPart": "subscription"}, {"type": "string", "var": "$Path.vmName", "options": ["vm-name"], "required": true, "idPart": "name", "help": {"short": "The name of the virtual machine."}}]}, {"name": "Parameters", "args": [{"type": "array", "var": "$parameters.dataDisksToAttach", "options": ["data-disks-to-attach"], "group": "Parameters", "help": {"short": "The list of managed data disks to be attached."}, "item": {"type": "object", "args": [{"type": "string", "var": "$parameters.dataDisksToAttach[].caching", "options": ["caching"], "help": {"short": "Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The defaulting behavior is: **None for Standard storage. ReadOnly for Premium storage.**"}, "enum": {"items": [{"name": "None", "value": "None"}, {"name": "ReadOnly", "value": "ReadOnly"}, {"name": "ReadWrite", "value": "ReadWrite"}]}}, {"type": "string", "var": "$parameters.dataDisksToAttach[].deleteOption", "options": ["delete-option"], "help": {"short": "Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** If this value is used, the data disk is retained after VM is deleted. The default value is set to **Detach**."}, "enum": {"items": [{"name": "Delete", "value": "Delete"}, {"name": "Detach", "value": "Detach"}]}}, {"type": "object", "var": "$parameters.dataDisksToAttach[].diskEncryptionSet", "options": ["disk-encryption-set"], "help": {"short": "Specifies the customer managed disk encryption set resource id for the managed disk."}, "args": [{"type": "string", "var": "$parameters.dataDisksToAttach[].diskEncryptionSet.id", "options": ["id"], "help": {"short": "Resource Id"}}]}, {"type": "string", "var": "$parameters.dataDisksToAttach[].diskId", "options": ["disk-id"], "required": true, "help": {"short": "ID of the managed data disk."}}, {"type": "integer32", "var": "$parameters.dataDisksToAttach[].lun", "options": ["lun"], "help": {"short": "The logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. If not specified, lun would be auto assigned."}}, {"type": "boolean", "var": "$parameters.dataDisksToAttach[].writeAcceleratorEnabled", "options": ["write-accelerator-enabled"], "help": {"short": "Specifies whether writeAccelerator should be enabled or disabled on the disk."}}]}}, {"type": "array", "var": "$parameters.dataDisksToDetach", "options": ["data-disks-to-detach"], "group": "Parameters", "help": {"short": "The list of managed data disks to be detached."}, "item": {"type": "object", "args": [{"type": "string", "var": "$parameters.dataDisksToDetach[].detachOption", "options": ["detach-option"], "help": {"short": "Supported options available for Detach of a disk from a VM. Refer to DetachOption object reference for more details."}, "enum": {"items": [{"name": "ForceDetach", "value": "ForceDetach"}]}}, {"type": "string", "var": "$parameters.dataDisksToDetach[].diskId", "options": ["disk-id"], "required": true, "help": {"short": "ID of the managed data disk."}}]}}]}], "operations": [{"longRunning": {"finalStateVia": "location"}, "operationId": "VirtualMachines_AttachDetachDataDisks", "http": {"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/attachDetachDataDisks", "request": {"method": "post", "path": {"params": [{"type": "string", "name": "resourceGroupName", "arg": "$Path.resourceGroupName", "required": true}, {"type": "string", "name": "subscriptionId", "arg": "$Path.subscriptionId", "required": true}, {"type": "string", "name": "vmName", "arg": "$Path.vmName", "required": true}]}, "query": {"consts": [{"readOnly": true, "const": true, "default": {"value": "2024-03-01"}, "type": "string", "name": "api-version", "required": true}]}, "body": {"json": {"schema": {"type": "object", "name": "parameters", "required": true, "props": [{"type": "array", "name": "dataDisksToAttach", "arg": "$parameters.dataDisksToAttach", "item": {"type": "object", "props": [{"type": "string", "name": "caching", "arg": "$parameters.dataDisksToAttach[].caching", "enum": {"items": [{"value": "None"}, {"value": "ReadOnly"}, {"value": "ReadWrite"}]}}, {"type": "string", "name": "deleteOption", "arg": "$parameters.dataDisksToAttach[].deleteOption", "enum": {"items": [{"value": "Delete"}, {"value": "Detach"}]}}, {"type": "object", "name": "diskEncryptionSet", "arg": "$parameters.dataDisksToAttach[].diskEncryptionSet", "props": [{"type": "string", "name": "id", "arg": "$parameters.dataDisksToAttach[].diskEncryptionSet.id"}]}, {"type": "string", "name": "diskId", "arg": "$parameters.dataDisksToAttach[].diskId", "required": true}, {"type": "integer32", "name": "lun", "arg": "$parameters.dataDisksToAttach[].lun"}, {"type": "boolean", "name": "writeAcceleratorEnabled", "arg": "$parameters.dataDisksToAttach[].writeAcceleratorEnabled"}]}, "identifiers": ["diskId"]}, {"type": "array", "name": "dataDisksToDetach", "arg": "$parameters.dataDisksToDetach", "item": {"type": "object", "props": [{"type": "string", "name": "detachOption", "arg": "$parameters.dataDisksToDetach[].detachOption", "enum": {"items": [{"value": "ForceDetach"}]}}, {"type": "string", "name": "diskId", "arg": "$parameters.dataDisksToDetach[].diskId", "required": true}]}, "identifiers": ["diskId"]}], "clientFlatten": true}}}}, "responses": [{"statusCode": [200], "body": {"json": {"var": "$Instance", "schema": {"type": "object", "props": [{"type": "array", "name": "dataDisks", "item": {"type": "object", "props": [{"type": "string", "name": "caching", "enum": {"items": [{"value": "None"}, {"value": "ReadOnly"}, {"value": "ReadWrite"}]}}, {"type": "string", "name": "createOption", "required": true, "enum": {"items": [{"value": "Attach"}, {"value": "Copy"}, {"value": "Empty"}, {"value": "FromImage"}, {"value": "Restore"}]}}, {"type": "string", "name": "deleteOption", "enum": {"items": [{"value": "Delete"}, {"value": "Detach"}]}}, {"type": "string", "name": "detachOption", "enum": {"items": [{"value": "ForceDetach"}]}}, {"readOnly": true, "type": "integer64", "name": "diskIOPSReadWrite"}, {"readOnly": true, "type": "integer64", "name": "diskMBpsReadWrite"}, {"type": "integer32", "name": "diskSizeGB"}, {"type": "@VirtualHardDisk_read", "name": "image"}, {"type": "integer32", "name": "lun", "required": true}, {"type": "@ManagedDiskParameters_read", "name": "managedDisk"}, {"type": "string", "name": "name"}, {"type": "object", "name": "sourceResource", "props": [{"type": "string", "name": "id"}]}, {"type": "boolean", "name": "toBeDetached"}, {"type": "@VirtualHardDisk_read", "name": "vhd"}, {"type": "boolean", "name": "writeAcceleratorEnabled"}]}, "identifiers": ["lun"]}, {"type": "string", "name": "diskControllerType", "enum": {"items": [{"value": "NVMe"}, {"value": "SCSI"}]}}, {"type": "object", "name": "imageReference", "props": [{"type": "string", "name": "communityGalleryImageId"}, {"readOnly": true, "type": "string", "name": "exactVersion"}, {"type": "string", "name": "id"}, {"type": "string", "name": "offer"}, {"type": "string", "name": "publisher"}, {"type": "string", "name": "sharedGalleryImageId"}, {"type": "string", "name": "sku"}, {"type": "string", "name": "version"}]}, {"type": "object", "name": "osDisk", "props": [{"type": "string", "name": "caching", "enum": {"items": [{"value": "None"}, {"value": "ReadOnly"}, {"value": "ReadWrite"}]}}, {"type": "string", "name": "createOption", "required": true, "enum": {"items": [{"value": "Attach"}, {"value": "Copy"}, {"value": "Empty"}, {"value": "FromImage"}, {"value": "Restore"}]}}, {"type": "string", "name": "deleteOption", "enum": {"items": [{"value": "Delete"}, {"value": "Detach"}]}}, {"type": "object", "name": "diffDiskSettings", "props": [{"type": "string", "name": "option", "enum": {"items": [{"value": "Local"}]}}, {"type": "string", "name": "placement", "enum": {"items": [{"value": "CacheDisk"}, {"value": "NvmeDisk"}, {"value": "ResourceDisk"}]}}]}, {"type": "integer32", "name": "diskSizeGB"}, {"type": "object", "name": "encryptionSettings", "props": [{"type": "object", "name": "diskEncryptionKey", "props": [{"type": "string", "name": "secretUrl", "required": true}, {"type": "object", "name": "sourceVault", "required": true, "props": [{"type": "string", "name": "id"}], "cls": "SubResource_read"}]}, {"type": "boolean", "name": "enabled"}, {"type": "object", "name": "keyEncryptionKey", "props": [{"type": "string", "name": "keyUrl", "required": true}, {"type": "@SubResource_read", "name": "sourceVault", "required": true}]}]}, {"type": "@VirtualHardDisk_read", "name": "image"}, {"type": "object", "name": "managedDisk", "props": [{"type": "object", "name": "diskEncryptionSet", "props": [{"type": "string", "name": "id"}], "cls": "DiskEncryptionSetParameters_read"}, {"type": "string", "name": "id"}, {"type": "object", "name": "securityProfile", "props": [{"type": "@DiskEncryptionSetParameters_read", "name": "diskEncryptionSet"}, {"type": "string", "name": "securityEncryptionType", "enum": {"items": [{"value": "DiskWithVMGuestState"}, {"value": "NonPersistedTPM"}, {"value": "VMGuestStateOnly"}]}}]}, {"type": "string", "name": "storageAccountType", "enum": {"items": [{"value": "PremiumV2_LRS"}, {"value": "Premium_LRS"}, {"value": "Premium_ZRS"}, {"value": "StandardSSD_LRS"}, {"value": "StandardSSD_ZRS"}, {"value": "Standard_LRS"}, {"value": "UltraSSD_LRS"}]}}], "cls": "ManagedDiskParameters_read"}, {"type": "string", "name": "name"}, {"type": "string", "name": "osType", "enum": {"items": [{"value": "Linux"}, {"value": "Windows"}]}}, {"type": "object", "name": "vhd", "props": [{"type": "string", "name": "uri"}], "cls": "VirtualHardDisk_read"}, {"type": "boolean", "name": "writeAcceleratorEnabled"}]}]}}}}, {"statusCode": [202], "header": {"items": [{"name": "Location"}]}}, {"isError": true, "body": {"json": {"schema": {"type": "@ODataV4Format"}}}}]}}], "outputs": [{"type": "object", "ref": "$Instance", "clientFlatten": true}], "confirmation": ""}]}]} \ No newline at end of file diff --git a/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL3ZpcnR1YWxtYWNoaW5lcy97fS9hdHRhY2hkZXRhY2hkYXRhZGlza3M=/2024-03-01.xml b/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL3ZpcnR1YWxtYWNoaW5lcy97fS9hdHRhY2hkZXRhY2hkYXRhZGlza3M=/2024-03-01.xml new file mode 100644 index 000000000..2e7a33b26 --- /dev/null +++ b/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL3ZpcnR1YWxtYWNoaW5lcy97fS9hdHRhY2hkZXRhY2hkYXRhZGlza3M=/2024-03-01.xml @@ -0,0 +1,295 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + + + + + +
+
+ +
+
+