0

I tried many times. It looks like a bug in Azure DevTest Labs.

Here is the steps to reproduce the problem:

  1. Create a VM from Ubuntu Linux 18.04 LTS
  2. Create custom image from this VM with Run deprovision on virtual machine..
  3. Create a new VM from this new image.
  4. SSH to this VM.
  5. Run host www.google.com will fail.

Are these steps wrong?

Charles Xu
  • 29,862
  • 2
  • 22
  • 39
Will Huang
  • 2,955
  • 2
  • 37
  • 90

1 Answers1

1

There is no step wrong which you have done. But the reason that you fail running host www.google.com is the second step. The deprovision will do some things when you execute the command waagent -deprovision+user:

enter image description here

When you create a VM from the deprovision custom image, there is no resolv.conf file in it. So you fail in running host www.google.com. The solution is that create a resolv.conf file in the directory /etc/.

The content of file resolv.conf will be different for the VM in the different locations. For example, the file resolv.conf will be like this if your VM in the location Japan East:

nameserver 127.0.0.53
search bbuuanmggeiengfg01a443drie.lx.internal.cloudapp.net
Charles Xu
  • 29,862
  • 2
  • 22
  • 39
  • Is it normal? I mean when I create a VM from the custom image. Why should everyone restore `resolv.conf` by himself? Is it possible to reconfigure DNS automatically when creating VMs from deprovisioned custom image? – Will Huang Sep 13 '18 at 14:02
  • @WillHuang This is an issue about "walinuxagent", you can read this [link](https://github.com/Azure/WALinuxAgent/issues/1151) and find the way to solve it. – Charles Xu Sep 14 '18 at 07:05
  • Is this issue going to be fixed? I saw the issue has been closed but the workaround still remain. Or it will leave it as a workaround forever? – Will Huang Sep 16 '18 at 19:35
  • Yeah, I also see that. But with the test of version 2.2.31, the error still exists. So you should fix it in another way. Maybe it would be fixed later. – Charles Xu Sep 17 '18 at 01:33