question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[ISSUE] "waagent -deprovision+user -force" not working as expected

See original GitHub issue

When using the waagent -deprovision+user command, the user re-appears when imaged

Building a CentOS v7.x VM to be used as a source image for future builds. One of the last steps before shutting down the VM is to run the above command. It works as expected for that instance, and the user is removed, but when I build from the new image, my VM contains the user (as defined in /var/lib/waagent/ovf-env.xml). How do I prevent the user from being re-created on every new instance that is based on my image? From what I’ve read, the cloud-init daemon is responsible for re-populating the file, which in turn is used by the agent to reprovision the new instance. But I haven’t found how/where to fix it so the user isn’t recreated.

Here’s the output of the deprovision command. How do I ensure ‘azadmin’ is not created on every instance built from this image? I confirmed that the user has been removed, as had the /var/lib/waagent/ovf-env.xml file.

[admin@centos-v7-node ~]$ sudo waagent -deprovision+user
WARNING! The waagent service will be stopped.
WARNING! All SSH host key pairs will be deleted.
WARNING! Cached DHCP leases will be deleted.
WARNING! root password will be disabled. You will not be able to login as root.
WARNING! /etc/resolv.conf will be deleted.
WARNING! azadmin account and entire home directory will be deleted.
Do you want to proceed (y/n)y
2020/07/15 15:15:50.111345 INFO Examine /proc/net/route for primary interface
2020/07/15 15:15:50.116477 INFO Primary interface is [eth0]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pgombarcommented, Jul 15, 2020

@andybacka thanks for reporting this. As for the agent versions, you are on the latest one (2.2.49.2). The 2.2.45 version is the daemon that is preinstalled on this image. For more info, check out this doc: https://github.com/Azure/WALinuxAgent/wiki/FAQ#what-does-goal-state-agent-mean-in-waagent---version-output

@trstringer could you comment on the question related to deprovisioning? Thanks!

0reactions
trstringercommented, Aug 26, 2020

The log file is the best place to troubleshoot with logging, but if you do have a repro you can always do some local patching to dump additional data to help diagnose or prove theories. Or likewise, if you have a repro feel free to reopen this issue and we can troubleshoot further together.

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

SUSE waagent deprovision error - MSDN - Microsoft
Hi: I'm testing deprovisioning/reprovisioning for various systems. My first test is with a small SUSE VM. When I try to run waagent's ......
Read more >
"az vm run-command" with "sudo waagent -deprovision+user
According to the Microsoft document below, before creating the VM image, I need to run "# sudo waagent -deprovision+user -force" command on ...
Read more >
Publishing to a Shared Image Gallery - Azure Citadel
Use Packer and Ansible roles to publish images to a Shared Image Gallery. ... If setfacl does not exist or does not work...
Read more >
Take down images from Azure marketplace - omnibus-gitlab
Use tasks to break down this issue into smaller parts. ... done by /usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync.
Read more >
Is "waagent -deprovision" necessary for migrating an Azure ...
You do not have to create an Image to do this. You need to copy the VHD to the new storage account and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found