'Update instance vnic index.
When the \'VNIC index\' extension is supported this method will update
the vnic index of the instance on the port.'

def update_instance_vnic_index(self, context, instance, vif, index):

    self._refresh_neutron_extensions_cache(context)
    if (constants.VNIC_INDEX_EXT in self.extensions):
        neutron = get_client(context)
        port_req_body = {'port': {'vnic_index': index}}
        try:
            neutron.update_port(vif['id'], port_req_body)
        except Exception:
            with excutils.save_and_reraise_exception():
                LOG.exception(_LE('Unable    to    update    instance    VNIC    index    for    port    %s.'), vif['id'], instance=instance)
