在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. 编写自已的第一个MapReduce程序

    从进入系统学习到现在,貌似我们还没有真正开始动手写程序,估计有些立志成为Hadoop攻城狮的小伙伴们已经有些急了.环境已经搭好,小讲也有些按捺不住了.今天,小讲就和大家一起来动手编写我们的第一个Map ...

  2. 继承Thread类与实现Runnable接口

    java中创建线程有两种方式: 1. 类继承Thread类,重写run方法,每创建一个实例对象即开启一个线程 2. 类实现Runnable接口,重写run方法,将实例对象传入新建Thread的方法: ...

  3. 20145230java实验报告二

    20145230实验二 Java面向对象程序设计 实验内容 初步掌握单元测试和TDD 理解并掌握面向对象三要素:封装.继承.多态 初步掌握UML建模 熟悉S.O.L.I.D原则 了解设计模式 实验步骤 ...

  4. INSPIRED启示录 读书笔记 - 第13章 产品原则

    确定什么最重要 产品原则是对团队信仰和价值观的总结,用来指导产品团队作出正确的决策和取舍.它体现了产品团队的目标和愿景,是产品战略的重要组成部分.从形式上看,它是一系列明确的.体现团队特色的产品价值准 ...

  5. Docker 搭建一个Docker应用栈

    Docker应用栈结构图 Build Django容器 编写docker-file FROM django RUN pip install redis build django-with-redis ...

  6. java Web 文件上传

    注意:请求实体过大的问题,请修改Nginx服务器的大小(百度参考413 Request Entity Too Large 的解决方法)jsp:<input type="file&quo ...

  7. json前后台传输,以及乱码中文问题探讨

    背景介绍: 我现在的工作是做传统项目开发,没有用到框架.最近在做项目时,经常需要使用ajax从后台拿数据到前台,是json格式的.先说下我在项目中遇到的问题吧,前台拿到了数据,需要将其转化为对象,我使 ...

  8. HBase-存储-概览

    概览 HBase主要处理两种文件:一种是预写日志(Write-Ahead Log,WAL),另一种是实际的数据文件.这两种文件主要由HRegionServer管理.在某些情况下,HMaster也可以进 ...

  9. 利用Phoenix为HBase创建二级索引

    为什么需要Secondary Index 对于Hbase而言,如果想精确地定位到某行记录,唯一的办法是通过rowkey来查询.如果不通过rowkey来查找数据,就必须逐行地比较每一列的值,即全表扫瞄. ...

  10. poj 2116 Death to Binary? 模拟

    Death to Binary? Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 1707   Accepted: 529 D ...