在ASM下,要把HDD的VM转换成SSD的VM步骤非常复杂。需要手工把Disk从普通存储账户复制到高级存储账户。再通过这个Disk创建VM。

目前在有了ASM到ARM的迁移工具,以及Managed Disk后,这个工作就简单了。

下面将介绍如何实现从ASM的HDD VM迁移到ARM模式下的Managed Disk的SSD VM。

一 ASM下的VM迁移到ARM下

1 Cli版本

这个工作,可以用powershell或Azure xplate cli,我采用的cli:

C:\Users\hengwei>azure
info: _ _____ _ ___ ___
info: /_\ |_ / | | | _ \ __|
info: _ ___/ _ \__/ /| |_| | / _|___ _ _
info: (___ /_/ \_\/___|\___/|_|_\___| _____)
info: (_______ _ _) _ ______ _)_ _
info: (______________ _ ) (___ _ _)
info:
info: Microsoft Azure: Microsoft's Cloud Platform
info:
info: Tool version 0.10.

版本是0.10.13.

2 查看VNet和VM信息

C:\Users\hengwei>azure network vnet list
info: Executing command network vnet list
+ Looking up the virtual network sites
data: Name Location Affinity group State Address space Subnets count VPN Gateway address
data: ------ ---------- -------------- ------- -------------- ------------- -------------------
data: hwfgfw China East Created 10.0.0.0/
data: hws2p China East Created 192.168.1.0/
info: network vnet list command OK
C:\Users\hengwei>azure vm list
info: Executing command vm list
+ Getting virtual machines
data: Name Status Location DNS Name IP Address
data: ---------- ------------------ ---------- --------------------------- -----------
data: mp-ngfwf- StoppedDeallocated China East mp-ngfwf-.chinacloudapp.cn
data: hws2p ReadyRole China East hws2p01.chinacloudapp.cn 192.168.1.4
info: vm list command OK

3 迁移

迁移分三步:

C:\Users\hengwei>azure network vnet  validate-migration hws2p
info: Executing command network vnet validate-migration
data: Information : Virtual Network hws2p is eligible for migration.
data: Information : Deployment hws2p in Cloud Service hws2p01 is eligible for migration.
data: Information : VM hws2p in Deployment hws2p within Cloud Service hws2p01 is eligible for migration.
info: network vnet validate-migration command OK C:\Users\hengwei>azure network vnet prepare-migration hws2p
info: Executing command network vnet prepare-migration
info: network vnet prepare-migration command OK C:\Users\hengwei>azure network vnet commit-migration hws2p
info: Executing command network vnet commit-migration
info: network vnet commit-migration command OK

此时Vnet和VM都已经迁移到ARM模式下了。

二 把ARM模式下的VM转换成Managed Disk

1 CLI版本

这个工作的Azure采用的是Azure CLI2.0版本

root@hw-surfacebook:~# az --version
azure-cli (2.0.)

2 查看VM

root@hw-surfacebook:~# az vm list -o table
Name ResourceGroup Location
--------- ---------------- ----------
hwmdt HWNAVS chinanorth
hwcisco CISCOROUTER chinaeast
hwazcopy HWAZCOPY chinaeast
hwmt HWMT chinaeast
hwmt02 HWMT chinaeast
hws2p HWS2P01-MIGRATED chinaeast
hwmysql01 HWWAF chinaeast
hwwaf02 HWWAF chinaeast
hwwaf03 HWWAF chinaeast

3 转换Disk

root@hw-surfacebook:~# az vm convert -n hws2p -g hws2p01-migrated
| Running ..
{| Finished ..
"endTime": "2017-06-23T10:45:42.174661+00:00",
"error": null,
"name": "fa343688-ba91-447b-b531-5ff983866f9a",
"startTime": "2017-06-23T10:44:57.245702+00:00",
"status": "Succeeded"
}

此时,Disk已经是Managed Disk了。

4 查看disk信息

root@hw-surfacebook:~# az disk list -o table
AccountType DiskSizeGb Location Name OwnerId ProvisioningState ResourceGroup TimeCreated OsType
------------- ------------ ---------- -------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------- ------------------- ---------------- -------------------------------- --------
Standard_LRS chinaeast hws2p_hws2p-hws2p-- /subscriptions/xxxx/resourceGroups/hws2p01-Migrated/providers/Microsoft.Compute/virtualMachines/hws2p Succeeded HWS2P01-MIGRATED --23T10::15.240624+:

三 把VM的型号转换成DS系列,把Disk转换成SSD

1 VM型号转换

root@hw-surfacebook:~# az vm resize -n hws2p -g hws2p01-migrated --size Standard_DS1
- Running .. \ Running ..
{/ Finished ..
"availabilitySet": null,
"diagnosticsProfile": null,
"hardwareProfile": {
"vmSize": "Standard_DS1"
},
"id": "/subscriptions/xxxx/resourceGroups/hws2p01-migrated/providers/Microsoft.Compute/virtualMachines/hws2p",
"instanceView": null,
"licenseType": null,
"location": "chinaeast",
"name": "hws2p",
"networkProfile": {
"networkInterfaces": [
{
"id": "/subscriptions/xxxx/resourceGroups/hws2p01-Migrated/providers/Microsoft.Network/networkInterfaces/hws2p-PrimaryNic",
"primary": true,
"resourceGroup": "hws2p01-Migrated"
}
]
},
"osProfile": null,
"plan": null,
"provisioningState": "Succeeded",
"resourceGroup": "hws2p01-migrated",
"resources": null,
"storageProfile": {
"dataDisks": [],
"imageReference": null,
"osDisk": {
"caching": "ReadWrite",
"createOption": "attach",
"diskSizeGb": null,
"encryptionSettings": null,
"image": null,
"managedDisk": {
"id": "/subscriptions/xxxx/resourceGroups/hws2p01-Migrated/providers/Microsoft.Compute/disks/hws2p_hws2p-hws2p-0-201706231030480950",
"resourceGroup": "hws2p01-Migrated",
"storageAccountType": null
},
"name": "hws2p_hws2p-hws2p-0-201706231030480950",
"osType": "Linux",
"vhd": null
}
},
"tags": null,
"type": "Microsoft.Compute/virtualMachines",
"vmId": "3d7b7a7f-6271-4fa5-9f94-88711eb9db43"
}

2 Disk转换成SSD

az disk update -g hws2p01-Migrated -n hws2p_hws2p-hws2p-- --sku Premium_LRS
{
"accountType": "Premium_LRS",
"creationData": {
"createOption": "Import",
"imageReference": null,
"sourceResourceId": null,
"sourceUri": "https://2mportalvhdsg0nfxclb1p0q.blob.core.chinacloudapi.cn/vhds/hws2p01-hws2p-2017-06-23.vhd",
"storageAccountId": null
},
"diskSizeGb": ,
"encryptionSettings": null,
"id": "/subscriptions/xxxx/resourceGroups/hws2p01-Migrated/providers/Microsoft.Compute/disks/hws2p_hws2p-hws2p-0-201706231030480950",
"location": "chinaeast",
"name": "hws2p_hws2p-hws2p-0-201706231030480950",
"osType": null,
"ownerId": "/subscriptions/xxxx/resourceGroups/hws2p01-Migrated/providers/Microsoft.Compute/virtualMachines/hws2p",
"provisioningState": "Succeeded",
"resourceGroup": "hws2p01-Migrated",
"tags": null,
"timeCreated": "2017-06-23T10:45:15.240624+00:00",
"type": "Microsoft.Compute/disks"
}

3 查看Disk信息

root@hw-surfacebook:~# az disk list -o table
AccountType DiskSizeGb Location Name OwnerId ProvisioningState ResourceGroup TimeCreated OsType
------------- ------------ ---------- -------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------- ------------------- ---------------- -------------------------------- --------
Premium_LRS chinaeast hws2p_hws2p-hws2p-- /subscriptions/xxxx/resourceGroups/hws2p01-Migrated/providers/Microsoft.Compute/virtualMachines/hws2p Succeeded HWS2P01-MIGRATED --23T10::15.240624+:

已经是SSD的硬盘了。

四总结

通过ASM->ARM的转换工具,可以方便的把ASM的VM迁移到ARM。

通过命令行方便的把disk迁移到Managed Disk。

在ARM中,可以在关机的状态下resize VM到ssd类型的机器。

通过命令行,方便的把HDD的Disk转换成SSD的Disk。

把ASM下的HDD VM转换成ARM下Managed Disk的SSD VM的更多相关文章

  1. windows下的txt格式转换成linux下的TXT

    存在的问题是 多出一个方框或者黑格子 主要是因为bash 不能忽略windows的问题 用sed 命令来处理,分别是windows转linux,linux转windows sed -e 's/.$// ...

  2. 在Linux下将HTML文件转换成PDF文件

    今天要写一个上交的作业,本来是想用Office Word来写的,但是,我的Office貌似不能用了,但是,Linux下的LibreOffice写出的文档,在打印的时候是经常出现乱码的.所以,后来想到可 ...

  3. win7下将主分区转换成逻辑分区

    在了解怎么转换之前,先搞清楚主分区,扩展分区,逻辑分区的基本概念. 主分区,也称为主磁盘分区,和扩展分区.逻辑分区一样,是一种分区类型.主分区中不能再划分其他类型的分区,因此每个主分区都相当于一个逻辑 ...

  4. Ubuntu下录制屏幕并转换成gif【转】

    本文转载自:https://blog.csdn.net/u012964944/article/details/50464263 *录制屏幕 1)打开Ubuntu软件中心,安装RecordMyDeskt ...

  5. flask框架下读取mysql数据 转换成json格式API

    研究了一天 因为需要从数据库拿数据然后转换成json的格式 expose出去为 API 发现一条数据是容易,两条以上我居然搞了这么久 好歹出来了 先贴一下 后面更新 mysql的操作 比较容易了htt ...

  6. linux下如何将dts转换成dtb?

    答: 使用dtc工具,如: <kernel source code dir>/scripts/dtc/dtc -I dts -O dtb -o <dtb filename> & ...

  7. 64位编译器下,将指针转换成UINT32,不需要修改编译选项的编码方式

    一些严格的64位编译器,将指针转换成UINT32,会报各种丢失精度的错误. 但很显然,有些时候,我们就是需要转换,且并不会真正丢失精度. 此时不需要修改编译选项的编码方式,有些用处了 示例如下: un ...

  8. linux环境下deb格式文件转换成rpm格式

    以 alien_8.87.tar.gz 为例: 下载.安装 alien_8.87.tar.gz [root@shyn ~]# wget http://ftp.de.debian.org/debian/ ...

  9. .Net平台下实例类型无法转换成接口类型?

    首先这种情况出现在应用程序启动前的方法里面. 本想通过发射来实现一些功能.谁知道被这个坑了. 碰到这种问题.已经相当无语了.同时也不知道该如何解决.望有能之士帮忙解答 using System; us ...

随机推荐

  1. usb mtp激活流程【转】

    本文转载自:https://blog.csdn.net/kc58236582/article/details/46895901 废话少说, 先上两张时序图 , 图片有点大, 建议用新窗口打开或者另存到 ...

  2. Ubuntu无法使用root用户登陆的解决办法

    对于一个新安装的Ubuntu操作系统,经常会遇到无法使用root用户ssh连接操作系统,比如说root用户的密码被拒绝等原因. 面对这种问题,介绍一下Ubuntu无法使用root登陆解决 1. 修改 ...

  3. Linux 一键安装 webmin/virtualmin

    Webmin是一个可运行于Linux/freebsd的web界面的主机管理系统,而Virtualmin是一个基于Webmin的虚拟主机管理模块. webmin官方站: http://www.webmi ...

  4. setup in xunit

    https://xunit.github.io/docs/shared-context Shared Context between Tests It is common for unit test ...

  5. Luogu-4774 [NOI2018]屠龙勇士

    这题好像只要会用set/平衡树以及裸的\(Excrt\)就能A啊...然而当时我虽然看出是\(Excrt\)却并不会...今天又学了一遍\(Excrt\),趁机把这个坑给填了吧 现预处理一下,找出每条 ...

  6. 【bzoj2118&洛谷P2371】墨墨的等式(最短路神仙题)

    题目传送门:bzoj2118 洛谷P2371 这道题看了题解后才会的..果然是国家集训队的神仙题,思维独特. 首先若方程$ \sum_{i=1}^{n}a_ix_i=k $有非负整数解,那么显然对于每 ...

  7. 轻松掌握XMLHttpRequest对象------【这是.net 版本】

    轻松掌握XMLHttpRequest对象 XmlHttp是什么? 最通用的定义为:XmlHttp是一套可以在Javascript.VbScript.Jscript等脚本语言中通过http协议传送或从接 ...

  8. KVM Best practice

    使用block设备来避免额外的software layers. Best practices: Asynchronous I/O model for KVM guests 尽管KVM supports ...

  9. Guest CPU model configuration in libvirt with QEMU/KVM

    每个hypervisor对于guest能看到的cpu model定义都不同,Xen 提供host pass through,所以guest能看到的cpu和host完全相同. QEMU/KVM中gues ...

  10. Spring Boot入门——web相关配置

    1.Servlet 引用HttpServlet接口,采用原生的Servlet进行请求响应 2.Listener 引用ServletContextListener,常用于Web缓存 3.Filter 引 ...