def update_vnic_template(self, host_id, vlan_id, physnet,<EOL>vnic_template_path, vnic_template):
ucsm_ip = self.get_ucsm_ip_for_host(host_id)<EOL>if not ucsm_ip:<EOL><INDENT>LOG.info('<STR_LIT>'<EOL>'<STR_LIT>', str(host_id))<EOL>return False<EOL><DEDENT>vlan_name = self.make_vlan_name(vlan_id)<EOL>with self.ucsm_connect_disconnect(ucsm_ip) as handle:<EOL><INDENT>if not self._create_vlanprofile(handle, vlan_id, ucsm_ip):<EOL><INDENT>LOG.error('<STR_LIT>'<EOL>'<STR_LIT>', vlan_id)<EOL>return False<EOL><DEDENT>try:<EOL><INDENT>LOG.debug('<STR_LIT>', vnic_template_path)<EOL>vnic_template_full_path = (vnic_template_path +<EOL>const.VNIC_TEMPLATE_PREFIX + str(vnic_template))<EOL>LOG.debug('<STR_LIT>',<EOL>vnic_template_full_path, physnet)<EOL>handle.StartTransaction()<EOL>mo = handle.GetManagedObject(<EOL>None,<EOL>self.ucsmsdk.VnicLanConnTempl.ClassId(),<EOL>{self.ucsmsdk.VnicLanConnTempl.DN:<EOL>vnic_template_full_path}, True)<EOL>if not mo:<EOL><INDENT>LOG.error('<STR_LIT>'<EOL>'<STR_LIT>',<EOL>vnic_template_full_path)<EOL>return False<EOL><DEDENT>vlan_dn = (vnic_template_full_path + const.VLAN_PATH_PREFIX +<EOL>vlan_name)<EOL>LOG.debug('<STR_LIT>', vlan_dn)<EOL>eth_if = handle.AddManagedObject(mo,<EOL>self.ucsmsdk.VnicEtherIf.ClassId(),<EOL>{self.ucsmsdk.VnicEtherIf.DN: vlan_dn,<EOL>self.ucsmsdk.VnicEtherIf.NAME: vlan_name,<EOL>self.ucsmsdk.VnicEtherIf.DEFAULT_NET: "<STR_LIT>"}, True)<EOL>if not eth_if:<EOL><INDENT>LOG.error('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>{'<STR_LIT>': vlan_name,<EOL>'<STR_LIT>': vnic_template_full_path})<EOL>return False<EOL><DEDENT>handle.CompleteTransaction()<EOL>return True<EOL><DEDENT>except Exception as e:<EOL><INDENT>return self._handle_ucsm_exception(e, '<STR_LIT>',<EOL>vlan_id, ucsm_ip)<EOL><DEDENT><DEDENT>
Updates VNIC Template with the vlan_id.