简体   繁体   中英

Azure: DNS change after VM setup

I recently setup Active Directory on a VM inside an Azure Virtual Network. Unfortunately, the Virtual Network DNS entry was not put in before creating and working with the Active Directory VM.

Because of Azure's framework, I believe I have to recreate the VM (after making the DNS change). Does anyone know how to take a snapshot of the virtual hard-drive and re-associate that with a newly created VM after the DNS change is made. I have read information about sysprep to capture an image but I'm afraid that will corrupt various AD settings.

Also, does anyone have any other information about this type of DNS change?

Thanks, akgh

Here are the steps:

  1. First export the VM configuration to an XML file get-azurevm -servicename [service name] | export-azurevm -path [local path] get-azurevm -servicename [service name] | export-azurevm -path [local path] This generates a small XML file that contains information about the VM.
  2. Next, remove the VM configuration from Azure. remove-azurevm [VM name] This does not actually delete the VHD file, it only removes the configuration about the VHD that you have previously backed-up/exported from step 1. So there is no danger or destruction done here. These are actually the same steps you would do if you wanted to stop paying for the service.

  3. Now, restore the VM configuration with the new DNS settings you want. $dnslocal=New-AzureDNS -Name "my Azure DNS Server" -IPaddress "192.168.10.4" $dnsonprem=New-AzureDNS -Name "my OnPrem DNS Server" -IPaddress "172.16.83.21" Import-AzureVM -Path 'E:\\myVM.xml' | New-AzureVM -ServiceName 'myVM' -Location 'West US' -DnsSettings $dnslocal,$dnsonprem -VNetName "MyVNET" –AffinityGroup “CATAFF1” $dnslocal=New-AzureDNS -Name "my Azure DNS Server" -IPaddress "192.168.10.4" $dnsonprem=New-AzureDNS -Name "my OnPrem DNS Server" -IPaddress "172.16.83.21" Import-AzureVM -Path 'E:\\myVM.xml' | New-AzureVM -ServiceName 'myVM' -Location 'West US' -DnsSettings $dnslocal,$dnsonprem -VNetName "MyVNET" –AffinityGroup “CATAFF1” Note: You may get an error when trying to import the VM configuration. If you get an error that the DNS name already exists, then you may need to remove the cloud service remove-azureservice –servicename “myVM"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM