213
213
'rxtx_factor': instance['instance_type']['rxtx_factor'],
214
214
'host': instance['host'],
215
215
'project_id': instance['project_id']}
217
nw_info = rpc.call(context, FLAGS.network_topic,
218
{'method': 'get_instance_nw_info',
220
return network_model.NetworkInfo.hydrate(nw_info)
221
# FIXME(comstud) rpc calls raise RemoteError if the remote raises
222
# an exception. In the case here, because of a race condition,
223
# it's possible the remote will raise a InstanceNotFound when
224
# someone deletes the instance while this call is in progress.
226
# Unfortunately, we don't have access to the original exception
227
# class now.. but we do have the exception class's name. So,
228
# we're checking it here and raising a new exception.
230
# Ultimately we need RPC to be able to serialize more things like
232
except rpc_common.RemoteError as err:
233
if err.exc_type == 'InstanceNotFound':
234
raise exception.InstanceNotFound(instance_id=instance['id'])
216
nw_info = rpc.call(context, FLAGS.network_topic,
217
{'method': 'get_instance_nw_info',
219
return network_model.NetworkInfo.hydrate(nw_info)
237
221
def validate_networks(self, context, requested_networks):
238
222
"""validate the networks passed at the time of creating