简体   繁体   中英

Azure : How to expand disk size for VM which is part of scaleset?

Am new to Azure and am stuck with one scenario.

I have an env. which consists of multiple scaleset and each scaleset has min. 2-3 instance. Each instance is built up with 2 partitions/drive each of 50 GB disk. Disks are managed disk.

Now

/dev/sdd 50G 45G 5G 90% /data/zk

/dev/sdc 50G 25G 25G 50% /data/kafka

After certain point, disk size reaches 90% and we have to increase disk size. So for 1 of the partition i need to increase disk size by say 100 GB.

So expected output should be something like (after increasing disk size for zk by 100 GB)

Expected

/dev/sdd 150G 45G 105G 30% /data/zk

/dev/sdc 50G 25G 25G 50% /data/kafka

I did some research online but didn't find way to expand disk size.

Has someone done this before?

一般过程将是在比例尺集模型上进行PUT(此处描述: https : //docs.microsoft.com/zh-cn/azure/virtual-machine-scale-sets/virtual-machine-scale-sets- upgrade-scale-set ),尤其是在数据磁盘定义中的“ diskSizeGb”属性上:

"storageProfile": { "imageReference": { "sku": "2016-Datacenter", "publisher": "MicrosoftWindowsServer", "version": "latest", "offer": "WindowsServer" }, "osDisk": { "caching": "ReadWrite", "managedDisk": { "storageAccountType": "Standard_LRS" }, "createOption": "FromImage" }, "dataDisks": [ { "diskSizeGB": 1023, "createOption": "Empty", "lun": 0 }, { "diskSizeGB": 1023, "createOption": "Empty", "lun": 1 } ] },

Based on my knowledge, maybe you can detach managed disk from vmss, then use Azure portal to expand data disk size, then attach managed disk to that VMSS instance, then use shell to mount and expand it in system.

C:\Users\jasony>az vmss disk attach -h

Command
    az vmss disk attach: Attach managed data disks to a scale set or its instances.

Arguments
    --caching          : Disk caching policy.  Allowed values: None, ReadOnly, ReadWrite.
    --disk             : Existing disk name or ID to attach or detach from VM instances.
    --lun              : 0-based logical unit number (LUN). Max value depends on the Virtual Machine
                         instance size.
    --size-gb -z       : Size in GB.

Resource Id Arguments
    --ids              : One or more resource IDs (space-delimited). If provided, no other 'Resource
                         Id' arguments should be specified.
    --instance-id      : Scale set VM instance id.
    --name -n          : Scale set name. You can configure the default using `az configure
                         --defaults vmss=<name>`.
    --resource-group -g: Name of resource group. You can configure the default group using `az
                         configure --defaults group=<name>`.

Global Arguments
    --debug            : Increase logging verbosity to show all debug logs.
    --help -h          : Show this help message and exit.
    --output -o        : Output format.  Allowed values: json, jsonc, table, tsv.  Default: json.
    --query            : JMESPath query string. See http://jmespath.org/ for more information and
                         examples.
    --verbose          : Increase logging verbosity. Use --debug for full debug logs.

Note: You should remember which disk attach to which VMSS instance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM