847
863
address = self.db.fixed_ip_associate_pool(
848
864
context.elevated(), network['id'], instance_id)
853
865
get_vif = self.db.virtual_interface_get_by_instance_and_network
854
866
vif = get_vif(context, instance_id, network['id'])
855
867
values = {'allocated': True,
856
868
'virtual_interface_id': vif['id']}
857
869
self.db.fixed_ip_update(context, address, values)
859
875
# NOTE(vish) This db query could be removed if we pass az and name
860
876
# (or the whole instance object).