

def deploy_instance(self, one_instance):
    one_instance = copy.deepcopy(one_instance)
    dst_compute = self.dst_cloud.resources[utils.COMPUTE_RESOURCE]
    _instance = one_instance[utils.INSTANCES_TYPE].values()[0]
    instance = _instance[utils.INSTANCE_BODY]
    new_ids = {
        
    }
    instance_az = dst_compute.get_instance_availability_zone(instance)
    try:
        new_id = dst_compute.deploy(instance, availability_zone=instance_az)
    except exception.TimeoutException:
        (one_instance, new_id) = self._deploy_instance_on_random_host(one_instance, instance_az)
    new_ids[new_id] = instance['id']
    new_info = dst_compute.read_info(search_opts={
        'id': new_ids.keys(),
    })
    for i in new_ids.iterkeys():
        dst_compute.change_status('shutoff', instance_id=i)
    for (new_id, old_id) in new_ids.iteritems():
        new_instance = _instance['instances'][new_id]
        old_instance = one_instance['instances'][old_id]
        new_instance['old_id'] = old_id
        new_instance['meta'] = old_instance['meta']
        new_instance['meta']['source_status'] = old_instance['instance']['status']
        new_instance[utils.INSTANCE_BODY]['key_name'] = old_instance[utils.INSTANCE_BODY]['key_name']
    one_instance = self.prepare_ephemeral_drv(one_instance, new_info, new_ids)
    return one_instance

dataset/ETHPy150Open MirantisWorkloadMobility/CloudFerry/cloudferry/lib/os/actions/transport_instance.py TransportInstance.deploy_instance/VarMisuse@188/277 `new_info`->`_instance`