<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Struggling to Unset Virtual Router from Interface via API – Manual Works, API Always Fails in General Topics</title>
    <link>https://live.paloaltonetworks.com/t5/general-topics/struggling-to-unset-virtual-router-from-interface-via-api-manual/m-p/1237952#M125124</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I’m working on automating Palo Alto firewall configuration via the API and I’ve run into a puzzling issue.&lt;/P&gt;
&lt;H1 class="text-24-scalable xs:text-20-scalable"&gt;What I’m Trying to Do:&lt;/H1&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;P&gt;Unset the Virtual Router assigned to a specific Layer3 Ethernet interface (e.g.,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;ae2.4008&lt;/CODE&gt;) using the API.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Manually, I can easily go to the GUI and set the Virtual Router to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;none&lt;/STRONG&gt;, and everything works as expected.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;I’m using the API key method to authenticate and tried a simple API call like this:&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;https://&amp;lt;firewall&amp;gt;/api/?type=config&amp;amp;action=set&amp;amp;key=&amp;lt;api-key&amp;gt;&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/network/interface/ethernet/entry[@name='ae2.4008']/layer3&amp;amp;element=&amp;lt;virtual-router&amp;gt;none&amp;lt;/virtual-router&amp;gt;&lt;/PRE&gt;
&lt;H1 class="text-24-scalable xs:text-20-scalable"&gt;Problem Encountered:&lt;/H1&gt;
&lt;P&gt;Every time I call the API, I get this error:&lt;/P&gt;
&lt;PRE&gt;&amp;lt;response status="error" code="13"&amp;gt;
  &amp;lt;msg&amp;gt;&amp;lt;line&amp;gt;set failed, may need to override template object first&amp;lt;/line&amp;gt;&amp;lt;/msg&amp;gt;
&amp;lt;/response&amp;gt;&lt;/PRE&gt;
&lt;P&gt;I also tried:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;P&gt;Adding&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;override=yes&lt;/CODE&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Different variations of the XML structure&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Setting the whole layer3 block explicitly&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;But nothing worked.&lt;/P&gt;
&lt;H1 class="text-24-scalable xs:text-20-scalable"&gt;Important Details:&lt;/H1&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;P&gt;No templates are configured in the firewall (verified manually via GUI).&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;XPath appears correct and points to the right element.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;No schema issues or typos.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Manual configuration works flawlessly without warnings.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H1 class="text-24-scalable xs:text-20-scalable"&gt;My Questions:&lt;/H1&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;Why does the direct API&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;set&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;call always return a “template object override” error, even when no template exists?&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Is this a known limitation or bug in the PAN-OS API?&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Am I missing some special hidden configuration layer preventing direct API edits?&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Is the export-modify-import approach the only recommended way to handle this type of config change via automation?&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;I’d greatly appreciate insights, experiences, or best practices if you’ve faced something similar.&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Mon, 15 Sep 2025 07:07:17 GMT</pubDate>
    <dc:creator>AK_20201</dc:creator>
    <dc:date>2025-09-15T07:07:17Z</dc:date>
    <item>
      <title>Struggling to Unset Virtual Router from Interface via API – Manual Works, API Always Fails</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/struggling-to-unset-virtual-router-from-interface-via-api-manual/m-p/1237952#M125124</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I’m working on automating Palo Alto firewall configuration via the API and I’ve run into a puzzling issue.&lt;/P&gt;
&lt;H1 class="text-24-scalable xs:text-20-scalable"&gt;What I’m Trying to Do:&lt;/H1&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;P&gt;Unset the Virtual Router assigned to a specific Layer3 Ethernet interface (e.g.,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;ae2.4008&lt;/CODE&gt;) using the API.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Manually, I can easily go to the GUI and set the Virtual Router to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;none&lt;/STRONG&gt;, and everything works as expected.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;I’m using the API key method to authenticate and tried a simple API call like this:&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;https://&amp;lt;firewall&amp;gt;/api/?type=config&amp;amp;action=set&amp;amp;key=&amp;lt;api-key&amp;gt;&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/network/interface/ethernet/entry[@name='ae2.4008']/layer3&amp;amp;element=&amp;lt;virtual-router&amp;gt;none&amp;lt;/virtual-router&amp;gt;&lt;/PRE&gt;
&lt;H1 class="text-24-scalable xs:text-20-scalable"&gt;Problem Encountered:&lt;/H1&gt;
&lt;P&gt;Every time I call the API, I get this error:&lt;/P&gt;
&lt;PRE&gt;&amp;lt;response status="error" code="13"&amp;gt;
  &amp;lt;msg&amp;gt;&amp;lt;line&amp;gt;set failed, may need to override template object first&amp;lt;/line&amp;gt;&amp;lt;/msg&amp;gt;
&amp;lt;/response&amp;gt;&lt;/PRE&gt;
&lt;P&gt;I also tried:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;P&gt;Adding&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;override=yes&lt;/CODE&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Different variations of the XML structure&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Setting the whole layer3 block explicitly&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;But nothing worked.&lt;/P&gt;
&lt;H1 class="text-24-scalable xs:text-20-scalable"&gt;Important Details:&lt;/H1&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;P&gt;No templates are configured in the firewall (verified manually via GUI).&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;XPath appears correct and points to the right element.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;No schema issues or typos.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Manual configuration works flawlessly without warnings.&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;H1 class="text-24-scalable xs:text-20-scalable"&gt;My Questions:&lt;/H1&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;Why does the direct API&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;set&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;call always return a “template object override” error, even when no template exists?&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Is this a known limitation or bug in the PAN-OS API?&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Am I missing some special hidden configuration layer preventing direct API edits?&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Is the export-modify-import approach the only recommended way to handle this type of config change via automation?&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;I’d greatly appreciate insights, experiences, or best practices if you’ve faced something similar.&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 15 Sep 2025 07:07:17 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/struggling-to-unset-virtual-router-from-interface-via-api-manual/m-p/1237952#M125124</guid>
      <dc:creator>AK_20201</dc:creator>
      <dc:date>2025-09-15T07:07:17Z</dc:date>
    </item>
  </channel>
</rss>

