在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. char,uchar,0xff

    如果:char test = 0xFF: 此时:test != 0xFF://因为test为char类型,0xFF为int,所以编译器会将test转为int(-1),所以不等于 如果:uchar te ...

  2. Kubernetes Headless Service

    1. Headless Service headless service 需要将 spec.clusterIP 设置成 None. 因为没有ClusterIP,kube-proxy 并不处理此类服务, ...

  3. 《机器学习基石》第一周 —— When Can Machine Learn?

    (注:由于之前进行了吴恩达机器学习课程的学习,其中有部分内容与机器学习基石的内容重叠,所以以下该系列的笔记只记录新的知识) <机器学习基石>课程围绕着下面这四个问题而展开: 主要内容: 一 ...

  4. 常用java开发工具快捷键

    在这里列举一些开发中常用的快捷键 常用的idea的快捷键: 1.删除当前行:Ctrl+X 2.格式化代码:Ctrl+Alt+L 3.查看本页里面的内容:Ctrl+F 4.查看类的继承方式:Ctrl+H ...

  5. springmvc异常处理(非注解与注解)

    1.异常 程序中的异常一般分为两类:预期异常,运行时异常.前者是我们可预知的,我们一般通过捕获和抛出方式处理这些异常.后者主要通过代码规范.测试等手段来减少异常的发生.一般,我们在系统的DAO.Ser ...

  6. oracle 计算时间差

    1.计算时间差(相隔星期,天数,小时,分钟,秒) SELECT TO_CHAR(date1,'MMDDYYYY:HH24:MI:SS') date1, TO_CHAR(date2,'MMDDYYYY: ...

  7. springmvc中url-url-pattern /和/*的区别

    在使用springmvc时,都会在web.xml中配置一个dispatchservlet,如下: <listener> <listener-class> org.springf ...

  8. Spring Boot2.0之 整合XXL-Job

    参考git上面的 springboot demo 创建maven工程: pom: <project xmlns="http://maven.apache.org/POM/4.0.0&q ...

  9. 自学Hadoop

    一.Hadoop基础设施 起源于Google的三篇论文: 1. <The Google File System > 2003年 http://static.googleuserconten ...

  10. Proxy动态代理

    Proxy动态代理 package com.test.dynamicproxy; public interface Subject { public void request(); } package ...