canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.54k stars 635 forks source link

[hyper-v] Multipass reports stale IPs after direct shutdown #3438

Closed ricab closed 3 months ago

ricab commented 4 months ago

Describe the bug Multipass shows a stale IP for Hyper-V instances, along with the actual IP, after shutting down an instance directly, i.e. without going through Multipass's stop RPC. The old IP is kept around even after Multipass realizes that the instance is stopped (e.g. with multipass list). It is then included in list/info results after the instance starts anew.

To Reproduce This can be reproduced with something like sudo shutdown -h now or by shutting down the instance directly with Hyper-V. For instance:

PS C:> multipass ls
Name                    State             IPv4             Image
godlike-kestrel         Running           172.21.4.179     Ubuntu 22.04 LTS
PS C:> multipass exec -n godlike-kestrel -- sudo shutdown -h now
PS C:> multipass ls
Name                    State             IPv4             Image
godlike-kestrel         Running           172.21.4.179     Ubuntu 22.04 LTS
PS C:> multipass ls
Name                    State             IPv4             Image
godlike-kestrel         Stopped           --               Ubuntu 22.04 LTS
PS C:> multipass start godlike-kestrel
PS C:> multipass ls
Name                    State             IPv4             Image
godlike-kestrel         Running           172.21.4.179     Ubuntu 22.04 LTS
                                          172.21.4.237

Additional info

townsend2010 commented 3 months ago

Probably either the same issue reported in #3354 or very related. @ricab, I'll let you determine if you want to dup this to that issue or leave these separate. :slightly_smiling_face:

ricab commented 3 months ago

Oops, you're right.

ricab commented 3 months ago

Duplicate of #3354