def _create_port_profile(self, handle, profile_name, vlan_id,<EOL>vnic_type, ucsm_ip, trunk_vlans, qos_policy):
port_profile_dest = (const.PORT_PROFILESETDN + const.VNIC_PATH_PREFIX +<EOL>profile_name)<EOL>vlan_name = self.make_vlan_name(vlan_id)<EOL>vlan_associate_path = (const.PORT_PROFILESETDN +<EOL>const.VNIC_PATH_PREFIX + profile_name +<EOL>const.VLAN_PATH_PREFIX + vlan_name)<EOL>cl_profile_name = const.CLIENT_PROFILE_NAME_PREFIX + str(vlan_id)<EOL>cl_profile_dest = (const.PORT_PROFILESETDN + const.VNIC_PATH_PREFIX +<EOL>profile_name + const.CLIENT_PROFILE_PATH_PREFIX +<EOL>cl_profile_name)<EOL>self.ucsm_db.remove_port_profile_to_delete(profile_name, ucsm_ip)<EOL>if vnic_type == bc.portbindings.VNIC_DIRECT:<EOL><INDENT>port_mode = const.HIGH_PERF<EOL><DEDENT>else:<EOL><INDENT>port_mode = const.NONE<EOL><DEDENT>try:<EOL><INDENT>port_profile = handle.query_dn(const.PORT_PROFILESETDN)<EOL>if not port_profile:<EOL><INDENT>LOG.warning('<STR_LIT>'<EOL>'<STR_LIT>',<EOL>const.PORT_PROFILESETDN)<EOL>return False<EOL><DEDENT>p_profile = self.ucsmsdk.vnicProfile(<EOL>parent_mo_or_dn=port_profile,<EOL>name=profile_name,<EOL>policy_owner="<STR_LIT>",<EOL>nw_ctrl_policy_name="<STR_LIT>",<EOL>pin_to_group_name="<STR_LIT>",<EOL>descr=const.DESCR,<EOL>qos_policy_name=qos_policy,<EOL>host_nw_ioperf=port_mode,<EOL>max_ports=const.MAX_PORTS)<EOL>handle.add_mo(p_profile)<EOL>if not p_profile:<EOL><INDENT>LOG.warning('<STR_LIT>'<EOL>'<STR_LIT>', profile_name)<EOL>return False<EOL><DEDENT>LOG.debug('<STR_LIT>'<EOL>'<STR_LIT>',<EOL>vlan_associate_path)<EOL>mo = self.ucsmsdk.vnicEtherIf(<EOL>parent_mo_or_dn=p_profile,<EOL>name=vlan_name,<EOL>default_net="<STR_LIT:yes>")<EOL>handle.add_mo(mo)<EOL>if not mo:<EOL><INDENT>LOG.warning('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>', profile_name)<EOL>return False<EOL><DEDENT>LOG.debug('<STR_LIT>'<EOL>'<STR_LIT>', profile_name, port_profile_dest)<EOL>if trunk_vlans:<EOL><INDENT>for vlan in trunk_vlans:<EOL><INDENT>vlan_name = self.make_vlan_name(vlan)<EOL>mo = self.ucsmsdk.vnicEtherIf(<EOL>parent_mo_or_dn=p_profile,<EOL>name=vlan_name,<EOL>default_net="<STR_LIT>")<EOL>handle.add_mo(mo)<EOL>if not mo:<EOL><INDENT>LOG.warning('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>{'<STR_LIT>': vlan, '<STR_LIT>': profile_name})<EOL><DEDENT><DEDENT><DEDENT>cl_profile = self.ucsmsdk.vmVnicProfCl(<EOL>parent_mo_or_dn=p_profile,<EOL>org_path="<STR_LIT>",<EOL>name=cl_profile_name,<EOL>policy_owner="<STR_LIT>",<EOL>sw_name="<STR_LIT>",<EOL>dc_name="<STR_LIT>",<EOL>descr=const.DESCR)<EOL>handle.add_mo(cl_profile)<EOL>if not cl_profile:<EOL><INDENT>LOG.warning('<STR_LIT>'<EOL>'<STR_LIT>',<EOL>cl_profile_name)<EOL>return False<EOL><DEDENT>handle.commit()<EOL>LOG.debug('<STR_LIT>'<EOL>'<STR_LIT>', cl_profile_name, cl_profile_dest)<EOL>return True<EOL><DEDENT>except Exception as e:<EOL><INDENT>return self._handle_ucsm_exception(e, '<STR_LIT>',<EOL>profile_name, ucsm_ip)<EOL><DEDENT>
Creates a Port Profile on the UCS Manager.

        Significant parameters set in the port profile are:
        1. Port profile name - Should match what was set in vif_details
        2. High performance mode - For VM-FEX to be enabled/configured on
        the port using this port profile, this mode should be enabled.
        3. Vlan id - Vlan id used by traffic to and from the port.