使用CLI将VM挂载到Linux驱动器 [英] Mount VM to linux drive with CLI

查看:71
本文介绍了使用CLI将VM挂载到Linux驱动器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢这样:


    az vm disk attach \

        --name $ disk_name \

        --size-gb $ disk_capacity \

        --sku $ disk_sku \

        --vm-name $ vm_name \

        --group-name $ RESOURCE_GROUP_NAME \

        --new



但我不知道如何在VM内部完成其余的挂载过程


我需要编写脚本而无需人工干预。任何帮助都表示赞赏。

解决方案

我们实际上有一个关于完成此任务的文档


https://docs.microsoft.com/en-us/azure/virtual-machines/linux/attach-disk-portal#connect-to-the-linux-vm-to-mount-the-new-disk


根据脚本编写它,你可以使用上面链接中的命令并使用自定义脚本扩展来自动化它


https://docs.microsoft.com/en-us/azure/virtual-machines / extensions / custom-script-linux


I am attachinglike this:

    az vm disk attach \
        --name $disk_name \
        --size-gb $disk_capacity \
        --sku $disk_sku \
        --vm-name $vm_name \
        --group-name $RESOURCE_GROUP_NAME \
        --new

but I don't know how to get the rest of the mount process done inside the VM

I need to script it with no human intervention. Any help is appreciated.

解决方案

We actually have a doc on accomplishing this

https://docs.microsoft.com/en-us/azure/virtual-machines/linux/attach-disk-portal#connect-to-the-linux-vm-to-mount-the-new-disk

As per scripting it, you could use the commands in the above link and use Custom Script Extension to automate it

https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/custom-script-linux


这篇关于使用CLI将VM挂载到Linux驱动器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆