code: def _update_service_profile(self, handle, service_profile,
                                  vlan_id, ucsm_ip):
          
          virtio_port_list = (
              CONF.ml2_cisco_ucsm.ucsms[ucsm_ip].ucsm_virtio_eth_ports)
  
          eth_port_paths = ["%s%s" % (service_profile, ep)
              for ep in virtio_port_list]
  
          vlan_name = self.make_vlan_name(vlan_id)
  
          try:
              obj = handle.query_dn(service_profile)
  
              if not obj:
                  LOG.debug('UCS Manager network driver could not find '
                            'Service Profile %s in UCSM %s',
                            service_profile, ucsm_ip)
                  return False
  
              for eth_port_path in eth_port_paths:
                  eth = handle.query_dn(eth_port_path)
  
                  if eth:
                      eth_if = self.ucsmsdk.vnicEtherIf(
                          parent_mo_or_dn=eth,
                          name=vlan_name,
                          default_net="no")
  
                      handle.add_mo(eth_if)
  
                      if not eth_if:
                          LOG.debug('UCS Manager network driver could not '
                                    'update Service Profile %s with vlan %d',
                                    service_profile, vlan_id)
                          return False
                  else:
                      LOG.debug('UCS Manager network driver did not find '
                                'ethernet port at %s', eth_port_path)
  
              handle.commit()
              return True
  
          except Exception as e:
              return self._handle_ucsm_exception(e, 'Service Profile',
                                                 vlan_name, ucsm_ip)
docs: Updates Service Profile on the UCS Manager.
  
          Each of the ethernet ports on the Service Profile representing
          the UCS Server, is updated with the VLAN profile corresponding
          to the vlan_id passed in.