Migrating in and out virtual machines