需求描述

在部署完 ARM 模式的虚拟机以后,可以通过 PowerShell 命令来调整虚拟机的尺寸,以下是通过 PowerShell 命令来调整 ARM 模式的虚拟机尺寸。

Note

本文只限于 ARM 模式下的虚拟机,经典模式的虚拟机不适用。

操作步骤

  1. 首先,我们需要使用下面的命令定义需要调整尺寸的虚拟机的基本信息:

     
     #定义资源组名称
    $ResourceGroupName = <资源组名称>
    #定义需要调整尺寸的虚拟机名称
    $VMName = <虚拟机名称>
    #定义虚拟机的新尺寸,这里以Standard_A1为例,详细尺寸列表见附录部分
    $NewVMSize = "Standard_A1"
  2. 定义完成后,使用下面的命令将虚拟机调整到新的尺寸:

     
     #获取虚拟机对象
    $vm = Get-AzureRmVM -ResourceGroupName <资源组名称> -Name <虚拟机名称>
    #设定新尺寸
    $vm.HardwareProfile.vmSize = $NewVMSize
    #将虚拟机调整为新尺寸
    Update-AzureRmVM -ResourceGroupName $ResourceGroupName -VM $vm
  3. 待命令执行完成后,可以看到虚拟机的尺寸已调整完毕:

附录

尺寸名称 尺寸变量名
A0基本 Basic_A0
A1基本 Basic_A1
A2基本 Basic_A2
A3基本 Basic_A3
A4基本 Basic_A4
A0标准 Standard_A0
A1标准 Standard_A1
A1_v2标准 Standard_A1_v2
A2标准 Standard_A2
A2_v2标准 Standard_A2_v2
A2m_v2标准 Standard_A2m_v2
A3标准 Standard_A3
A4标准 Standard_A4
A4_v2标准 Standard_A4_v2
A4m_v2标准 Standard_A4m_v2
A5标准 Standard_A5
A6标准 Standard_A6
A7标准 Standard_A7
A8_v2标准 Standard_A8_v2
A8m_v2标准 Standard_A8m_v2
D1标准 Standard_D1
D1_v2标准 Standard_D1_v2
D11标准 Standard_D11
D11_v2标准 Standard_D11_v2
D11_v2促销 Standard_D11_v2_Promo
D12标准 Standard_D12
D12_v2标准 Standard_D12_v2
D12_v2促销 Standard_D12_v2_Promo
D13标准 Standard_D13
D13_v2标准 Standard_D13_v2
D13_v2_促销 Standard_D13_v2_Promo
D14标准 Standard_D14
D14_v2标准 Standard_D14_v2
D14_v2_促销 Standard_D14_v2_Promo
D15_v2标准 Standard_D15_v2
D2标准 Standard_D2
D2_v2标准 Standard_D2_v2
D2_v2_促销 Standard_D2_v2_Promo
D3标准 Standard_D3
D3_v2标准 Standard_D3_v2
D3_v2_促销 Standard_D3_v2_Promo
D4标准 Standard_D4
D4_v2标准 Standard_D4_v2
D4_v2_促销 Standard_D4_v2_Promo
D5_v2标准 Standard_D5_v2
D5_v2_促销 Standard_D5_v2_Promo
DS1标准 Standard_DS1
DS1_v2标准 Standard_DS1_v2
DS11标准 Standard_DS11
DS11_v2标准 Standard_DS11_v2
DS11_v2_促销 Standard_DS11_v2_Promo
DS12标准 Standard_DS12
DS12_v2标准 Standard_DS12_v2
DS12_v2_促销 Standard_DS12_v2_Promo
DS13标准 Standard_DS13
DS13_v2标准 Standard_DS13_v2
DS13_v2_促销 Standard_DS13_v2_Promo
DS14标准 Standard_DS14
DS14_v2标准 Standard_DS14_v2
DS14_v2_促销 Standard_DS14_v2_Promo
DS15_v2标准 Standard_DS15_v2
DS2标准 Standard_DS2
DS2_v2标准 Standard_DS2_v2
DS2_v2_促销 Standard_DS2_v2_Promo
DS3标准 Standard_DS3
DS3_v2标准 Standard_DS3_v2
DS3_v2_促销 Standard_DS3_v2_Promo
DS4标准 Standard_DS4
DS4_v2标准 Standard_DS4_v2
DS4_v2_促销 Standard_DS4_v2_Promo
DS5_v2标准 Standard_DS5_v2
DS5_v2_促销 Standard_DS5_v2_Promo
F1标准 Standard_F1
F16标准 Standard_F16
F16s标准 Standard_F16s
F1s标准 Standard_F1s
F2标准 Standard_F2
F2s标准 Standard_F2s
F4标准 Standard_F4
F4s标准 Standard_F4s
F8标准 Standard_F8
F8s标准 Standard_F8s

立即访问http://market.azure.cn

【虚拟机-部署】通过 Powershell 来调整 ARM 模式下虚拟机的尺寸的更多相关文章

  1. 通过 Powershell 来调整 ARM 模式下虚拟机的尺寸

    需求描述 在部署完 ARM 模式的虚拟机以后,可以通过 PowerShell 命令来调整虚拟机的尺寸,以下是通过 PowerShell 命令来调整 ARM 模式的虚拟机尺寸. Note 本文只限于 A ...

  2. 通过 Powershell 来替换 ARM 模式下虚拟机的网络接口

    需求描述 客户在部署完 ARM 模式的虚拟机以后,由于误操作在虚拟机内部禁用了网卡导致远程访问虚拟机受到限制,以下是通过 Powershell 命令来替换原有虚拟网络接口实现虚拟网卡重置功能. Not ...

  3. 订阅无法在 ARM 模式下创建虚拟机,只能在 ASM 模式下创建 Azure VM 部署

    问题描述 资源组所有者可以在新版 portal 创建经典模式的虚拟机,但是无法创建 ARM 模式的虚拟机. 问题现象 环境中有个相对权限比较高的账户,比如 account admin (以下简称为 A ...

  4. Azure ARM (10) ARM模式下的虚拟机和Classic Model虚拟机的区别

    <Windows Azure Platform 系列文章目录> 本文内容比较多,请大家仔细阅读,谢谢! 请读者注意,在Azure ARM平台,有两种虚拟机模式:经典虚拟机和ARM虚拟机 A ...

  5. Azure ARM (11) ARM模式下,创建虚拟机并配置负载均衡器

    <Windows Azure Platform 系列文章目录> 本文内容比较多,请大家仔细阅读,谢谢! 在前几章中,我们做了准备工作: 1.创建ARM Resouce Group,叫Lei ...

  6. Azure ARM (9) 创建ARM模式下的虚拟机网络

    <Windows Azure Platform 系列文章目录> 笔者在之前几章内容中,创建了ARM Resource Group,然后在这个ARM Resource Group下创建Azu ...

  7. Azure ARM模式下VNet配置中需要注意的几点事项

    虚拟网络的配置是所有公有云中非常重要的环节.把虚拟网络配置好,对整个系统的管理.维护,以及安全性都非常重要. 本文将介绍Azure在ARM模式下VNet配置中需要特别注意的几点. 一 Azure的VN ...

  8. Azure ARM (12) ARM模式下,在负载均衡器上设置多个公网IP地址

    <Windows Azure Platform 系列文章目录> 最近在帮助一个客户设置WAF (Web Application Firewall),WAF厂商要求在负载均衡器上,设置多个公 ...

  9. 在ARM模式下捕获VM并创建新VM

    在ASM模式下,可以通过Manage Portal上捕获VM的Image,并创建新的VM.在ARM模式下,在Portal上目前还没有这个功能,要做VM镜像的捕获和创建新的VM需要用powershell ...

随机推荐

  1. Teams Formation

    题意: 给定一长度为 n 的整数序列 $a$,将其复制m次,并接成一条链,每相邻K个相同的整数会消除,然后其他的整数继续结成一条链,直到不能消除为止,求问最终剩余多少个整数. 解法: 首先将长度为n的 ...

  2. Newtonsoft.Json null值不序列化

    如果对当前序列化的实体全部生效的话使用如下: var jSetting = new JsonSerializerSettings {NullValueHandling = NullValueHandl ...

  3. App Distribution Guide--(三)---Configuring Your Xcode Project for Distribution

    Configuring Your Xcode Project for Distribution You can edit your project settings anytime, but some ...

  4. 《Java多线程编程核心技术》读后感(二)

    方法内的变量为线程安全 package Second; public class HasSelfPrivateNum { public void addI(String username) { try ...

  5. posix 正则库程序

    使用的是posix 正则库,参考: http://see.xidian.edu.cn/cpp/html/1428.html 执行匹配的时: gcc myreg.c ip.pat 内容: ip.*[0- ...

  6. js中push(),pop(),unshift(),shift()的用法

    js中push(),pop(),unshift(),shift()的用法小结   1.push().pop()和unshift().shift() 这两组同为对数组的操作,并且会改变数组的本身的长度及 ...

  7. Unity脚本引用原理,修复Unity脚本引用丢失,源码脚本与dll中的脚本引用互换 .

    http://blog.csdn.net/gz_huangzl/article/details/52486509 前言 在我们开发游戏的过程中,经常会碰到脚本引用丢失的情况,但是怎么把它们修复到我们的 ...

  8. Windows CreateEvent,SetEvent,WaitForSingleObject的用法

    http://blog.pfan.cn/embed/19089.html WaitForSingleObject的用法 DWORD WaitForSingleObject(   HANDLE hHan ...

  9. IT兄弟连 JavaWeb教程 经典案例

    案例需求:编写一个jsp servlet程序,在login.jsp发起login.do登录请求,当输入的用户名是abc密码是123时,则判断是登录成功,其它暂时认为是登录失败.当用户登录成功时,将用户 ...

  10. MyBaties源码解析

    觉得查看源代码确实是一个学习的一种方法 因为很多时候别人把最核心的代码给我们都封装好了 我们直接可以来拿使用 很多时候自己也会问 为什么通过这个方法就可以得到我觉得就是一颗好奇心吧 我算了算 就这三个 ...