If a user moves a vm between zones without re-joining the VM (such as when using regional OS disks), the cleanup process will remove the computer account.
If the VM does not rejoin, the VM attributes in AD won't get updated and will have the value of the old zone. In the cleanup, in:
elif gcp.project.Project(computer.get_project_id()).get_instance(computer.get_instance_name(), computer.get_zone()):
The VM will not be found in the old zone, and the code will attempt to remove the computer account.
Is there a way to search for a VM in a project, regardless of its zone?
If a user moves a vm between zones without re-joining the VM (such as when using regional OS disks), the cleanup process will remove the computer account.
If the VM does not rejoin, the VM attributes in AD won't get updated and will have the value of the old zone. In the cleanup, in:
elif gcp.project.Project(computer.get_project_id()).get_instance(computer.get_instance_name(), computer.get_zone()):
The VM will not be found in the old zone, and the code will attempt to remove the computer account.
Is there a way to search for a VM in a project, regardless of its zone?