通过 Powershell 来调整 ARM 模式下虚拟机的尺寸
需求描述
在部署完 ARM 模式的虚拟机以后,可以通过 PowerShell 命令来调整虚拟机的尺寸,以下是通过 PowerShell 命令来调整 ARM 模式的虚拟机尺寸。
Note
本文只限于 ARM 模式下的虚拟机,经典模式的虚拟机不适用。
操作步骤
首先,我们需要使用下面的命令定义需要调整尺寸的虚拟机的基本信息:
#定义资源组名称
$ResourceGroupName = <资源组名称>
#定义需要调整尺寸的虚拟机名称
$VMName = <虚拟机名称>
#定义虚拟机的新尺寸,这里以Standard_A1为例,详细尺寸列表见附录部分
$NewVMSize = "Standard_A1"
定义完成后,使用下面的命令将虚拟机调整到新的尺寸:
#获取虚拟机对象
$vm = Get-AzureRmVM -ResourceGroupName <资源组名称> -Name <虚拟机名称>
#设定新尺寸
$vm.HardwareProfile.vmSize = $NewVMSize
#将虚拟机调整为新尺寸
Update-AzureRmVM -ResourceGroupName $ResourceGroupName -VM $vm
待命令执行完成后,可以看到虚拟机的尺寸已调整完毕:

附录
| 尺寸名称 | 尺寸变量名 |
|---|---|
| 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 模式下虚拟机的尺寸的更多相关文章
- 【虚拟机-部署】通过 Powershell 来调整 ARM 模式下虚拟机的尺寸
需求描述 在部署完 ARM 模式的虚拟机以后,可以通过 PowerShell 命令来调整虚拟机的尺寸,以下是通过 PowerShell 命令来调整 ARM 模式的虚拟机尺寸. Note 本文只限于 A ...
- 通过 Powershell 来替换 ARM 模式下虚拟机的网络接口
需求描述 客户在部署完 ARM 模式的虚拟机以后,由于误操作在虚拟机内部禁用了网卡导致远程访问虚拟机受到限制,以下是通过 Powershell 命令来替换原有虚拟网络接口实现虚拟网卡重置功能. Not ...
- Azure ARM (10) ARM模式下的虚拟机和Classic Model虚拟机的区别
<Windows Azure Platform 系列文章目录> 本文内容比较多,请大家仔细阅读,谢谢! 请读者注意,在Azure ARM平台,有两种虚拟机模式:经典虚拟机和ARM虚拟机 A ...
- Azure ARM (11) ARM模式下,创建虚拟机并配置负载均衡器
<Windows Azure Platform 系列文章目录> 本文内容比较多,请大家仔细阅读,谢谢! 在前几章中,我们做了准备工作: 1.创建ARM Resouce Group,叫Lei ...
- 订阅无法在 ARM 模式下创建虚拟机,只能在 ASM 模式下创建 Azure VM 部署
问题描述 资源组所有者可以在新版 portal 创建经典模式的虚拟机,但是无法创建 ARM 模式的虚拟机. 问题现象 环境中有个相对权限比较高的账户,比如 account admin (以下简称为 A ...
- Azure ARM (9) 创建ARM模式下的虚拟机网络
<Windows Azure Platform 系列文章目录> 笔者在之前几章内容中,创建了ARM Resource Group,然后在这个ARM Resource Group下创建Azu ...
- Azure ARM (12) ARM模式下,在负载均衡器上设置多个公网IP地址
<Windows Azure Platform 系列文章目录> 最近在帮助一个客户设置WAF (Web Application Firewall),WAF厂商要求在负载均衡器上,设置多个公 ...
- 在ARM模式下捕获VM并创建新VM
在ASM模式下,可以通过Manage Portal上捕获VM的Image,并创建新的VM.在ARM模式下,在Portal上目前还没有这个功能,要做VM镜像的捕获和创建新的VM需要用powershell ...
- Azure ARM模式下VNet配置中需要注意的几点事项
虚拟网络的配置是所有公有云中非常重要的环节.把虚拟网络配置好,对整个系统的管理.维护,以及安全性都非常重要. 本文将介绍Azure在ARM模式下VNet配置中需要特别注意的几点. 一 Azure的VN ...
随机推荐
- xml转换csv
/// <summary> /// xml文件转换为CSV /// </summary> /// <param name="fileName"> ...
- Ubuntu系统安装WeChat
安装: 1.sudo apt install snapd snapd-xdg-open 2.sudo snap install electronic-wechat 运行: electronic-wec ...
- HDU1286
欧拉函数测试题 期末考试完了做下水题 更好的方法是phi[i]==i时就直接筛选,不改了 #include<bits/stdc++.h> using namespace std; cons ...
- 04-树6 Complete Binary Search Tree (30 分)
A Binary Search Tree (BST) is recursively defined as a binary tree which has the following propertie ...
- groovy——运行方式、基本语法、引入方式、metaClass
jvm运行groovy类有两种方式: 1.使用groovyc编译所有的*.groovy为java的*.class文件,把这些*.class文件放在java类路径中,通过java类加载器来加载这些类. ...
- TOJ 2815 Connect them (kruskal+并查集)
描述 You have n computers numbered from 1 to n and you want to connect them to make a small local area ...
- IAR使用技巧 之 快捷键批量更换指定字符(以及Keil的全局替换功能)
使用IAR(或者Keil)写/移植程序时批量更换字符 作者:李剀 出处:https://www.cnblogs.com/kevin-nancy/p/10776712.html 或者 https://b ...
- CSS布局——左定宽度右自适应宽度并且等高布局
方法一: 别的不多说,直接上代码,或者参考在线DEMO,下面所有的DEMO都有HTML和CSS代码,感兴趣的同学自己慢慢看吧. HTML Markup <div id="contain ...
- IBM Rational Appscan: Part 2 ---reference
http://resources.infosecinstitute.com/appscan-part-2/ By Rohit T|August 16th, 2012 ----------------- ...
- 深入redis内部之redis启动过程之一
redis作为一个服务器,它的启动是从main函数开始的.redis.c 1. 进程重命名 #ifdef INIT_SETPROCTITLE_REPLACEMENT spt_init(argc, ar ...