在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. SQL Server获取数据库的当前连接状态

    SELECT * FROM [Master].[dbo].[SYSPROCESSES] WHERE [DBID]=(SELECT [DBID] FROM [Master].[dbo].[SYSDATA ...

  2. JAVA Excel导入导出

    --------------------------------------------方式一(新)-------------------------------------------------- ...

  3. 深入Struts2的过滤器FilterDispatcher--中文乱码及字符编码过滤器

    引用 前几天在论坛上看到一篇帖子,是关于Struts2.0中文乱码的,楼主采用的是spring的字符编码过滤器(CharacterEncodingFilter)统一编码为GBK,前台提交表单数据到Ac ...

  4. java 监控命令

    jps 查找java所有进程及对应pid -v 列出启动参数 有些默认的参数,使用-v是看不到的,需要执行如下: jcmd pid VM.flags jstack pid 查看该进程的堆栈信息 找到进 ...

  5. ajax02-XMLHttpRequest 对象的使用

    XMLHttpRequest 是 AJAX 的基础,用于在后台与服务器交换数据.这意味着可以在不重新加载整个网页的情况下,对网页的某部分进行更新. XMLHttpRequest 对象 所有现代浏览器均 ...

  6. Java -- JDBC 操作mysql数据库

    1. Demo1 导包时 不要导具体的mysql包, 为了兼容性,导JDBC 中 sql的包既可以了. public class Demo1 { /** * @param args * @throws ...

  7. Intel Code Challenge Elimination Round (Div.1 + Div.2, combined) D. Generating Sets 贪心+优先队列

    D. Generating Sets time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  8. hdu 5904 LCIS dp

    LCIS Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Problem Des ...

  9. hdoj1004--Let the Balloon Rise

    Problem Description Contest time again! How excited it is to see balloons floating around. But to te ...

  10. Java编程思想 Random(47)

    Random类包含两个构造方法,下面依次进行介绍:1. public Random()该构造方法使用一个和当前系统时间对应的相对时间有关的数字作为种子数,然后使用这个种子数构造Random对象.2. ...