在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. 前端常用js脚本

    常用js整理 //获取Url中的参数值 function getQueryString(name) { var reg = new RegExp("(^|&)" + nam ...

  2. vRO 7 添加RestHost证书报错

    报错类似的错误: Cannot execute request: ; java.security.cert.CertificateException: Certificates does not co ...

  3. Oracle配置文件

    在oracle安装目录$HOME/network/admin下,,经常看到sqlnet.ora tnsnames.ora listener.ora这三个文件,除了tnsnames.ora,其他两个文件 ...

  4. 回溯法之k着色问题

    package main import ( "fmt" ) type Graphic struct { edges [][]int colors int color []int f ...

  5. html里id和name的异同

    id与name的作用,作为标签的标识符,基本上是一样的. name是老方法,id是在name基础上发明的,比name“现代化”一点,用的范围广一点 <...>中的name原来(刚发明时)就 ...

  6. java多线程模拟停车位问题

    /** * */ package Synchronized; /** * @author libin * */ public class CarTest { public static void ma ...

  7. scheduler configuration options

    Table 4.53. Description of scheduler configuration options Configuration option = Default value Desc ...

  8. zeptojs的一些别人的博客

    http://www.css88.com/doc/zeptojs/ http://blog.163.com/litianyichuanqi@126/blog/static/11597944120142 ...

  9. cpu和gpu的区别和联系是什么

    cpu和gpu的区别和联系是什么 一.总结 一句话总结:CPU:复杂任务,核少,做串行,计算能力只是CPU很小的一部分,处理复杂逻辑: GPU:简单任务,核多,做并行(大吞吐量),做显卡的图象单元计算 ...

  10. 搜索5--noi1700:八皇后问题

    搜索5--noi1700:八皇后问题 一.心得 二.题目 1700:八皇后问题 查看 提交 统计 提问 总时间限制:  10000ms 内存限制:  65536kB 描述 在国际象棋棋盘上放置八个皇后 ...