Hi All,

I'm currently working on a project which requires me to understand the live migration and cold migration process in Openstack.

I have the following questions:

1. In case of live migration with shared storage, how is the current downtime set through update_downtime used? Like when does it know that it needs to pause the VM on the source and perform the stop and copy phase?
It would be great if you could point me to the code base where this is happening. Is this handled by QEMU?

2. In case of cold migrate, how does it select the destination host? As per the code, I saw that it generates a sorted list of hosts based on filtering and weighing but then we also perform randomization. I'm confused as to how this works.

Thank you so much for your time.

Regards,
Priyanka