Beispiel #1
0
    def _add_virtual_interface(self, context, instance_id, network_id):
        vif = {"instance_id": instance_id, "network_id": network_id, "uuid": str(utils.gen_uuid())}

        # TODO(Vek): Ideally, we would have a VirtualInterface class
        #            that would take care of delegating to whoever it
        #            needs to get information from.  We'll look at
        #            this after Trey's refactorings...
        m_ipam = melange_ipam_lib.get_ipam_lib(self)
        vif["address"] = m_ipam.create_vif(vif["uuid"], vif["instance_id"], context.project_id)

        return self.db.virtual_interface_create(context, vif)
Beispiel #2
0
    def _add_virtual_interface(self, context, instance_id, network_id):
        vif = {'instance_id': instance_id,
               'network_id': network_id,
               'uuid': str(utils.gen_uuid())}

        # TODO(Vek): Ideally, we would have a VirtualInterface class
        #            that would take care of delegating to whoever it
        #            needs to get information from.  We'll look at
        #            this after Trey's refactorings...
        m_ipam = melange_ipam_lib.get_ipam_lib(self)
        vif['address'] = m_ipam.create_vif(vif['uuid'],
                                           vif['instance_id'],
                                           context.project_id)

        return self.db.virtual_interface_create(context, vif)