将还原的OS磁盘附加到现有VM [英] Attaching restored OS disk to existing VM

查看:73
本文介绍了将还原的OS磁盘附加到现有VM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个虚拟机,并安排了每日备份.今天,我删除了该VM中的文件并更改了一些配置.我从恢复服务库中恢复了昨天的数据磁盘,并更改了恢复的数据磁盘的名称.

I have one VM with a daily backup scheduled. Today I deleted a file in that VM and changed some configuration. I restored yesterday's data disk from my recovery service vault and changed the names of the recovered data disk.

现在,我要将昨天还原的备份附加到我的现有VM.有可能吗?

Now I want to attach yesterday's restored backup to my existing VM. Is it possible?

如果没有,则假设我删除了我的VM,但保留了它的网络接口卡.我可以使用ARM模板从还原的VHD创建新的VM,但是如何为我的新VM分配现有的NIC?

If not then suppose I delete my VM but I keep its network interface card. I can create a new VM from restored VHDs using ARM templates but how can I assign an existing NIC to my new VM?

此外,我已将此虚拟机添加到我的域控制器中.如果我重新创建虚拟机,是否需要将新的虚拟机添加到域控制器,或者它将正常工作?

Also, I have added this VM to my domain controller. If I recreate the VM, do I need to add the new VM to the domain controller or will it work normally?

推荐答案

现在,我要将昨天还原的备份附加到我的现有VM.是 有可能吗?

Now I want to attach yesterday's restored backup to my existing VM. is it possible?

是的,我们可以将此还原磁盘附加到您现有的VM,然后在您现有的VM中找到该磁盘.

Yes, we can attach this restore disk to your existing VM, then we can find the disk in your existing VM.

我删除了VM,但保留了VM的网络接口卡,现在我可以 使用ARM模板从还原的VHD创建虚拟机,但如何分配 退出新虚拟机中的NIC?

I delete VM but I keep network interface card for the VM, now I can create VM from restored VHD's using ARM templates but how to assign exiting NIC in the new VM?

是的,我们可以使用PowerShell创建具有现有NIC和VHD的VM,下面是一个示例:

Yes, we can use PowerShell to create a VM with existing NIC and VHD, here is an example:

$rgname = "jason-newgroup" 
$loc = "japaneast" 
$vmsize = "Standard_DS1_v2" 
$vmname = "jason-newtest2" 
$vm = New-AzureRmVMConfig -VMName $vmname -VMSize $vmsize 
$nic = Get-AzureRmNetworkInterface -Name "NICname" -ResourceGroupName $rgname 
$nicId = $nic.Id 
$vm = Add-AzureRmVMNetworkInterface -VM $vm -Id $nicId 
$osDiskName = "jason-newtest" 
$osDiskVhdUri = "https://jasonnewgroupdisks912.blob.core.windows.net/vhds/jason-newtest201681285042.vhd" 
$vm = Set-AzureRmVMOSDisk -VM $vm -VhdUri $osDiskVhdUri -name $osDiskName -CreateOption attach -Windows 
New-AzureRmVM -ResourceGroupName $rgname -Location $loc -VM $vm 

如果我重新创建虚拟机,是否需要将新的虚拟机添加到域控制器或 它可以正常工作吗?

if I recreate the VM do I need to add new VM to domain controller or will it work normally?

是的,新创建的VM(还原)将添加到域控制器,我们无需再次将VM添加到域控制器.

Yes, the new create VM (restore) will add to the domain controller, we don't need to add the VM to domain controller again.

这篇关于将还原的OS磁盘附加到现有VM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆