<?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 pan-os-python SDK configure NGFW-VM HA issue in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/pan-os-python-sdk-configure-ngfw-vm-ha-issue/m-p/414049#M2698</link>
    <description>&lt;P&gt;Describe the bug&lt;/P&gt;&lt;P&gt;Trying to configure active-passive HA for NGFW-VM on AWS, but got error "ha1-backup unexpected here"&lt;/P&gt;&lt;P&gt;Expected behavior&lt;/P&gt;&lt;P&gt;The VM series NGFW on AWS is special tailored, according to the admin guide&lt;SPAN&gt;&amp;nbsp;'&lt;/SPAN&gt;&lt;A title="the admin guide" href="https://docs.paloaltonetworks.com/vm-series/10-0/vm-series-deployment/set-up-the-vm-series-firewall-on-aws/high-availability-for-vm-series-firewall-on-aws/configure-activepassive-ha-on-aws.html" target="_blank" rel="nofollow noopener"&gt;https://docs.paloaltonetworks.com/vm-series/10-0/vm-series-deployment/set-up-the-vm-series-firewall-on-aws/high-availability-for-vm-series-firewall-on-aws/configure-activepassive-ha-on-aws.html'&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The HA1 port has to be the "management" interface, for the aws routing table requirement, we have to do interface moving HA, can NOT do secondary IP based.&lt;/P&gt;&lt;P&gt;Current behavior&lt;/P&gt;&lt;P&gt;When configure HA with HA1 without backup, it got error "ha1-backup unexpected here"&lt;/P&gt;&lt;P&gt;Possible solution&lt;/P&gt;&lt;P&gt;Since ha1-backup is not configured, the SDK should not try to configure ha1-backup by itself.&lt;/P&gt;&lt;P&gt;Steps to reproduce&lt;/P&gt;&lt;P&gt;The test code:&lt;/P&gt;&lt;P&gt;from panos.firewall import Firewall&lt;BR /&gt;from panos.ha import HA1, HA2, HighAvailability&lt;/P&gt;&lt;P&gt;def main():&lt;BR /&gt;fw = Firewall('X.X.X.X', 'admin', '########')&lt;BR /&gt;ha_config = HighAvailability(group_id=1, peer_ip="10.2.240.252", mode="active-passive", state_sync=True)&lt;BR /&gt;ha1_int = HA1("10.2.240.236", "255.255.255.0", "management")&lt;BR /&gt;ha2_int = HA2("10.2.224.78", "255.255.255.0", "ethernet1/1")&lt;/P&gt;&lt;P&gt;fw.add(ha_config).create()&lt;BR /&gt;fw.add(ha1_int).create()&lt;BR /&gt;fw.add(ha2_int).create()&lt;/P&gt;&lt;P&gt;fw.commit(sync=True, exception=True)&lt;/P&gt;&lt;P&gt;if&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;== "&lt;STRONG&gt;main&lt;/STRONG&gt;":&lt;BR /&gt;main()&lt;/P&gt;&lt;P&gt;Screenshots&lt;/P&gt;&lt;P&gt;(.venv) 16:00 % python test.py&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "/Users/jozhou/src/python/ansible/.venv/lib/python3.9/site-packages/panos/base.py", line 3661, in method&lt;BR /&gt;super_method(self, *args, **kwargs)&lt;BR /&gt;File "/Users/jozhou/src/python/ansible/.venv/lib/python3.9/site-packages/pan/xapi.py", line 741, in set&lt;BR /&gt;self.__type_config('set', query, extra_qs)&lt;BR /&gt;File "/Users/jozhou/src/python/ansible/.venv/lib/python3.9/site-packages/pan/xapi.py", line 805, in __type_config&lt;BR /&gt;raise PanXapiError(self.status_detail)&lt;BR /&gt;pan.xapi.PanXapiError: deviceconfig -&amp;gt; high-availability -&amp;gt; interface -&amp;gt; ha1-backup unexpected here&lt;BR /&gt;deviceconfig -&amp;gt; high-availability -&amp;gt; interface is invalid&lt;/P&gt;&lt;P&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "/Users/jozhou/src/python/ansible/panos/test.py", line 17, in&lt;BR /&gt;main()&lt;BR /&gt;File "/Users/jozhou/src/python/ansible/panos/test.py", line 10, in main&lt;BR /&gt;fw.add(ha_config).create()&lt;BR /&gt;File "/Users/jozhou/src/python/ansible/.venv/lib/python3.9/site-packages/panos/base.py", line 645, in create&lt;BR /&gt;device.xapi.set(self.xpath_short(), element, retry_on_peer=self.HA_SYNC)&lt;BR /&gt;File "/Users/jozhou/src/python/ansible/.venv/lib/python3.9/site-packages/panos/base.py", line 3682, in method&lt;BR /&gt;raise the_exception&lt;BR /&gt;panos.errors.PanDeviceXapiError: deviceconfig -&amp;gt; high-availability -&amp;gt; interface -&amp;gt; ha1-backup unexpected here&lt;BR /&gt;deviceconfig -&amp;gt; high-availability -&amp;gt; interface is invalid&lt;BR /&gt;(.venv) 16:07 %&lt;/P&gt;&lt;P&gt;Context&lt;/P&gt;&lt;P&gt;NGFW-VM HA pair on AWS same AZ with interface moving of active-passive HA.&lt;/P&gt;&lt;P&gt;Your Environment&lt;/P&gt;&lt;P&gt;NGFW-VM on AWS&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Version used: 10.0.6&lt;/LI&gt;&lt;/UL&gt;</description>
    <pubDate>Thu, 17 Jun 2021 23:54:09 GMT</pubDate>
    <dc:creator>JZhou4</dc:creator>
    <dc:date>2021-06-17T23:54:09Z</dc:date>
    <item>
      <title>pan-os-python SDK configure NGFW-VM HA issue</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/pan-os-python-sdk-configure-ngfw-vm-ha-issue/m-p/414049#M2698</link>
      <description>&lt;P&gt;Describe the bug&lt;/P&gt;&lt;P&gt;Trying to configure active-passive HA for NGFW-VM on AWS, but got error "ha1-backup unexpected here"&lt;/P&gt;&lt;P&gt;Expected behavior&lt;/P&gt;&lt;P&gt;The VM series NGFW on AWS is special tailored, according to the admin guide&lt;SPAN&gt;&amp;nbsp;'&lt;/SPAN&gt;&lt;A title="the admin guide" href="https://docs.paloaltonetworks.com/vm-series/10-0/vm-series-deployment/set-up-the-vm-series-firewall-on-aws/high-availability-for-vm-series-firewall-on-aws/configure-activepassive-ha-on-aws.html" target="_blank" rel="nofollow noopener"&gt;https://docs.paloaltonetworks.com/vm-series/10-0/vm-series-deployment/set-up-the-vm-series-firewall-on-aws/high-availability-for-vm-series-firewall-on-aws/configure-activepassive-ha-on-aws.html'&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The HA1 port has to be the "management" interface, for the aws routing table requirement, we have to do interface moving HA, can NOT do secondary IP based.&lt;/P&gt;&lt;P&gt;Current behavior&lt;/P&gt;&lt;P&gt;When configure HA with HA1 without backup, it got error "ha1-backup unexpected here"&lt;/P&gt;&lt;P&gt;Possible solution&lt;/P&gt;&lt;P&gt;Since ha1-backup is not configured, the SDK should not try to configure ha1-backup by itself.&lt;/P&gt;&lt;P&gt;Steps to reproduce&lt;/P&gt;&lt;P&gt;The test code:&lt;/P&gt;&lt;P&gt;from panos.firewall import Firewall&lt;BR /&gt;from panos.ha import HA1, HA2, HighAvailability&lt;/P&gt;&lt;P&gt;def main():&lt;BR /&gt;fw = Firewall('X.X.X.X', 'admin', '########')&lt;BR /&gt;ha_config = HighAvailability(group_id=1, peer_ip="10.2.240.252", mode="active-passive", state_sync=True)&lt;BR /&gt;ha1_int = HA1("10.2.240.236", "255.255.255.0", "management")&lt;BR /&gt;ha2_int = HA2("10.2.224.78", "255.255.255.0", "ethernet1/1")&lt;/P&gt;&lt;P&gt;fw.add(ha_config).create()&lt;BR /&gt;fw.add(ha1_int).create()&lt;BR /&gt;fw.add(ha2_int).create()&lt;/P&gt;&lt;P&gt;fw.commit(sync=True, exception=True)&lt;/P&gt;&lt;P&gt;if&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;== "&lt;STRONG&gt;main&lt;/STRONG&gt;":&lt;BR /&gt;main()&lt;/P&gt;&lt;P&gt;Screenshots&lt;/P&gt;&lt;P&gt;(.venv) 16:00 % python test.py&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "/Users/jozhou/src/python/ansible/.venv/lib/python3.9/site-packages/panos/base.py", line 3661, in method&lt;BR /&gt;super_method(self, *args, **kwargs)&lt;BR /&gt;File "/Users/jozhou/src/python/ansible/.venv/lib/python3.9/site-packages/pan/xapi.py", line 741, in set&lt;BR /&gt;self.__type_config('set', query, extra_qs)&lt;BR /&gt;File "/Users/jozhou/src/python/ansible/.venv/lib/python3.9/site-packages/pan/xapi.py", line 805, in __type_config&lt;BR /&gt;raise PanXapiError(self.status_detail)&lt;BR /&gt;pan.xapi.PanXapiError: deviceconfig -&amp;gt; high-availability -&amp;gt; interface -&amp;gt; ha1-backup unexpected here&lt;BR /&gt;deviceconfig -&amp;gt; high-availability -&amp;gt; interface is invalid&lt;/P&gt;&lt;P&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "/Users/jozhou/src/python/ansible/panos/test.py", line 17, in&lt;BR /&gt;main()&lt;BR /&gt;File "/Users/jozhou/src/python/ansible/panos/test.py", line 10, in main&lt;BR /&gt;fw.add(ha_config).create()&lt;BR /&gt;File "/Users/jozhou/src/python/ansible/.venv/lib/python3.9/site-packages/panos/base.py", line 645, in create&lt;BR /&gt;device.xapi.set(self.xpath_short(), element, retry_on_peer=self.HA_SYNC)&lt;BR /&gt;File "/Users/jozhou/src/python/ansible/.venv/lib/python3.9/site-packages/panos/base.py", line 3682, in method&lt;BR /&gt;raise the_exception&lt;BR /&gt;panos.errors.PanDeviceXapiError: deviceconfig -&amp;gt; high-availability -&amp;gt; interface -&amp;gt; ha1-backup unexpected here&lt;BR /&gt;deviceconfig -&amp;gt; high-availability -&amp;gt; interface is invalid&lt;BR /&gt;(.venv) 16:07 %&lt;/P&gt;&lt;P&gt;Context&lt;/P&gt;&lt;P&gt;NGFW-VM HA pair on AWS same AZ with interface moving of active-passive HA.&lt;/P&gt;&lt;P&gt;Your Environment&lt;/P&gt;&lt;P&gt;NGFW-VM on AWS&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Version used: 10.0.6&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Thu, 17 Jun 2021 23:54:09 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/pan-os-python-sdk-configure-ngfw-vm-ha-issue/m-p/414049#M2698</guid>
      <dc:creator>JZhou4</dc:creator>
      <dc:date>2021-06-17T23:54:09Z</dc:date>
    </item>
  </channel>
</rss>

