You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "Pearl1594 (via GitHub)" <gi...@apache.org> on 2025/04/09 17:39:13 UTC

[PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Pearl1594 opened a new pull request, #10684:
URL: https://github.com/apache/cloudstack/pull/10684

   ### Description
   
   This PR is just to test #10483 
   <!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   <!--- ******************************************************************************* -->
   <!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- ******************************************************************************* -->
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] build/CI
   - [ ] test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [ ] Minor
   - [ ] Trivial
   
   ### Screenshots (if appropriate):
   
   ### How Has This Been Tested?
   
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to -->
   
   #### How did you try to break this feature and the system with this change?
   
   <!-- see how your change affects other areas of the code, etc. -->
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2795578668

   @Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + xenserver-84) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2795569056

   Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13014


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2793592489

   @harikrishna-patnala @Pearl1594 
   I pushed a commit for your reference: https://github.com/apache/cloudstack/commit/ef4741c2f7ad1981420b710b4cc15942cdf1f84a
   I have not tested it yet


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2794112402

   Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13009


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2794352996

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=10684&metric=new_coverage&view=list) (required ≥ 40%)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2844368513

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2823210195

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2823426669

   @Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + xcpng83) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2823931820

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=10684&metric=new_coverage&view=list) (required ≥ 40%)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Maintainability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2821088161

   @Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + xcpng83) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2821082568

   @blueorangutan test ol8 xcpng83 keepEnv


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2823721298

   > @weizhouapache I have no idea. I'm not familiar with this, but maybe we might have someone internally who is. Let me ask around.
   
   good, thanks @olivierlambert 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2856452140

   <b>[SF] Trillian test result (tid-13210)</b>
   Environment: xenserver-84 (x2), Advanced Networking with Mgmt server ol8
   Total time taken: 67815 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10684-t13210-xenserver-84.zip
   Smoke tests completed. 140 look OK, 1 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   ContextSuite context=TestSharedNetworkWithConfigDrive>:setup | `Error` | 7.50 | test_network.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2790519667

   ## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/10684?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Project coverage is 4.00%. Comparing base [(`6850147`)](https://app.codecov.io/gh/apache/cloudstack/commit/6850147c9e860e063fcd20a9e1a12978a3248ec8?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`37d1704`)](https://app.codecov.io/gh/apache/cloudstack/commit/37d170433da59d34d72d819a671ab7ab2588ac52?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   > :exclamation:  There is a different number of reports uploaded between BASE (6850147) and HEAD (37d1704). Click for more details.
   > 
   > <details><summary>HEAD has 1 upload less than BASE</summary>
   >
   >| Flag | BASE (6850147) | HEAD (37d1704) |
   >|------|------|------|
   >|unittests|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@              Coverage Diff              @@
   ##               4.20   #10684       +/-   ##
   =============================================
   - Coverage     16.01%    4.00%   -12.02%     
   =============================================
     Files          5652      398     -5254     
     Lines        495817    32501   -463316     
     Branches      60045     5761    -54284     
   =============================================
   - Hits          79404     1301    -78103     
   + Misses       407551    31051   -376500     
   + Partials       8862      149     -8713     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/10684/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/10684/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.00% <ø> (ø)` | |
   | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/10684/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/cloudstack/pull/10684?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2790510322

   @Pearl1594 a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#discussion_r2036768932


##########
scripts/vm/hypervisor/xenserver/xenserver84/cloud-plugin-storage:
##########
@@ -0,0 +1,304 @@
+#!/usr/bin/python
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Version @VERSION@
+#
+# A plugin for executing script needed by vmops cloud
+
+import os, sys, time
+import XenAPIPlugin
+if os.path.exists("/opt/xensource/sm"):
+    sys.path.extend(["/opt/xensource/sm/", "/usr/local/sbin/", "/sbin/"])
+if os.path.exists("/usr/lib/xcp/sm"):
+    sys.path.extend(["/usr/lib/xcp/sm/", "/usr/local/sbin/", "/sbin/"])
+
+import SR, VDI, SRCommand, util, lvutil
+from util import CommandException
+import vhdutil
+import shutil
+import lvhdutil
+import errno
+import subprocess
+import xs_errors
+import cleanup
+import stat
+import random
+import cloudstack_pluginlib as lib
+import logging
+
+lib.setup_logging("/var/log/cloud/cloud.log")
+
+VHDUTIL = "vhd-util"
+VHD_PREFIX = 'VHD-'
+CLOUD_DIR = '/var/run/cloud_mount'
+
+def echo(fn):
+    def wrapped(*v, **k):
+        name = fn.__name__
+        logging.debug("#### CLOUD enter  %s ####" % name )
+        res = fn(*v, **k)
+        logging.debug("#### CLOUD exit  %s ####" % name )
+        return res
+    return wrapped
+
+def getPrimarySRPath(primaryStorageSRUuid, isISCSI):
+    if isISCSI:
+        primarySRDir = lvhdutil.VG_PREFIX + primaryStorageSRUuid
+        return os.path.join(lvhdutil.VG_LOCATION, primarySRDir)
+    else:
+        return os.path.join(SR.MOUNT_BASE, primaryStorageSRUuid)
+
+def getBackupVHD(UUID):
+    return UUID + '.' + SR.DEFAULT_TAP
+
+def getVHD(UUID, isISCSI):
+    if isISCSI:
+        return VHD_PREFIX + UUID
+    else:
+        return UUID + '.' + SR.DEFAULT_TAP
+
+def getIsTrueString(stringValue):
+    booleanValue = False
+    if (stringValue and stringValue == 'true'):
+        booleanValue = True
+    return booleanValue
+
+def makeUnavailable(uuid, primarySRPath, isISCSI):
+    if not isISCSI:
+        return
+    VHD = getVHD(uuid, isISCSI)
+    path = os.path.join(primarySRPath, VHD)
+    manageAvailability(path, '-an')
+    return
+
+def manageAvailability(path, value):
+    if path.__contains__("/var/run/sr-mount"):
+        return
+    logging.debug("Setting availability of " + path + " to " + value)
+    try:
+        cmd = ['/usr/sbin/lvchange', value, path]
+        util.pread2(cmd)
+    except: #CommandException, (rc, cmdListStr, stderr):
+        #errMsg = "CommandException thrown while executing: " + cmdListStr + " with return code: " + str(rc) + " and stderr: " + stderr
+        errMsg = "Unexpected exception thrown by lvchange"
+        logging.debug(errMsg)
+        if value == "-ay":
+            # Raise an error only if we are trying to make it available.
+            # Just warn if we are trying to make it unavailable after the
+            # snapshot operation is done.
+            raise xs_errors.XenError(errMsg)
+    return
+
+
+def checkVolumeAvailability(path):
+    try:
+        if not isVolumeAvailable(path):
+            # The VHD file is not available on XenSever. The volume is probably
+            # inactive or detached.
+            # Do lvchange -ay to make it available on XenServer
+            manageAvailability(path, '-ay')
+    except:
+        errMsg = "Could not determine status of ISCSI path: " + path
+        logging.debug(errMsg)
+        raise xs_errors.XenError(errMsg)
+
+    success = False
+    i = 0
+    while i < 6:
+        i = i + 1
+        # Check if the vhd is actually visible by checking for the link
+        # set isISCSI to true
+        success = isVolumeAvailable(path)
+        if success:
+            logging.debug("Made vhd: " + path + " available and confirmed that it is visible")
+            break
+
+        # Sleep for 10 seconds before checking again.
+        time.sleep(10)
+
+    # If not visible within 1 min fail
+    if not success:
+        logging.debug("Could not make vhd: " +  path + " available despite waiting for 1 minute. Does it exist?")
+
+    return success
+
+def isVolumeAvailable(path):
+    # Check if iscsi volume is available on this XenServer.
+    status = "0"
+    try:
+        p = subprocess.Popen(["/bin/bash", "-c", "if [ -L " + path + " ]; then echo 1; else echo 0;fi"], stdout=subprocess.PIPE)
+        status = p.communicate()[0].strip("\n")
+    except:
+        errMsg = "Could not determine status of ISCSI path: " + path
+        logging.debug(errMsg)
+        raise xs_errors.XenError(errMsg)
+
+    return (status == "1")
+
+def scanParent(path):
+    # Do a scan for the parent for ISCSI volumes
+    # Note that the parent need not be visible on the XenServer
+    parentUUID = ''
+    try:
+        lvName = os.path.basename(path)
+        dirname = os.path.dirname(path)
+        vgName = os.path.basename(dirname)
+        vhdInfo = vhdutil.getVHDInfoLVM(lvName, lvhdutil.extractUuid, vgName)
+        parentUUID = vhdInfo.parentUuid
+    except:
+        errMsg = "Could not get vhd parent of " + path
+        logging.debug(errMsg)
+        raise xs_errors.XenError(errMsg)
+    return parentUUID
+
+def getParentOfSnapshot(snapshotUuid, primarySRPath, isISCSI):
+    snapshotVHD    = getVHD(snapshotUuid, isISCSI)
+    snapshotPath   = os.path.join(primarySRPath, snapshotVHD)
+
+    baseCopyUuid = ''
+    if isISCSI:
+        checkVolumeAvailability(snapshotPath)
+        baseCopyUuid = scanParent(snapshotPath)
+    else:
+        baseCopyUuid = getParent(snapshotPath, isISCSI)
+
+    logging.debug("Base copy of snapshotUuid: " + snapshotUuid + " is " + baseCopyUuid)
+    return baseCopyUuid
+
+def getParent(path, isISCSI):
+    parentUUID = ''
+    try :
+        if isISCSI:
+            parentUUID = vhdutil.getParent(path, lvhdutil.extractUuid)
+        else:
+            parentUUID = vhdutil.getParent(path, cleanup.FileVDI.extractUuid)
+    except:
+        errMsg = "Could not get vhd parent of " + path
+        logging.debug(errMsg)
+        raise xs_errors.XenError(errMsg)
+    return parentUUID
+
+def getVhdParent(session, args):
+    logging.debug("getParent with " + str(args))
+    try:
+        primaryStorageSRUuid      = args['primaryStorageSRUuid']
+        snapshotUuid              = args['snapshotUuid']
+        isISCSI                   = getIsTrueString(args['isISCSI'])
+
+        primarySRPath = getPrimarySRPath(primaryStorageSRUuid, isISCSI)
+        logging.debug("primarySRPath: " + primarySRPath)
+
+        baseCopyUuid = getParentOfSnapshot(snapshotUuid, primarySRPath, isISCSI)
+
+        return  baseCopyUuid
+    except:
+        logging.debug('getVhdParent', exc_info=True)
+        raise xs_errors.XenError("Failed to getVhdParent")
+def makedirs(path):
+    if not os.path.isdir(path):
+        try:
+            os.makedirs(path)
+        except OSError as e:
+            umount(path)
+            if os.path.isdir(path):
+                return
+            errMsg = "OSError while creating " + path + " with errno: " + str(e.errno) + " and strerr: " + e.strerror
+            logging.debug(errMsg)
+            raise xs_errors.XenError(errMsg)
+    return
+
+def umount(localDir):
+    try:
+        cmd = ['umount', localDir]
+        util.pread2(cmd)
+    except CommandException:
+        errMsg = "CommandException raised while trying to umount " + localDir
+        logging.debug(errMsg)
+        raise xs_errors.XenError(errMsg)
+
+    logging.debug("Successfully unmounted " + localDir)
+    return
+
+@echo
+def mountNfsSecondaryStorage(session, args):
+    remoteDir = args['remoteDir']
+    localDir  = args['localDir']
+    nfsVersion = args['nfsVersion']
+    logging.debug("mountNfsSecondaryStorage with params: " + str(args))
+    mounted = False
+    f = open("/proc/mounts", 'r')
+    for line in f:
+        tokens = line.split(" ")
+        if len(tokens) > 2 and tokens[0] == remoteDir and tokens[1] == localDir:
+            mounted = True
+
+    if mounted:
+        return "true"
+
+    makedirs(localDir)
+    options = "soft,tcp,timeo=133,retrans=1"
+    if nfsVersion:
+        options += ",vers=" + nfsVersion
+    try:
+        cmd = ['mount', '-o', options, remoteDir, localDir]
+        txt = util.pread2(cmd)
+    except:
+        txt = ''
+        errMsg = "Unexpected error while trying to mount " + remoteDir + " to " + localDir
+        logging.debug(errMsg)
+        raise xs_errors.XenError(errMsg)
+    logging.debug("Successfully mounted " + remoteDir + " to " + localDir)
+
+    return "true"
+
+@echo
+def umountNfsSecondaryStorage(session, args):
+    localDir = args['localDir']
+    try:
+        cmd = ['umount', localDir]
+        util.pread2(cmd)
+    except CommandException:
+        errMsg = "CommandException raised while trying to umount " + localDir
+        logging.debug(errMsg)
+        raise xs_errors.XenError(errMsg)
+    try:
+        os.system("rmdir " + localDir)
+    except:
+        pass
+    logging.debug("Successfully unmounted " + localDir)
+    return "true"
+
+@echo
+def makeDirectory(session, args):
+    path = args['path']
+    if not os.path.isdir(path):
+        try:
+            os.makedirs(path)
+        except OSError as e:
+            if os.path.isdir(path):
+                return "true"
+            errMsg = "OSError while creating " + path + " with errno: " + str(e.errno) + " and strerr: " + e.strerror
+            logging.debug(errMsg)
+            raise xs_errors.XenError(errMsg)
+    return "true"
+
+if __name__ == "__main__":
+    XenAPIPlugin.dispatch({"getVhdParent":getVhdParent, "mountNfsSecondaryStorage":mountNfsSecondaryStorage,
+        "umountNfsSecondaryStorage":umountNfsSecondaryStorage,
+        "makeDirectory":makeDirectory})
+

Review Comment:
   ```suggestion
   ```



##########
scripts/vm/hypervisor/xenserver/xenserver84/vmops:
##########
@@ -0,0 +1,1607 @@
+#!/usr/bin/python
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Version @VERSION@
+#
+# A plugin for executing script needed by vmops cloud
+
+import os, sys, time
+import XenAPIPlugin
+if os.path.exists("/opt/xensource/sm"):
+    sys.path.extend(["/opt/xensource/sm/", "/usr/local/sbin/", "/sbin/"])
+if os.path.exists("/usr/lib/xcp/sm"):
+    sys.path.extend(["/usr/lib/xcp/sm/", "/usr/local/sbin/", "/sbin/"])
+import base64
+import socket
+import stat
+import tempfile
+import util
+import subprocess
+import zlib
+import cloudstack_pluginlib as lib
+import logging
+from util import CommandException
+
+lib.setup_logging("/var/log/cloud/cloud.log")
+
+def echo(fn):
+    def wrapped(*v, **k):
+        name = fn.__name__
+        #command string is logged in SMlog, so method enter/exit logging into SMlog will help for debugging
+        util.SMlog("#### CLOUD enter  %s ####" % name )
+        res = fn(*v, **k)
+        util.SMlog("#### CLOUD exit  %s ####" % name )
+        return res
+    return wrapped
+
+@echo
+def add_to_VCPUs_params_live(session, args):
+    key = args['key']
+    value = args['value']
+    vmname = args['vmname']
+    try:
+        cmd = ["bash", "/opt/cloud/bin/add_to_vcpus_params_live.sh", vmname, key, value]
+        txt = util.pread2(cmd)
+    except:
+        return 'false'
+    return 'true'
+
+@echo
+def setup_iscsi(session, args):
+    uuid=args['uuid']
+    try:
+        cmd = ["bash", "/opt/cloud/bin/setup_iscsi.sh", uuid]
+        txt = util.pread2(cmd)
+    except:
+        txt = ''
+    return txt
+
+
+@echo
+def preparemigration(session, args):
+    uuid = args['uuid']
+    try:
+        cmd = ["/opt/cloud/bin/make_migratable.sh", uuid]
+        util.pread2(cmd)
+        txt = 'success'
+    except:
+        logging.debug("Catch prepare migration exception" )
+        txt = ''
+
+    return txt
+
+@echo
+def setIptables(session, args):
+    try:
+        cmd = ["/bin/bash", "/opt/cloud/bin/setupxenserver.sh"]
+        txt = util.pread2(cmd)
+        txt = 'success'
+    except:
+        logging.debug("  setIptables execution failed "  )
+        txt = ''
+
+    return txt
+
+@echo
+def pingdomr(session, args):
+    host = args['host']
+    port = args['port']
+    socket.setdefaulttimeout(3)
+    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+    try:
+        s.connect((host,int(port)))
+        txt = 'success'
+    except:
+        txt = ''
+
+    s.close()
+
+    return txt
+
+@echo
+def kill_copy_process(session, args):
+    namelabel = args['namelabel']
+    try:
+        cmd = ["bash", "/opt/cloud/bin/kill_copy_process.sh", namelabel]
+        txt = util.pread2(cmd)
+    except:
+        txt = 'false'
+    return txt
+
+@echo
+def pingxenserver(session, args):
+    txt = 'success'
+    return txt
+
+def pingtest(session, args):
+    sargs = args['args']
+    cmd = sargs.split(' ')
+    cmd.insert(0, "/opt/cloud/bin/pingtest.sh")
+    cmd.insert(0, "/bin/bash")
+    try:
+        txt = util.pread2(cmd)
+        txt = 'success'
+    except:
+        logging.debug("  pingtest failed "  )
+        txt = ''
+
+    return txt
+
+@echo
+def setLinkLocalIP(session, args):
+    brName = args['brName']
+    try:
+        cmd = ["ip", "route", "del", "169.254.0.0/16"]
+        txt = util.pread2(cmd)
+    except:
+        txt = ''
+    try:
+        cmd = ["ifconfig", brName, "169.254.0.1", "netmask", "255.255.0.0"]
+        txt = util.pread2(cmd)
+    except:
+        try:
+            cmd = ['cat', '/etc/xensource/network.conf']
+            result = util.pread2(cmd)
+        except:
+            return 'can not cat network.conf'
+
+        if result.lower().strip() == "bridge":
+            try:
+                cmd = ["brctl", "addbr", brName]
+                txt = util.pread2(cmd)
+            except:
+                pass
+
+        else:
+            try:
+                cmd = ["ovs-vsctl", "add-br", brName]
+                txt = util.pread2(cmd)
+            except:
+                pass
+
+        try:
+            cmd = ["ifconfig", brName, "169.254.0.1", "netmask", "255.255.0.0"]
+            txt = util.pread2(cmd)
+        except:
+            pass
+    try:
+        cmd = ["ip", "route", "add", "169.254.0.0/16", "dev", brName, "src", "169.254.0.1"]
+        txt = util.pread2(cmd)
+    except:
+        txt = ''
+    txt = 'success'
+    return txt
+
+@echo
+def createFile(session, args):
+    file_path = args['filepath']
+    file_contents = args['filecontents']
+
+    try:
+        f = open(file_path, "w")
+        f.write(file_contents)
+        f.close()
+        txt = 'success'
+    except:
+        logging.debug(" failed to create HA proxy cfg file ")
+        txt = ''
+
+    return txt
+
+@echo
+def secureCopyToHost(session, args):
+    host_filepath = args['hostfilepath']
+    src_ip = args['srcip']
+    src_filepath = args['srcfilepath']
+    src_target = "root@" + src_ip + ":" + src_filepath
+    # Make any directories as needed
+    if not os.path.isdir(host_filepath):
+        try:
+            os.makedirs(host_filepath)
+        except OSError as e:
+            if not os.path.isdir(host_filepath):
+                errMsg = "OSError while creating " + host_filepath + " with errno: " + str(e.errno) + " and strerr: " + e.strerror
+                logging.debug(errMsg)
+                return "fail# Cannot create the directory to copy file to " + host_filepath
+
+    # Copy file to created directory
+    txt=""
+    try:
+        txt = util.pread2(['scp','-P','3922','-q','-o','StrictHostKeyChecking=no','-i','/root/.ssh/id_rsa.cloud', src_target, host_filepath])
+        util.pread2(['chmod', 'a+r', os.path.join(host_filepath, os.path.basename(src_filepath))])
+        txt = 'success#' + txt
+    except:
+        logging.error("failed to scp source target " + src_target + " to host at file path " + host_filepath)
+        txt = 'fail#' + txt
+    return txt
+
+@echo
+def createFileInDomr(session, args):
+    src_filepath = args['srcfilepath']
+    dst_path = args['dstfilepath']
+    domrip = args['domrip']
+    cleanup = 'true' if 'cleanup' not in args else args['cleanup']
+    txt=""
+    try:
+        target = "root@" + domrip + ":" + dst_path
+        txt = util.pread2(['scp','-P','3922','-q','-o','StrictHostKeyChecking=no','-i','/root/.ssh/id_rsa.cloud',src_filepath, target])
+        if cleanup == 'true' or not cleanup:
+            util.pread2(['rm',src_filepath])
+        txt = 'succ#' + txt
+    except:
+        logging.debug("failed to copy file " + src_filepath + " from host to VR with ip " + domrip)
+        txt = 'fail#' + txt
+    return txt
+
+@echo
+def runPatchScriptInDomr(session, args):
+    domrip = args['domrip']
+    txt=""
+    try:
+        target = "root@" + domrip
+        txt = util.pread2(['ssh','-p','3922','-i','/root/.ssh/id_rsa.cloud', target, "/bin/bash","/var/cache/cloud/patch-sysvms.sh"])
+        txt = 'succ#' + txt
+    except:
+        logging.debug("failed to run patch script in systemVM with IP:  " + domrip)
+        txt = 'fail#' + txt
+    return txt
+
+@echo
+def deleteFile(session, args):
+    file_path = args["filepath"]
+
+    try:
+        if os.path.isfile(file_path):
+            os.remove(file_path)
+        txt = 'success'
+    except:
+        logging.debug(" failed to remove HA proxy cfg file ")
+        txt = ''
+
+    return txt
+
+#using all the iptables chain names length to 24 because cleanup_rules groups the vm chain excluding -def,-eg
+#to avoid multiple iptables chains for single vm, there using length 24
+def chain_name(vm_name):
+    if vm_name.startswith('i-') or vm_name.startswith('r-'):
+        if vm_name.endswith('untagged'):
+            return '-'.join(vm_name.split('-')[:-1])
+    if len(vm_name) > 25:
+        vm_name = vm_name[0:24]
+    return vm_name
+
+def chain_name_def(vm_name):
+    #iptables chain length max is 29 chars
+    if len(vm_name) > 25:
+        vm_name = vm_name[0:24]
+
+    if vm_name.startswith('i-'):
+        if vm_name.endswith('untagged'):
+            return '-'.join(vm_name.split('-')[:-1]) + "-def"
+        return vm_name + "-def"
+
+    if len(vm_name) > 28:
+        vm_name = vm_name[0:27]
+    return vm_name
+
+def egress_chain_name(vm_name):
+    #iptables chain length max is 29 chars
+    name = chain_name(vm_name)
+    name = name+"-eg"
+    return name
+
+#chain name length is 14 because it has protocol and ports appends
+def chain_name_ipset(vm_name):
+    if vm_name.startswith('i-') or vm_name.startswith('r-'):
+        if vm_name.endswith('untagged'):
+            return ''.join(vm_name.split('')[:-1])
+        if len(vm_name) > 14:
+            vm_name = vm_name[0:13]
+    return vm_name
+
+def egress_chain_name_ipset(vm_name):
+    name = chain_name_ipset(vm_name) + "-e"
+    return name
+
+def ingress_chain_name_ipset(vm_name):
+    name = chain_name_ipset(vm_name)
+    return name
+
+@echo
+def can_bridge_firewall(session, args):
+    try:
+        util.pread2(['ebtables', '-V'])
+        util.pread2(['ipset', '-V'])
+        cmd = ['cat', '/etc/xensource/network.conf']
+        result = util.pread2(cmd)
+        if result.lower().strip() != "bridge":
+            return 'false'
+
+    except:
+        return 'false'
+
+    try:
+        util.pread2(['iptables', '-N', 'BRIDGE-FIREWALL'])
+        util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '-m', 'state', '--state', 'RELATED,ESTABLISHED', '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged',  '-p', 'udp', '--dport', '67', '--sport', '68',  '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged',  '-p', 'udp', '--dport', '68', '--sport', '67',  '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-D', 'FORWARD',  '-j', 'RH-Firewall-1-INPUT'])
+    except:
+        logging.debug('Chain BRIDGE-FIREWALL already exists')
+
+    try:
+        util.pread2(['iptables', '-N', 'BRIDGE-DEFAULT-FIREWALL'])
+        util.pread2(['iptables', '-A', 'BRIDGE-DEFAULT-FIREWALL', '-m', 'state', '--state', 'RELATED,ESTABLISHED', '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-A', 'BRIDGE-DEFAULT-FIREWALL', '-m', 'physdev', '--physdev-is-bridged',  '-p', 'udp', '--dport', '67', '--sport', '68',  '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-A', 'BRIDGE-DEFAULT-FIREWALL', '-m', 'physdev', '--physdev-is-bridged',  '-p', 'udp', '--dport', '68', '--sport', '67',  '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '-j', 'BRIDGE-DEFAULT-FIREWALL'])
+        util.pread2(['iptables', '-D', 'BRIDGE-FIREWALL', '-m', 'state', '--state', 'RELATED,ESTABLISHED', '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-D', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged',  '-p', 'udp', '--dport', '67', '--sport', '68',  '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-D', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged',  '-p', 'udp', '--dport', '68', '--sport', '67',  '-j', 'ACCEPT'])
+    except:
+        logging.debug('Chain BRIDGE-DEFAULT-FIREWALL already exists')
+
+    result = 'true'
+    try:
+        util.pread2(['/bin/bash', '-c', 'iptables -n -L FORWARD | grep BRIDGE-FIREWALL'])
+    except:
+        try:
+            util.pread2(['iptables', '-I', 'FORWARD', '-m', 'physdev', '--physdev-is-bridged', '-j', 'BRIDGE-FIREWALL'])
+            util.pread2(['iptables', '-A', 'FORWARD', '-j', 'DROP'])
+        except:
+            return 'false'
+    default_ebtables_rules()
+    allow_egress_traffic(session)
+    if not os.path.exists('/var/run/cloud'):
+        os.makedirs('/var/run/cloud')
+    if not os.path.exists('/var/cache/cloud'):
+        os.makedirs('/var/cache/cloud')
+    #get_ipset_keyword()
+
+    cleanup_rules_for_dead_vms(session)
+    cleanup_rules(session, args)
+
+    return result
+
+@echo
+def default_ebtables_rules():
+    try:
+        util.pread2(['ebtables', '-N',  'DEFAULT_EBTABLES'])
+        util.pread2(['ebtables', '-A', 'FORWARD', '-j'  'DEFAULT_EBTABLES'])
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '--ip-dst', '255.255.255.255', '--ip-proto', 'udp', '--ip-dport', '67', '-j', 'ACCEPT'])
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '--ip-dst', '255.255.255.255', '--ip-proto', 'udp', '--ip-dport', '68', '-j', 'ACCEPT'])
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'ARP', '--arp-op', 'Request', '-j', 'ACCEPT'])
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'ARP', '--arp-op', 'Reply', '-j', 'ACCEPT'])
+        # deny mac broadcast and multicast
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '-d', 'Broadcast', '-j', 'DROP'])
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '-d', 'Multicast', '-j', 'DROP'])
+        # deny ip broadcast and multicast
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '--ip-dst', '255.255.255.255', '-j', 'DROP'])
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '--ip-dst', '224.0.0.0/4', '-j', 'DROP'])
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '-j', 'RETURN'])
+        # deny ipv6
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv6', '-j', 'DROP'])
+        # deny vlan
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', '802_1Q', '-j', 'DROP'])
+        # deny all others (e.g., 802.1d, CDP)
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES',  '-j', 'DROP'])
+    except:
+        logging.debug('Chain DEFAULT_EBTABLES already exists')
+
+
+@echo
+def allow_egress_traffic(session):
+    devs = []
+    for pif in session.xenapi.PIF.get_all():
+        pif_rec = session.xenapi.PIF.get_record(pif)
+        dev = pif_rec.get('device')
+        devs.append(dev + "+")
+    for d in devs:
+        try:
+            util.pread2(['/bin/bash', '-c', "iptables -n -L FORWARD | grep '%s '" % d])
+        except:
+            try:
+                util.pread2(['iptables', '-I', 'FORWARD', '2', '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', d, '-j', 'ACCEPT'])
+            except:
+                logging.debug("Failed to add FORWARD rule through to %s" % d)
+                return 'false'
+    return 'true'
+
+def getIpsetType():
+    try:
+        out = util.pread2(['/bin/bash', '-c', "ipset -v | awk '{print $5}'"])
+        out.replace(".","")
+        if int(out) < 6:
+            return 'iptreemap'
+        else:
+            return 'nethash'
+    except:
+        return 'iptreemap'
+
+def ipset(ipsetname, proto, start, end, cidrs):
+    type = getIpsetType()
+    try:
+        util.pread2(['ipset', '-N', ipsetname, type])
+    except:
+        logging.debug("ipset chain already exists: " + ipsetname)
+
+    result = True
+    ipsettmp = ''.join(''.join(ipsetname.split('-')).split('_')) + str(int(time.time()) % 1000)
+
+    try:
+        util.pread2(['ipset', '-N', ipsettmp, type])
+    except:
+        logging.debug("Failed to create temp ipset, reusing old name= " + ipsettmp)
+        try:
+            util.pread2(['ipset', '-F', ipsettmp])
+        except:
+            logging.debug("Failed to clear old temp ipset name=" + ipsettmp)
+            return False
+    try:
+        for cidr in cidrs:
+            try:
+                util.pread2(['ipset', '-A', ipsettmp, cidr])
+            except CommandException as cex:
+                logging.debug("ipset cidr add failed due to: " + str(cex.reason))
+                if cex.reason.rfind('already in set') == -1:
+                    raise
+    except:
+        logging.debug("Failed to program ipset " + ipsetname)
+        util.pread2(['ipset', '-F', ipsettmp])
+        util.pread2(['ipset', '-X', ipsettmp])
+        return False
+
+    try:
+        util.pread2(['ipset', '-W', ipsettmp, ipsetname])
+    except:
+        logging.debug("Failed to swap ipset, trying to delete and swap ipset: " + ipsetname)
+        # the old ipset entry could be of iphash type, try to delete and recreate
+        try:
+            util.pread2(['ipset', '-X', ipsetname])
+            util.pread2(['ipset', '-N', ipsetname, type])
+            util.pread2(['ipset', '-W', ipsettmp, ipsetname])
+        except:
+            logging.debug("Failed to swap ipset " + ipsetname)
+            result = False
+        logging.debug("Succeeded in re-initializing and swapping ipset")
+
+    try:
+        util.pread2(['ipset', '-F', ipsettmp])
+        util.pread2(['ipset', '-X', ipsettmp])
+    except:
+        # if the temporary name clashes next time we'll just reuse it
+        logging.debug("Failed to delete temp ipset " + ipsettmp)
+
+    return result
+
+@echo
+def destroy_network_rules_for_vm(session, args):
+    vm_name = args.pop('vmName')
+    vmchain = chain_name(vm_name)
+    vmchain_egress = egress_chain_name(vm_name)
+    vmchain_default = chain_name_def(vm_name)
+
+    delete_rules_for_vm_in_bridge_firewall_chain(vm_name)
+    if vm_name.startswith('i-') or vm_name.startswith('r-') or vm_name.startswith('l-'):
+        try:
+            util.pread2(['iptables', '-F', vmchain_default])
+            util.pread2(['iptables', '-X', vmchain_default])
+        except:
+            logging.debug("Ignoring failure to delete chain " + vmchain_default)
+
+    destroy_ebtables_rules(vmchain)
+    destroy_arptables_rules(vmchain)
+
+    try:
+        util.pread2(['iptables', '-F', vmchain])
+        util.pread2(['iptables', '-X', vmchain])
+    except:
+        logging.debug("Ignoring failure to delete ingress chain " + vmchain)
+
+
+    try:
+        util.pread2(['iptables', '-F', vmchain_egress])
+        util.pread2(['iptables', '-X', vmchain_egress])
+    except:
+        logging.debug("Ignoring failure to delete egress chain " + vmchain_egress)
+
+    remove_rule_log_for_vm(vm_name)
+    remove_secip_log_for_vm(vm_name)
+
+    if 1 in [ vm_name.startswith(c) for c in ['r-', 's-', 'v-', 'l-'] ]:
+        return 'true'
+
+    try:
+        setscmd = "ipset --save | grep '%s' | grep -e '^-N' -e '^create' | awk '{print $2}'" % vmchain
+        ipset_names = filter(None, util.pread2(['/bin/bash', '-c', setscmd]).split('\n'))
+        for ipset_name in ipset_names:
+            if not ipset_name:
+                continue
+            util.pread2(['ipset', '-F', ipset_name])
+            util.pread2(['ipset', '-X', ipset_name])
+    except:
+        logging.debug("Failed to destroy ipsets for %" % vm_name)
+
+    return 'true'
+
+@echo
+def destroy_ebtables_rules(vm_chain):
+    delcmd = "ebtables-save | grep '%s' | sed 's/-A/-D/'" % vm_chain
+    delcmds = util.pread2(['/bin/bash', '-c', delcmd]).split('\n')
+    for cmd in filter(None, delcmds):
+        try:
+            dc = 'ebtables ' + cmd
+            util.pread2(filter(None, dc.split(' ')))
+        except:
+            logging.debug("Ignoring failure to delete ebtables rules for vm " + vm_chain)
+    try:
+        util.pread2(['ebtables', '-F', vm_chain])
+        util.pread2(['ebtables', '-X', vm_chain])
+    except:
+        logging.debug("Ignoring failure to delete ebtables chain for vm " + vm_chain)
+
+@echo
+def destroy_arptables_rules(vm_chain):
+    delcmd = "arptables -vL FORWARD | grep '%s' | sed 's/-i any//' | sed 's/-o any//' | awk '{print $1,$2,$3,$4}' " % vm_chain
+    delcmds = util.pread2(['/bin/bash', '-c', delcmd]).split('\n')
+    for cmd in filter(None, delcmds):
+        try:
+            dc = 'arptables -D FORWARD ' + cmd
+            util.pread2(filter(None, dc.split(' ')))
+        except:
+            logging.debug("Ignoring failure to delete arptables rules for vm " + vm_chain)
+
+    try:
+        util.pread2(['arptables', '-F', vm_chain])
+        util.pread2(['arptables', '-X', vm_chain])
+    except:
+        logging.debug("Ignoring failure to delete arptables chain for vm " + vm_chain)
+
+@echo
+def default_ebtables_antispoof_rules(vm_chain, vifs, vm_ip, vm_mac):
+    if vm_mac == 'ff:ff:ff:ff:ff:ff':
+        logging.debug("Ignoring since mac address is not valid")
+        return 'true'
+
+    try:
+        util.pread2(['ebtables', '-N', vm_chain])
+    except:
+        try:
+            util.pread2(['ebtables', '-F', vm_chain])
+        except:
+            logging.debug("Failed to create ebtables antispoof chain, skipping")
+            return 'true'
+
+    # note all rules for packets into the bridge (-i) precede all output rules (-o)
+    # always start after the first rule in the FORWARD chain that jumps to DEFAULT_EBTABLES chain
+    try:
+        for vif in vifs:
+            util.pread2(['ebtables', '-I', 'FORWARD', '2', '-i',  vif,  '-j', vm_chain])
+            util.pread2(['ebtables', '-A', 'FORWARD', '-o',  vif, '-j', vm_chain])
+    except:
+        logging.debug("Failed to program default ebtables FORWARD rules for %s" % vm_chain)
+        return 'false'
+
+    try:
+        for vif in vifs:
+            # only allow source mac that belongs to the vm
+            try:
+                util.pread2(['ebtables', '-t', 'nat', '-I', 'PREROUTING', '-i', vif, '-s', '!' , vm_mac, '-j', 'DROP'])
+            except:
+                util.pread2(['ebtables', '-A', vm_chain, '-i', vif, '-s', '!', vm_mac,  '-j', 'DROP'])
+
+            # do not allow fake dhcp responses
+            util.pread2(['ebtables', '-A', vm_chain, '-i', vif, '-p', 'IPv4', '--ip-proto', 'udp', '--ip-dport', '68', '-j', 'DROP'])
+            # do not allow snooping of dhcp requests
+            util.pread2(['ebtables', '-A', vm_chain, '-o', vif, '-p', 'IPv4', '--ip-proto', 'udp', '--ip-dport', '67', '-j', 'DROP'])
+    except:
+        logging.debug("Failed to program default ebtables antispoof rules for %s" % vm_chain)
+        return 'false'
+
+    return 'true'
+
+@echo
+def default_arp_antispoof(vm_chain, vifs, vm_ip, vm_mac):
+    if vm_mac == 'ff:ff:ff:ff:ff:ff':
+        logging.debug("Ignoring since mac address is not valid")
+        return 'true'
+
+    try:
+        util.pread2(['arptables',  '-N', vm_chain])
+    except:
+        try:
+            util.pread2(['arptables', '-F', vm_chain])
+        except:
+            logging.debug("Failed to create arptables rule, skipping")
+            return 'true'
+
+    # note all rules for packets into the bridge (-i) precede all output rules (-o)
+    try:
+        for vif in vifs:
+            util.pread2(['arptables',  '-I', 'FORWARD', '-i',  vif, '-j', vm_chain])
+            util.pread2(['arptables',  '-A', 'FORWARD', '-o',  vif, '-j', vm_chain])
+    except:
+        logging.debug("Failed to program default arptables rules in FORWARD chain vm=" + vm_chain)
+        return 'false'
+
+    try:
+        for vif in vifs:
+            #accept arp replies into the bridge as long as the source mac and ips match the vm
+            util.pread2(['arptables',  '-A', vm_chain, '-i', vif, '--opcode', 'Reply', '--source-mac',  vm_mac, '--source-ip',  vm_ip, '-j', 'ACCEPT'])
+            #accept any arp requests from this vm. In the future this can be restricted to deny attacks on hosts
+            #also important to restrict source ip and src mac in these requests as they can be used to update arp tables on destination
+            util.pread2(['arptables',  '-A', vm_chain, '-i', vif, '--opcode', 'Request',  '--source-mac',  vm_mac, '--source-ip',  vm_ip, '-j', 'RETURN'])
+            #accept any arp requests to this vm as long as the request is for this vm's ip
+            util.pread2(['arptables',  '-A', vm_chain, '-o', vif, '--opcode', 'Request', '--destination-ip', vm_ip, '-j', 'ACCEPT'])
+            #accept any arp replies to this vm as long as the mac and ip matches
+            util.pread2(['arptables',  '-A', vm_chain, '-o', vif, '--opcode', 'Reply', '--destination-mac', vm_mac, '--destination-ip', vm_ip, '-j', 'ACCEPT'])
+        util.pread2(['arptables',  '-A', vm_chain,  '-j', 'DROP'])
+
+    except:
+        logging.debug("Failed to program default arptables  rules")
+        return 'false'
+
+    return 'true'
+
+
+@echo
+def network_rules_vmSecondaryIp(session, args):
+    vm_name = args.pop('vmName')
+    vm_mac = args.pop('vmMac')
+    ip_secondary = args.pop('vmSecIp')
+    action = args.pop('action')
+    logging.debug("vmMac = "+ vm_mac)
+    logging.debug("vmName = "+ vm_name)
+    #action = "-A"
+    logging.debug("action = "+ action)
+    try:
+        vm = session.xenapi.VM.get_by_name_label(vm_name)
+        if len(vm) != 1:
+            return 'false'
+        vm_rec = session.xenapi.VM.get_record(vm[0])
+        vm_vifs = vm_rec.get('VIFs')
+        vifnums = [session.xenapi.VIF.get_record(vif).get('device') for vif in vm_vifs]
+        domid = vm_rec.get('domid')
+    except:
+        logging.debug("### Failed to get domid or vif list for vm  ##" + vm_name)
+        return 'false'
+
+    if domid == '-1':
+        logging.debug("### Failed to get domid for vm (-1):  " + vm_name)
+        return 'false'
+
+    vifs = ["vif" + domid + "." + v for v in vifnums]
+    #vm_name =  '-'.join(vm_name.split('-')[:-1])
+    vmchain = chain_name(vm_name)
+    add_to_ipset(vmchain, [ip_secondary], action)
+
+    #add arptables rules for the secondary ip
+    arp_rules_vmip(vmchain, vifs, [ip_secondary], vm_mac, action)
+
+    return 'true'
+
+@echo
+def default_network_rules_systemvm(session, args):
+    try:
+        util.pread2(['/bin/bash', '-c', 'iptables -n -L FORWARD | grep BRIDGE-FIREWALL'])
+    except:
+        can_bridge_firewall(session, args)
+
+    vm_name = args.pop('vmName')
+    try:
+        vm = session.xenapi.VM.get_by_name_label(vm_name)
+        if len(vm) != 1:
+            return 'false'
+        vm_rec = session.xenapi.VM.get_record(vm[0])
+        vm_vifs = vm_rec.get('VIFs')
+        vifnums = [session.xenapi.VIF.get_record(vif).get('device') for vif in vm_vifs]
+        domid = vm_rec.get('domid')
+    except:
+        logging.debug("### Failed to get domid or vif list for vm  ##" + vm_name)
+        return 'false'
+
+    if domid == '-1':
+        logging.debug("### Failed to get domid for vm (-1):  " + vm_name)
+        return 'false'
+
+    vifs = ["vif" + domid + "." + v for v in vifnums]
+    #vm_name =  '-'.join(vm_name.split('-')[:-1])
+    vmchain = chain_name(vm_name)
+
+
+    delete_rules_for_vm_in_bridge_firewall_chain(vm_name)
+
+    try:
+        util.pread2(['iptables', '-N', vmchain])
+    except:
+        util.pread2(['iptables', '-F', vmchain])
+
+    for vif in vifs:
+        try:
+            util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', vif, '-j', vmchain])
+            util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '2', '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', vif, '-j', vmchain])
+            util.pread2(['iptables', '-I', vmchain, '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', vif, '-j', 'RETURN'])
+        except:
+            logging.debug("Failed to program default rules")
+            return 'false'
+
+    util.pread2(['iptables', '-A', vmchain, '-j', 'ACCEPT'])
+
+    if write_rule_log_for_vm(vm_name, '-1', '_ignore_', domid, '_initial_', '-1') == False:
+        logging.debug("Failed to log default network rules for systemvm, ignoring")
+    return 'true'
+
+@echo
+def create_ipset_forvm (ipsetname):
+    result = True
+    type = getIpsetType()
+    try:
+        logging.debug("Creating ipset chain .... " + ipsetname)
+        util.pread2(['ipset', '-F', ipsetname])
+        util.pread2(['ipset', '-X', ipsetname])
+        util.pread2(['ipset', '-N', ipsetname, type])
+    except:
+        logging.debug("ipset chain not exists creating.... " + ipsetname)
+        util.pread2(['ipset', '-N', ipsetname, type])
+
+    return result
+
+@echo
+def add_to_ipset(ipsetname, ips, action):
+    result = True
+    for ip in ips:
+        try:
+            logging.debug("vm ip " + ip)
+            util.pread2(['ipset', action, ipsetname, ip])
+        except:
+            logging.debug("vm ip already in ip set" + ip)
+            continue
+
+    return result
+
+@echo
+def arp_rules_vmip (vm_chain, vifs, ips, vm_mac, action):
+    try:
+        if action == "-A":
+            action = "-I"
+        for vif in vifs:
+            for vm_ip in ips:
+                #accept any arp requests to this vm as long as the request is for this vm's ip
+                util.pread2(['arptables',  action, vm_chain, '-o', vif, '--opcode', 'Request', '--destination-ip', vm_ip, '-j', 'ACCEPT'])
+                #accept any arp replies to this vm as long as the mac and ip matches
+                util.pread2(['arptables',  action, vm_chain, '-o', vif, '--opcode', 'Reply', '--destination-mac', vm_mac, '--destination-ip', vm_ip, '-j', 'ACCEPT'])
+                #accept arp replies into the bridge as long as the source mac and ips match the vm
+                util.pread2(['arptables',  action, vm_chain, '-i', vif, '--opcode', 'Reply', '--source-mac',  vm_mac, '--source-ip',  vm_ip, '-j', 'ACCEPT'])
+                #accept any arp requests from this vm. In the future this can be restricted to deny attacks on hosts
+                #also important to restrict source ip and src mac in these requests as they can be used to update arp tables on destination
+                util.pread2(['arptables',  action, vm_chain, '-i', vif, '--opcode', 'Request',  '--source-mac',  vm_mac, '--source-ip',  vm_ip, '-j', 'RETURN'])
+    except:
+        logging.debug("Failed to program arptables  rules for ip")
+        return 'false'
+
+    return 'true'
+
+
+@echo
+def default_network_rules(session, args):
+    vm_name = args.pop('vmName')
+    vm_ip = args.pop('vmIP')
+    vm_id = args.pop('vmID')
+    vm_mac = args.pop('vmMAC')
+    sec_ips = args.pop("secIps")
+    action = "-A"
+
+    try:
+        vm = session.xenapi.VM.get_by_name_label(vm_name)
+        if len(vm) != 1:
+            logging.debug("### Failed to get record for vm  " + vm_name)
+            return 'false'
+        vm_rec = session.xenapi.VM.get_record(vm[0])
+        domid = vm_rec.get('domid')
+    except:
+        logging.debug("### Failed to get domid for vm " + vm_name)
+        return 'false'
+    if domid == '-1':
+        logging.debug("### Failed to get domid for vm (-1):  " + vm_name)
+        return 'false'
+
+    vif = "vif" + domid + ".0"
+    tap = "tap" + domid + ".0"
+    vifs = [vif]
+    try:
+        util.pread2(['ifconfig', tap])
+        vifs.append(tap)
+    except:
+        pass
+
+    delete_rules_for_vm_in_bridge_firewall_chain(vm_name)
+
+
+    vmchain =  chain_name(vm_name)
+    vmchain_egress =  egress_chain_name(vm_name)
+    vmchain_default = chain_name_def(vm_name)
+
+    destroy_ebtables_rules(vmchain)
+
+    try:
+        util.pread2(['iptables', '-N', vmchain])
+    except:
+        util.pread2(['iptables', '-F', vmchain])
+
+    try:
+        util.pread2(['iptables', '-N', vmchain_egress])
+    except:
+        util.pread2(['iptables', '-F', vmchain_egress])
+
+    try:
+        util.pread2(['iptables', '-N', vmchain_default])
+    except:
+        util.pread2(['iptables', '-F', vmchain_default])
+
+    vmipset = vm_name
+    if len(vmipset) > 28:
+        vmipset = vmipset[0:27]
+    #create ipset and add vm ips to that ip set
+    if create_ipset_forvm(vmipset) == False:
+        logging.debug(" failed to create ipset for rule " + str(tokens))
+        return 'false'
+
+    #add primary nic ip to ipset
+    if add_to_ipset(vmipset, [vm_ip], action ) == False:
+        logging.debug(" failed to add vm " + vm_ip + " ip to set ")
+        return 'false'
+
+    #add secondary nic ips to ipset
+    secIpSet = "1"
+    ips = sec_ips.split(';')
+    ips.pop()
+    if ips[0] == "0":
+        secIpSet = "0";
+
+    if secIpSet == "1":
+        logging.debug("Adding ipset for secondary ips")
+        add_to_ipset(vmipset, ips, action)
+        if write_secip_log_for_vm(vm_name, sec_ips, vm_id) == False:
+            logging.debug("Failed to log default network rules, ignoring")
+
+    keyword = '--' + get_ipset_keyword()
+
+    try:
+        for v in vifs:
+            util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', v, '-j', vmchain_default])
+            util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '2', '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '-j', vmchain_default])
+
+        #don't let vm spoof its ip address
+        for v in vifs:
+            #util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '--source', vm_ip,'-p', 'udp', '--dport', '53', '-j', 'RETURN'])
+            util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '-m', 'set', keyword, vmipset, 'src', '-p', 'udp', '--dport', '53', '-j', 'RETURN'])
+            util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '-m', 'set', '!', keyword, vmipset, 'src', '-j', 'DROP'])
+            util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', v, '-m', 'set', '!', keyword, vmipset, 'dst', '-j', 'DROP'])
+            util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '-m', 'set', keyword, vmipset, 'src', '-j', vmchain_egress])
+            util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', v,  '-j', vmchain])
+    except:
+        logging.debug("Failed to program default rules for vm " + vm_name)
+        return 'false'
+
+    default_arp_antispoof(vmchain, vifs, vm_ip, vm_mac)
+    #add default arp rules for secondary ips;
+    if secIpSet == "1":
+        logging.debug("Adding arp rules for sec ip")
+        arp_rules_vmip(vmchain, vifs, ips, vm_mac, action)
+
+    default_ebtables_antispoof_rules(vmchain, vifs, vm_ip, vm_mac)
+
+    if write_rule_log_for_vm(vm_name, vm_id, vm_ip, domid, '_initial_', '-1', vm_mac) == False:
+        logging.debug("Failed to log default network rules, ignoring")
+
+    logging.debug("Programmed default rules for vm " + vm_name)
+    return 'true'
+
+@echo
+def check_domid_changed(session, vmName):
+    curr_domid = '-1'
+    try:
+        vm = session.xenapi.VM.get_by_name_label(vmName)
+        if len(vm) != 1:
+            logging.debug("### Could not get record for vm ## " + vmName)
+        else:
+            vm_rec = session.xenapi.VM.get_record(vm[0])
+            curr_domid = vm_rec.get('domid')
+    except:
+        logging.debug("### Failed to get domid for vm  ## " + vmName)
+
+
+    logfilename = "/var/run/cloud/" + vmName +".log"
+    if not os.path.exists(logfilename):
+        return ['-1', curr_domid]
+
+    lines = (line.rstrip() for line in open(logfilename))
+
+    [_vmName,_vmID,_vmIP,old_domid,_signature,_seqno, _vmMac] = ['_', '-1', '_', '-1', '_', '-1', 'ff:ff:ff:ff:ff:ff']
+    for line in lines:
+        try:
+            [_vmName,_vmID,_vmIP,old_domid,_signature,_seqno,_vmMac] = line.split(',')
+        except ValueError as v:
+            [_vmName,_vmID,_vmIP,old_domid,_signature,_seqno] = line.split(',')
+        break
+
+    return [curr_domid, old_domid]
+
+@echo
+def delete_rules_for_vm_in_bridge_firewall_chain(vmName):
+    vm_name = vmName
+    vmchain = chain_name_def(vm_name)
+
+    delcmd = "iptables-save | grep '\-A BRIDGE-FIREWALL' | grep '%s' | sed 's/-A/-D/'" % vmchain
+    delcmds = util.pread2(['/bin/bash', '-c', delcmd]).split('\n')
+    for cmd in filter(None, delcmds):
+        try:
+            dc = 'iptables ' + cmd
+            util.pread2(filter(None, dc.split(' ')))
+        except:
+            logging.debug("Ignoring failure to delete rules for vm " + vmName)
+
+@echo
+def network_rules_for_rebooted_vm(session, vmName):
+    vm_name = vmName
+    [curr_domid, old_domid] = check_domid_changed(session, vm_name)
+
+    if curr_domid == old_domid:
+        return True
+
+    if old_domid == '-1':
+        return True
+
+    if curr_domid == '-1':
+        return True
+
+    logging.debug("Found a rebooted VM -- reprogramming rules for  " + vm_name)
+
+    delete_rules_for_vm_in_bridge_firewall_chain(vm_name)
+    if 1 in [ vm_name.startswith(c) for c in ['r-', 's-', 'v-', 'l-'] ]:
+        default_network_rules_systemvm(session, {"vmName":vm_name})
+        return True
+
+    vif = "vif" + curr_domid + ".0"
+    tap = "tap" + curr_domid + ".0"
+    vifs = [vif]
+    try:
+        util.pread2(['ifconfig', tap])
+        vifs.append(tap)
+    except:
+        pass
+    vmchain = chain_name(vm_name)
+    vmchain_default = chain_name_def(vm_name)
+
+    for v in vifs:
+        util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', v, '-j', vmchain_default])
+        util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '2', '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '-j', vmchain_default])
+
+    #change antispoof rule in vmchain
+    try:
+        delcmd = "iptables-save | grep '\-A " +  vmchain_default + "' | grep  physdev-in | sed 's/!--set/! --set/' | sed 's/-A/-D/'"
+        delcmd2 = "iptables-save | grep '\-A " +  vmchain_default + "' | grep  physdev-out | sed 's/!--set/! --set/'| sed 's/-A/-D/'"
+        inscmd = "iptables-save | grep '\-A " +  vmchain_default + "' | grep  physdev-in | grep vif | sed -r 's/vif[0-9]+.0/" + vif + "/' | sed 's/!--set/! --set/'"
+        inscmd2 = "iptables-save| grep '\-A " +  vmchain_default + "' | grep  physdev-in | grep tap | sed -r 's/tap[0-9]+.0/" + tap + "/' | sed 's/!--set/! --set/'"
+        inscmd3 = "iptables-save | grep '\-A " +  vmchain_default + "' | grep  physdev-out | grep vif | sed -r 's/vif[0-9]+.0/" + vif + "/' | sed 's/!--set/! --set/'"
+        inscmd4 = "iptables-save| grep '\-A " +  vmchain_default + "' | grep  physdev-out | grep tap | sed -r 's/tap[0-9]+.0/" + tap + "/'  | sed 's/!--set/! --set/'"
+
+        ipts = []
+        for cmd in [delcmd, delcmd2, inscmd, inscmd2, inscmd3, inscmd4]:
+            cmds = util.pread2(['/bin/bash', '-c', cmd]).split('\n')
+            cmds.pop()
+            for c in filter(None,cmds):
+                ipt = c.split(' ')
+                ipt.insert(0, 'iptables')
+                ipts.append(ipt)
+
+        for ipt in ipts:
+            try:
+                util.pread2(filter(None,ipt))
+            except:
+                logging.debug("Failed to rewrite antispoofing rules for vm " + vm_name)
+    except:
+        logging.debug("No rules found for vm " + vm_name)
+
+    destroy_ebtables_rules(vmchain)
+    destroy_arptables_rules(vmchain)
+    [vm_ip, vm_mac] = get_vm_mac_ip_from_log(vmchain)
+    default_arp_antispoof(vmchain, vifs, vm_ip, vm_mac)
+
+    #check whether the vm has secondary ips
+    if is_secondary_ips_set(vm_name) == True:
+        vmips = get_vm_sec_ips(vm_name)
+        #add arp rules for the secondaryp ip
+        for ip in vmips:
+            arp_rules_vmip(vmchain, vifs, [ip], vm_mac, "-A")
+
+
+    default_ebtables_antispoof_rules(vmchain, vifs, vm_ip, vm_mac)
+    rewrite_rule_log_for_vm(vm_name, curr_domid)
+    return True
+
+
+
+@echo
+def get_vm_sec_ips(vm_name):
+    logfilename = "/var/run/cloud/" + vm_name +".ip"
+
+    lines = (line.rstrip() for line in open(logfilename))
+    for line in lines:
+        try:
+            [_vmName,_vmIP,_vmID] = line.split(',')
+            break
+        except ValueError as v:
+            [_vmName,_vmIP,_vmID] = line.split(',')
+
+    _vmIPS = _vmIP.split(":")[:-1]
+    return _vmIPS
+
+@echo
+def is_secondary_ips_set(vm_name):
+    logfilename = "/var/run/cloud/" + vm_name +".ip"
+    if not os.path.exists(logfilename):
+        return False
+
+    return True
+
+@echo
+def rewrite_rule_log_for_vm(vm_name, new_domid):
+    logfilename = "/var/run/cloud/" + vm_name +".log"
+    if not os.path.exists(logfilename):
+        return
+    lines = (line.rstrip() for line in open(logfilename))
+
+    [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = ['_', '-1', '_', '-1', '_', '-1','ff:ff:ff:ff:ff:ff']
+    for line in lines:
+        try:
+            [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = line.split(',')
+            break
+        except ValueError as v:
+            [_vmName,_vmID,_vmIP,_domID,_signature,_seqno] = line.split(',')
+
+    write_rule_log_for_vm(_vmName, _vmID, _vmIP, new_domid, _signature, '-1', _vmMac)
+
+def get_rule_log_for_vm(session, vmName):
+    vm_name = vmName;
+    logfilename = "/var/run/cloud/" + vm_name +".log"
+    if not os.path.exists(logfilename):
+        return ''
+
+    lines = (line.rstrip() for line in open(logfilename))
+
+    [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = ['_', '-1', '_', '-1', '_', '-1', 'ff:ff:ff:ff:ff:ff']
+    for line in lines:
+        try:
+            [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = line.split(',')
+            break
+        except ValueError as v:
+            [_vmName,_vmID,_vmIP,_domID,_signature,_seqno] = line.split(',')
+
+    return ','.join([_vmName, _vmID, _vmIP, _domID, _signature, _seqno])
+
+@echo
+def get_vm_mac_ip_from_log(vm_name):
+    [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = ['_', '-1', '0.0.0.0', '-1', '_', '-1','ff:ff:ff:ff:ff:ff']
+    logfilename = "/var/run/cloud/" + vm_name +".log"
+    if not os.path.exists(logfilename):
+        return ['_', '_']
+
+    lines = (line.rstrip() for line in open(logfilename))
+    for line in lines:
+        try:
+            [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = line.split(',')
+            break
+        except ValueError as v:
+            [_vmName,_vmID,_vmIP,_domID,_signature,_seqno] = line.split(',')
+
+    return [ _vmIP, _vmMac]
+
+@echo
+def get_rule_logs_for_vms(session, args):
+    host_uuid = args.pop('host_uuid')
+    try:
+        thishost = session.xenapi.host.get_by_uuid(host_uuid)
+        hostrec = session.xenapi.host.get_record(thishost)
+        vms = hostrec.get('resident_VMs')
+    except:
+        logging.debug("Failed to get host from uuid " + host_uuid)
+        return ' '
+
+    result = []
+    try:
+        for name in [session.xenapi.VM.get_name_label(x) for x in vms]:
+            if 1 not in [ name.startswith(c) for c in ['r-', 's-', 'v-', 'i-', 'l-'] ]:
+                continue
+            network_rules_for_rebooted_vm(session, name)
+            if name.startswith('i-'):
+                log = get_rule_log_for_vm(session, name)
+                result.append(log)
+    except:
+        logging.debug("Failed to get rule logs, better luck next time!")
+
+    return ";".join(result)
+
+@echo
+def cleanup_rules_for_dead_vms(session):
+    try:
+        vms = session.xenapi.VM.get_all()
+        cleaned = 0
+        for vm_name in [session.xenapi.VM.get_name_label(x) for x in vms]:
+            if 1 in [ vm_name.startswith(c) for c in ['r-', 'i-', 's-', 'v-', 'l-'] ]:
+                vm = session.xenapi.VM.get_by_name_label(vm_name)
+                if len(vm) != 1:
+                    continue
+                vm_rec = session.xenapi.VM.get_record(vm[0])
+                state = vm_rec.get('power_state')
+                if state != 'Running' and state != 'Paused':
+                    logging.debug("vm " + vm_name + " is not running, cleaning up")
+                    destroy_network_rules_for_vm(session, {'vmName':vm_name})
+                    cleaned = cleaned+1
+
+        logging.debug("Cleaned up rules for " + str(cleaned) + " vms")
+    except:
+        logging.debug("Failed to cleanup rules for dead vms!")
+
+
+@echo
+def cleanup_rules(session, args):
+    instance = args.get('instance')
+    if not instance:
+        instance = 'VM'
+    resident_vms = []
+    try:
+        hostname = util.pread2(['/bin/bash', '-c', 'hostname']).split('\n')
+        if len(hostname) < 1:
+            raise Exception('Could not find hostname of this host')
+        thishost = session.xenapi.host.get_by_name_label(hostname[0])
+        if len(thishost) < 1:
+            raise Exception("Could not find host record from hostname %s of this host"%hostname[0])
+        hostrec = session.xenapi.host.get_record(thishost[0])
+        vms = hostrec.get('resident_VMs')
+        resident_vms = [session.xenapi.VM.get_name_label(x) for x in vms]
+        util.SMlog('cleanup_rules: resident_vms= %s' %resident_vms)
+        util.SMlog('cleanup_rules: found %s resident vms on this host %s' % (len(resident_vms)-1, hostname[0]))
+
+        chainscmd = "iptables-save | grep '^:' | awk '{print $1}' | cut -d':' -f2 | sed 's/-def//'| sed 's/-eg//' | sort|uniq"
+        chains = util.pread2(['/bin/bash', '-c', chainscmd]).split('\n')
+        vmchains = [ch  for ch in chains if 1 in [ ch.startswith(c) for c in ['r-', 'i-', 's-', 'v-', 'l-']]]
+        util.SMlog('cleanup_rules: vmchains= %s' %vmchains)
+        util.SMlog('cleanup_rules: found %s iptables chains for vms on this host %s' % (len(vmchains), hostname[0]))
+        cleaned = 0
+        cleanup = []
+        for chain in vmchains:
+            vmname = chain
+            vmpresent = False
+            #looping intentionally because if vmaname in resident_vms is not greedy.
+            #after trimming the vm names which more than 29 chars, resident vm name and iptables chain name is substring of
+            #of resident vm.
+            for rvm in resident_vms:
+                if vmname  in rvm:
+                    vmpresent = True
+                    break
+
+            if vmpresent is False:
+                vmname = chain + "-untagged"
+                for rvm in resident_vms:
+                    if vmname  in rvm:

Review Comment:
   ```suggestion
                       if vmname in rvm:
   ```



##########
scripts/vm/hypervisor/xenserver/xenserver84/vmops:
##########
@@ -0,0 +1,1607 @@
+#!/usr/bin/python
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Version @VERSION@
+#
+# A plugin for executing script needed by vmops cloud
+
+import os, sys, time
+import XenAPIPlugin
+if os.path.exists("/opt/xensource/sm"):
+    sys.path.extend(["/opt/xensource/sm/", "/usr/local/sbin/", "/sbin/"])
+if os.path.exists("/usr/lib/xcp/sm"):
+    sys.path.extend(["/usr/lib/xcp/sm/", "/usr/local/sbin/", "/sbin/"])
+import base64
+import socket
+import stat
+import tempfile
+import util
+import subprocess
+import zlib
+import cloudstack_pluginlib as lib
+import logging
+from util import CommandException
+
+lib.setup_logging("/var/log/cloud/cloud.log")
+
+def echo(fn):
+    def wrapped(*v, **k):
+        name = fn.__name__
+        #command string is logged in SMlog, so method enter/exit logging into SMlog will help for debugging
+        util.SMlog("#### CLOUD enter  %s ####" % name )
+        res = fn(*v, **k)
+        util.SMlog("#### CLOUD exit  %s ####" % name )
+        return res
+    return wrapped
+
+@echo
+def add_to_VCPUs_params_live(session, args):
+    key = args['key']
+    value = args['value']
+    vmname = args['vmname']
+    try:
+        cmd = ["bash", "/opt/cloud/bin/add_to_vcpus_params_live.sh", vmname, key, value]
+        txt = util.pread2(cmd)
+    except:
+        return 'false'
+    return 'true'
+
+@echo
+def setup_iscsi(session, args):
+    uuid=args['uuid']
+    try:
+        cmd = ["bash", "/opt/cloud/bin/setup_iscsi.sh", uuid]
+        txt = util.pread2(cmd)
+    except:
+        txt = ''
+    return txt
+
+
+@echo
+def preparemigration(session, args):
+    uuid = args['uuid']
+    try:
+        cmd = ["/opt/cloud/bin/make_migratable.sh", uuid]
+        util.pread2(cmd)
+        txt = 'success'
+    except:
+        logging.debug("Catch prepare migration exception" )
+        txt = ''
+
+    return txt
+
+@echo
+def setIptables(session, args):
+    try:
+        cmd = ["/bin/bash", "/opt/cloud/bin/setupxenserver.sh"]
+        txt = util.pread2(cmd)
+        txt = 'success'
+    except:
+        logging.debug("  setIptables execution failed "  )
+        txt = ''
+
+    return txt
+
+@echo
+def pingdomr(session, args):
+    host = args['host']
+    port = args['port']
+    socket.setdefaulttimeout(3)
+    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+    try:
+        s.connect((host,int(port)))
+        txt = 'success'
+    except:
+        txt = ''
+
+    s.close()
+
+    return txt
+
+@echo
+def kill_copy_process(session, args):
+    namelabel = args['namelabel']
+    try:
+        cmd = ["bash", "/opt/cloud/bin/kill_copy_process.sh", namelabel]
+        txt = util.pread2(cmd)
+    except:
+        txt = 'false'
+    return txt
+
+@echo
+def pingxenserver(session, args):
+    txt = 'success'
+    return txt
+
+def pingtest(session, args):
+    sargs = args['args']
+    cmd = sargs.split(' ')
+    cmd.insert(0, "/opt/cloud/bin/pingtest.sh")
+    cmd.insert(0, "/bin/bash")
+    try:
+        txt = util.pread2(cmd)
+        txt = 'success'
+    except:
+        logging.debug("  pingtest failed "  )
+        txt = ''
+
+    return txt
+
+@echo
+def setLinkLocalIP(session, args):
+    brName = args['brName']
+    try:
+        cmd = ["ip", "route", "del", "169.254.0.0/16"]
+        txt = util.pread2(cmd)
+    except:
+        txt = ''
+    try:
+        cmd = ["ifconfig", brName, "169.254.0.1", "netmask", "255.255.0.0"]
+        txt = util.pread2(cmd)
+    except:
+        try:
+            cmd = ['cat', '/etc/xensource/network.conf']
+            result = util.pread2(cmd)
+        except:
+            return 'can not cat network.conf'
+
+        if result.lower().strip() == "bridge":
+            try:
+                cmd = ["brctl", "addbr", brName]
+                txt = util.pread2(cmd)
+            except:
+                pass
+
+        else:
+            try:
+                cmd = ["ovs-vsctl", "add-br", brName]
+                txt = util.pread2(cmd)
+            except:
+                pass
+
+        try:
+            cmd = ["ifconfig", brName, "169.254.0.1", "netmask", "255.255.0.0"]
+            txt = util.pread2(cmd)
+        except:
+            pass
+    try:
+        cmd = ["ip", "route", "add", "169.254.0.0/16", "dev", brName, "src", "169.254.0.1"]
+        txt = util.pread2(cmd)
+    except:
+        txt = ''
+    txt = 'success'
+    return txt
+
+@echo
+def createFile(session, args):
+    file_path = args['filepath']
+    file_contents = args['filecontents']
+
+    try:
+        f = open(file_path, "w")
+        f.write(file_contents)
+        f.close()
+        txt = 'success'
+    except:
+        logging.debug(" failed to create HA proxy cfg file ")
+        txt = ''
+
+    return txt
+
+@echo
+def secureCopyToHost(session, args):
+    host_filepath = args['hostfilepath']
+    src_ip = args['srcip']
+    src_filepath = args['srcfilepath']
+    src_target = "root@" + src_ip + ":" + src_filepath
+    # Make any directories as needed
+    if not os.path.isdir(host_filepath):
+        try:
+            os.makedirs(host_filepath)
+        except OSError as e:
+            if not os.path.isdir(host_filepath):
+                errMsg = "OSError while creating " + host_filepath + " with errno: " + str(e.errno) + " and strerr: " + e.strerror
+                logging.debug(errMsg)
+                return "fail# Cannot create the directory to copy file to " + host_filepath
+
+    # Copy file to created directory
+    txt=""
+    try:
+        txt = util.pread2(['scp','-P','3922','-q','-o','StrictHostKeyChecking=no','-i','/root/.ssh/id_rsa.cloud', src_target, host_filepath])
+        util.pread2(['chmod', 'a+r', os.path.join(host_filepath, os.path.basename(src_filepath))])
+        txt = 'success#' + txt
+    except:
+        logging.error("failed to scp source target " + src_target + " to host at file path " + host_filepath)
+        txt = 'fail#' + txt
+    return txt
+
+@echo
+def createFileInDomr(session, args):
+    src_filepath = args['srcfilepath']
+    dst_path = args['dstfilepath']
+    domrip = args['domrip']
+    cleanup = 'true' if 'cleanup' not in args else args['cleanup']
+    txt=""
+    try:
+        target = "root@" + domrip + ":" + dst_path
+        txt = util.pread2(['scp','-P','3922','-q','-o','StrictHostKeyChecking=no','-i','/root/.ssh/id_rsa.cloud',src_filepath, target])
+        if cleanup == 'true' or not cleanup:
+            util.pread2(['rm',src_filepath])
+        txt = 'succ#' + txt
+    except:
+        logging.debug("failed to copy file " + src_filepath + " from host to VR with ip " + domrip)
+        txt = 'fail#' + txt
+    return txt
+
+@echo
+def runPatchScriptInDomr(session, args):
+    domrip = args['domrip']
+    txt=""
+    try:
+        target = "root@" + domrip
+        txt = util.pread2(['ssh','-p','3922','-i','/root/.ssh/id_rsa.cloud', target, "/bin/bash","/var/cache/cloud/patch-sysvms.sh"])
+        txt = 'succ#' + txt
+    except:
+        logging.debug("failed to run patch script in systemVM with IP:  " + domrip)
+        txt = 'fail#' + txt
+    return txt
+
+@echo
+def deleteFile(session, args):
+    file_path = args["filepath"]
+
+    try:
+        if os.path.isfile(file_path):
+            os.remove(file_path)
+        txt = 'success'
+    except:
+        logging.debug(" failed to remove HA proxy cfg file ")
+        txt = ''
+
+    return txt
+
+#using all the iptables chain names length to 24 because cleanup_rules groups the vm chain excluding -def,-eg
+#to avoid multiple iptables chains for single vm, there using length 24
+def chain_name(vm_name):
+    if vm_name.startswith('i-') or vm_name.startswith('r-'):
+        if vm_name.endswith('untagged'):
+            return '-'.join(vm_name.split('-')[:-1])
+    if len(vm_name) > 25:
+        vm_name = vm_name[0:24]
+    return vm_name
+
+def chain_name_def(vm_name):
+    #iptables chain length max is 29 chars
+    if len(vm_name) > 25:
+        vm_name = vm_name[0:24]
+
+    if vm_name.startswith('i-'):
+        if vm_name.endswith('untagged'):
+            return '-'.join(vm_name.split('-')[:-1]) + "-def"
+        return vm_name + "-def"
+
+    if len(vm_name) > 28:
+        vm_name = vm_name[0:27]
+    return vm_name
+
+def egress_chain_name(vm_name):
+    #iptables chain length max is 29 chars
+    name = chain_name(vm_name)
+    name = name+"-eg"
+    return name
+
+#chain name length is 14 because it has protocol and ports appends
+def chain_name_ipset(vm_name):
+    if vm_name.startswith('i-') or vm_name.startswith('r-'):
+        if vm_name.endswith('untagged'):
+            return ''.join(vm_name.split('')[:-1])
+        if len(vm_name) > 14:
+            vm_name = vm_name[0:13]
+    return vm_name
+
+def egress_chain_name_ipset(vm_name):
+    name = chain_name_ipset(vm_name) + "-e"
+    return name
+
+def ingress_chain_name_ipset(vm_name):
+    name = chain_name_ipset(vm_name)
+    return name
+
+@echo
+def can_bridge_firewall(session, args):
+    try:
+        util.pread2(['ebtables', '-V'])
+        util.pread2(['ipset', '-V'])
+        cmd = ['cat', '/etc/xensource/network.conf']
+        result = util.pread2(cmd)
+        if result.lower().strip() != "bridge":
+            return 'false'
+
+    except:
+        return 'false'
+
+    try:
+        util.pread2(['iptables', '-N', 'BRIDGE-FIREWALL'])
+        util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '-m', 'state', '--state', 'RELATED,ESTABLISHED', '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged',  '-p', 'udp', '--dport', '67', '--sport', '68',  '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged',  '-p', 'udp', '--dport', '68', '--sport', '67',  '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-D', 'FORWARD',  '-j', 'RH-Firewall-1-INPUT'])
+    except:
+        logging.debug('Chain BRIDGE-FIREWALL already exists')
+
+    try:
+        util.pread2(['iptables', '-N', 'BRIDGE-DEFAULT-FIREWALL'])
+        util.pread2(['iptables', '-A', 'BRIDGE-DEFAULT-FIREWALL', '-m', 'state', '--state', 'RELATED,ESTABLISHED', '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-A', 'BRIDGE-DEFAULT-FIREWALL', '-m', 'physdev', '--physdev-is-bridged',  '-p', 'udp', '--dport', '67', '--sport', '68',  '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-A', 'BRIDGE-DEFAULT-FIREWALL', '-m', 'physdev', '--physdev-is-bridged',  '-p', 'udp', '--dport', '68', '--sport', '67',  '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '-j', 'BRIDGE-DEFAULT-FIREWALL'])
+        util.pread2(['iptables', '-D', 'BRIDGE-FIREWALL', '-m', 'state', '--state', 'RELATED,ESTABLISHED', '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-D', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged',  '-p', 'udp', '--dport', '67', '--sport', '68',  '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-D', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged',  '-p', 'udp', '--dport', '68', '--sport', '67',  '-j', 'ACCEPT'])
+    except:
+        logging.debug('Chain BRIDGE-DEFAULT-FIREWALL already exists')
+
+    result = 'true'
+    try:
+        util.pread2(['/bin/bash', '-c', 'iptables -n -L FORWARD | grep BRIDGE-FIREWALL'])
+    except:
+        try:
+            util.pread2(['iptables', '-I', 'FORWARD', '-m', 'physdev', '--physdev-is-bridged', '-j', 'BRIDGE-FIREWALL'])
+            util.pread2(['iptables', '-A', 'FORWARD', '-j', 'DROP'])
+        except:
+            return 'false'
+    default_ebtables_rules()
+    allow_egress_traffic(session)
+    if not os.path.exists('/var/run/cloud'):
+        os.makedirs('/var/run/cloud')
+    if not os.path.exists('/var/cache/cloud'):
+        os.makedirs('/var/cache/cloud')
+    #get_ipset_keyword()
+
+    cleanup_rules_for_dead_vms(session)
+    cleanup_rules(session, args)
+
+    return result
+
+@echo
+def default_ebtables_rules():
+    try:
+        util.pread2(['ebtables', '-N',  'DEFAULT_EBTABLES'])
+        util.pread2(['ebtables', '-A', 'FORWARD', '-j'  'DEFAULT_EBTABLES'])
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '--ip-dst', '255.255.255.255', '--ip-proto', 'udp', '--ip-dport', '67', '-j', 'ACCEPT'])
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '--ip-dst', '255.255.255.255', '--ip-proto', 'udp', '--ip-dport', '68', '-j', 'ACCEPT'])
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'ARP', '--arp-op', 'Request', '-j', 'ACCEPT'])
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'ARP', '--arp-op', 'Reply', '-j', 'ACCEPT'])
+        # deny mac broadcast and multicast
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '-d', 'Broadcast', '-j', 'DROP'])
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '-d', 'Multicast', '-j', 'DROP'])
+        # deny ip broadcast and multicast
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '--ip-dst', '255.255.255.255', '-j', 'DROP'])
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '--ip-dst', '224.0.0.0/4', '-j', 'DROP'])
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '-j', 'RETURN'])
+        # deny ipv6
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv6', '-j', 'DROP'])
+        # deny vlan
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', '802_1Q', '-j', 'DROP'])
+        # deny all others (e.g., 802.1d, CDP)
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES',  '-j', 'DROP'])
+    except:
+        logging.debug('Chain DEFAULT_EBTABLES already exists')
+
+
+@echo
+def allow_egress_traffic(session):
+    devs = []
+    for pif in session.xenapi.PIF.get_all():
+        pif_rec = session.xenapi.PIF.get_record(pif)
+        dev = pif_rec.get('device')
+        devs.append(dev + "+")
+    for d in devs:
+        try:
+            util.pread2(['/bin/bash', '-c', "iptables -n -L FORWARD | grep '%s '" % d])
+        except:
+            try:
+                util.pread2(['iptables', '-I', 'FORWARD', '2', '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', d, '-j', 'ACCEPT'])
+            except:
+                logging.debug("Failed to add FORWARD rule through to %s" % d)
+                return 'false'
+    return 'true'
+
+def getIpsetType():
+    try:
+        out = util.pread2(['/bin/bash', '-c', "ipset -v | awk '{print $5}'"])
+        out.replace(".","")
+        if int(out) < 6:
+            return 'iptreemap'
+        else:
+            return 'nethash'
+    except:
+        return 'iptreemap'
+
+def ipset(ipsetname, proto, start, end, cidrs):
+    type = getIpsetType()
+    try:
+        util.pread2(['ipset', '-N', ipsetname, type])
+    except:
+        logging.debug("ipset chain already exists: " + ipsetname)
+
+    result = True
+    ipsettmp = ''.join(''.join(ipsetname.split('-')).split('_')) + str(int(time.time()) % 1000)
+
+    try:
+        util.pread2(['ipset', '-N', ipsettmp, type])
+    except:
+        logging.debug("Failed to create temp ipset, reusing old name= " + ipsettmp)
+        try:
+            util.pread2(['ipset', '-F', ipsettmp])
+        except:
+            logging.debug("Failed to clear old temp ipset name=" + ipsettmp)
+            return False
+    try:
+        for cidr in cidrs:
+            try:
+                util.pread2(['ipset', '-A', ipsettmp, cidr])
+            except CommandException as cex:
+                logging.debug("ipset cidr add failed due to: " + str(cex.reason))
+                if cex.reason.rfind('already in set') == -1:
+                    raise
+    except:
+        logging.debug("Failed to program ipset " + ipsetname)
+        util.pread2(['ipset', '-F', ipsettmp])
+        util.pread2(['ipset', '-X', ipsettmp])
+        return False
+
+    try:
+        util.pread2(['ipset', '-W', ipsettmp, ipsetname])
+    except:
+        logging.debug("Failed to swap ipset, trying to delete and swap ipset: " + ipsetname)
+        # the old ipset entry could be of iphash type, try to delete and recreate
+        try:
+            util.pread2(['ipset', '-X', ipsetname])
+            util.pread2(['ipset', '-N', ipsetname, type])
+            util.pread2(['ipset', '-W', ipsettmp, ipsetname])
+        except:
+            logging.debug("Failed to swap ipset " + ipsetname)
+            result = False
+        logging.debug("Succeeded in re-initializing and swapping ipset")
+
+    try:
+        util.pread2(['ipset', '-F', ipsettmp])
+        util.pread2(['ipset', '-X', ipsettmp])
+    except:
+        # if the temporary name clashes next time we'll just reuse it
+        logging.debug("Failed to delete temp ipset " + ipsettmp)
+
+    return result
+
+@echo
+def destroy_network_rules_for_vm(session, args):
+    vm_name = args.pop('vmName')
+    vmchain = chain_name(vm_name)
+    vmchain_egress = egress_chain_name(vm_name)
+    vmchain_default = chain_name_def(vm_name)
+
+    delete_rules_for_vm_in_bridge_firewall_chain(vm_name)
+    if vm_name.startswith('i-') or vm_name.startswith('r-') or vm_name.startswith('l-'):
+        try:
+            util.pread2(['iptables', '-F', vmchain_default])
+            util.pread2(['iptables', '-X', vmchain_default])
+        except:
+            logging.debug("Ignoring failure to delete chain " + vmchain_default)
+
+    destroy_ebtables_rules(vmchain)
+    destroy_arptables_rules(vmchain)
+
+    try:
+        util.pread2(['iptables', '-F', vmchain])
+        util.pread2(['iptables', '-X', vmchain])
+    except:
+        logging.debug("Ignoring failure to delete ingress chain " + vmchain)
+
+
+    try:
+        util.pread2(['iptables', '-F', vmchain_egress])
+        util.pread2(['iptables', '-X', vmchain_egress])
+    except:
+        logging.debug("Ignoring failure to delete egress chain " + vmchain_egress)
+
+    remove_rule_log_for_vm(vm_name)
+    remove_secip_log_for_vm(vm_name)
+
+    if 1 in [ vm_name.startswith(c) for c in ['r-', 's-', 'v-', 'l-'] ]:
+        return 'true'
+
+    try:
+        setscmd = "ipset --save | grep '%s' | grep -e '^-N' -e '^create' | awk '{print $2}'" % vmchain
+        ipset_names = filter(None, util.pread2(['/bin/bash', '-c', setscmd]).split('\n'))
+        for ipset_name in ipset_names:
+            if not ipset_name:
+                continue
+            util.pread2(['ipset', '-F', ipset_name])
+            util.pread2(['ipset', '-X', ipset_name])
+    except:
+        logging.debug("Failed to destroy ipsets for %" % vm_name)
+
+    return 'true'
+
+@echo
+def destroy_ebtables_rules(vm_chain):
+    delcmd = "ebtables-save | grep '%s' | sed 's/-A/-D/'" % vm_chain
+    delcmds = util.pread2(['/bin/bash', '-c', delcmd]).split('\n')
+    for cmd in filter(None, delcmds):
+        try:
+            dc = 'ebtables ' + cmd
+            util.pread2(filter(None, dc.split(' ')))
+        except:
+            logging.debug("Ignoring failure to delete ebtables rules for vm " + vm_chain)
+    try:
+        util.pread2(['ebtables', '-F', vm_chain])
+        util.pread2(['ebtables', '-X', vm_chain])
+    except:
+        logging.debug("Ignoring failure to delete ebtables chain for vm " + vm_chain)
+
+@echo
+def destroy_arptables_rules(vm_chain):
+    delcmd = "arptables -vL FORWARD | grep '%s' | sed 's/-i any//' | sed 's/-o any//' | awk '{print $1,$2,$3,$4}' " % vm_chain
+    delcmds = util.pread2(['/bin/bash', '-c', delcmd]).split('\n')
+    for cmd in filter(None, delcmds):
+        try:
+            dc = 'arptables -D FORWARD ' + cmd
+            util.pread2(filter(None, dc.split(' ')))
+        except:
+            logging.debug("Ignoring failure to delete arptables rules for vm " + vm_chain)
+
+    try:
+        util.pread2(['arptables', '-F', vm_chain])
+        util.pread2(['arptables', '-X', vm_chain])
+    except:
+        logging.debug("Ignoring failure to delete arptables chain for vm " + vm_chain)
+
+@echo
+def default_ebtables_antispoof_rules(vm_chain, vifs, vm_ip, vm_mac):
+    if vm_mac == 'ff:ff:ff:ff:ff:ff':
+        logging.debug("Ignoring since mac address is not valid")
+        return 'true'
+
+    try:
+        util.pread2(['ebtables', '-N', vm_chain])
+    except:
+        try:
+            util.pread2(['ebtables', '-F', vm_chain])
+        except:
+            logging.debug("Failed to create ebtables antispoof chain, skipping")
+            return 'true'
+
+    # note all rules for packets into the bridge (-i) precede all output rules (-o)
+    # always start after the first rule in the FORWARD chain that jumps to DEFAULT_EBTABLES chain
+    try:
+        for vif in vifs:
+            util.pread2(['ebtables', '-I', 'FORWARD', '2', '-i',  vif,  '-j', vm_chain])
+            util.pread2(['ebtables', '-A', 'FORWARD', '-o',  vif, '-j', vm_chain])
+    except:
+        logging.debug("Failed to program default ebtables FORWARD rules for %s" % vm_chain)
+        return 'false'
+
+    try:
+        for vif in vifs:
+            # only allow source mac that belongs to the vm
+            try:
+                util.pread2(['ebtables', '-t', 'nat', '-I', 'PREROUTING', '-i', vif, '-s', '!' , vm_mac, '-j', 'DROP'])
+            except:
+                util.pread2(['ebtables', '-A', vm_chain, '-i', vif, '-s', '!', vm_mac,  '-j', 'DROP'])
+
+            # do not allow fake dhcp responses
+            util.pread2(['ebtables', '-A', vm_chain, '-i', vif, '-p', 'IPv4', '--ip-proto', 'udp', '--ip-dport', '68', '-j', 'DROP'])
+            # do not allow snooping of dhcp requests
+            util.pread2(['ebtables', '-A', vm_chain, '-o', vif, '-p', 'IPv4', '--ip-proto', 'udp', '--ip-dport', '67', '-j', 'DROP'])
+    except:
+        logging.debug("Failed to program default ebtables antispoof rules for %s" % vm_chain)
+        return 'false'
+
+    return 'true'
+
+@echo
+def default_arp_antispoof(vm_chain, vifs, vm_ip, vm_mac):
+    if vm_mac == 'ff:ff:ff:ff:ff:ff':
+        logging.debug("Ignoring since mac address is not valid")
+        return 'true'
+
+    try:
+        util.pread2(['arptables',  '-N', vm_chain])
+    except:
+        try:
+            util.pread2(['arptables', '-F', vm_chain])
+        except:
+            logging.debug("Failed to create arptables rule, skipping")
+            return 'true'
+
+    # note all rules for packets into the bridge (-i) precede all output rules (-o)
+    try:
+        for vif in vifs:
+            util.pread2(['arptables',  '-I', 'FORWARD', '-i',  vif, '-j', vm_chain])
+            util.pread2(['arptables',  '-A', 'FORWARD', '-o',  vif, '-j', vm_chain])
+    except:
+        logging.debug("Failed to program default arptables rules in FORWARD chain vm=" + vm_chain)
+        return 'false'
+
+    try:
+        for vif in vifs:
+            #accept arp replies into the bridge as long as the source mac and ips match the vm
+            util.pread2(['arptables',  '-A', vm_chain, '-i', vif, '--opcode', 'Reply', '--source-mac',  vm_mac, '--source-ip',  vm_ip, '-j', 'ACCEPT'])
+            #accept any arp requests from this vm. In the future this can be restricted to deny attacks on hosts
+            #also important to restrict source ip and src mac in these requests as they can be used to update arp tables on destination
+            util.pread2(['arptables',  '-A', vm_chain, '-i', vif, '--opcode', 'Request',  '--source-mac',  vm_mac, '--source-ip',  vm_ip, '-j', 'RETURN'])
+            #accept any arp requests to this vm as long as the request is for this vm's ip
+            util.pread2(['arptables',  '-A', vm_chain, '-o', vif, '--opcode', 'Request', '--destination-ip', vm_ip, '-j', 'ACCEPT'])
+            #accept any arp replies to this vm as long as the mac and ip matches
+            util.pread2(['arptables',  '-A', vm_chain, '-o', vif, '--opcode', 'Reply', '--destination-mac', vm_mac, '--destination-ip', vm_ip, '-j', 'ACCEPT'])
+        util.pread2(['arptables',  '-A', vm_chain,  '-j', 'DROP'])
+
+    except:
+        logging.debug("Failed to program default arptables  rules")
+        return 'false'
+
+    return 'true'
+
+
+@echo
+def network_rules_vmSecondaryIp(session, args):
+    vm_name = args.pop('vmName')
+    vm_mac = args.pop('vmMac')
+    ip_secondary = args.pop('vmSecIp')
+    action = args.pop('action')
+    logging.debug("vmMac = "+ vm_mac)
+    logging.debug("vmName = "+ vm_name)
+    #action = "-A"
+    logging.debug("action = "+ action)
+    try:
+        vm = session.xenapi.VM.get_by_name_label(vm_name)
+        if len(vm) != 1:
+            return 'false'
+        vm_rec = session.xenapi.VM.get_record(vm[0])
+        vm_vifs = vm_rec.get('VIFs')
+        vifnums = [session.xenapi.VIF.get_record(vif).get('device') for vif in vm_vifs]
+        domid = vm_rec.get('domid')
+    except:
+        logging.debug("### Failed to get domid or vif list for vm  ##" + vm_name)
+        return 'false'
+
+    if domid == '-1':
+        logging.debug("### Failed to get domid for vm (-1):  " + vm_name)
+        return 'false'
+
+    vifs = ["vif" + domid + "." + v for v in vifnums]
+    #vm_name =  '-'.join(vm_name.split('-')[:-1])
+    vmchain = chain_name(vm_name)
+    add_to_ipset(vmchain, [ip_secondary], action)
+
+    #add arptables rules for the secondary ip
+    arp_rules_vmip(vmchain, vifs, [ip_secondary], vm_mac, action)
+
+    return 'true'
+
+@echo
+def default_network_rules_systemvm(session, args):
+    try:
+        util.pread2(['/bin/bash', '-c', 'iptables -n -L FORWARD | grep BRIDGE-FIREWALL'])
+    except:
+        can_bridge_firewall(session, args)
+
+    vm_name = args.pop('vmName')
+    try:
+        vm = session.xenapi.VM.get_by_name_label(vm_name)
+        if len(vm) != 1:
+            return 'false'
+        vm_rec = session.xenapi.VM.get_record(vm[0])
+        vm_vifs = vm_rec.get('VIFs')
+        vifnums = [session.xenapi.VIF.get_record(vif).get('device') for vif in vm_vifs]
+        domid = vm_rec.get('domid')
+    except:
+        logging.debug("### Failed to get domid or vif list for vm  ##" + vm_name)
+        return 'false'
+
+    if domid == '-1':
+        logging.debug("### Failed to get domid for vm (-1):  " + vm_name)
+        return 'false'
+
+    vifs = ["vif" + domid + "." + v for v in vifnums]
+    #vm_name =  '-'.join(vm_name.split('-')[:-1])
+    vmchain = chain_name(vm_name)
+
+
+    delete_rules_for_vm_in_bridge_firewall_chain(vm_name)
+
+    try:
+        util.pread2(['iptables', '-N', vmchain])
+    except:
+        util.pread2(['iptables', '-F', vmchain])
+
+    for vif in vifs:
+        try:
+            util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', vif, '-j', vmchain])
+            util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '2', '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', vif, '-j', vmchain])
+            util.pread2(['iptables', '-I', vmchain, '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', vif, '-j', 'RETURN'])
+        except:
+            logging.debug("Failed to program default rules")
+            return 'false'
+
+    util.pread2(['iptables', '-A', vmchain, '-j', 'ACCEPT'])
+
+    if write_rule_log_for_vm(vm_name, '-1', '_ignore_', domid, '_initial_', '-1') == False:
+        logging.debug("Failed to log default network rules for systemvm, ignoring")
+    return 'true'
+
+@echo
+def create_ipset_forvm (ipsetname):
+    result = True
+    type = getIpsetType()
+    try:
+        logging.debug("Creating ipset chain .... " + ipsetname)
+        util.pread2(['ipset', '-F', ipsetname])
+        util.pread2(['ipset', '-X', ipsetname])
+        util.pread2(['ipset', '-N', ipsetname, type])
+    except:
+        logging.debug("ipset chain not exists creating.... " + ipsetname)
+        util.pread2(['ipset', '-N', ipsetname, type])
+
+    return result
+
+@echo
+def add_to_ipset(ipsetname, ips, action):
+    result = True
+    for ip in ips:
+        try:
+            logging.debug("vm ip " + ip)
+            util.pread2(['ipset', action, ipsetname, ip])
+        except:
+            logging.debug("vm ip already in ip set" + ip)
+            continue
+
+    return result
+
+@echo
+def arp_rules_vmip (vm_chain, vifs, ips, vm_mac, action):
+    try:
+        if action == "-A":
+            action = "-I"
+        for vif in vifs:
+            for vm_ip in ips:
+                #accept any arp requests to this vm as long as the request is for this vm's ip
+                util.pread2(['arptables',  action, vm_chain, '-o', vif, '--opcode', 'Request', '--destination-ip', vm_ip, '-j', 'ACCEPT'])
+                #accept any arp replies to this vm as long as the mac and ip matches
+                util.pread2(['arptables',  action, vm_chain, '-o', vif, '--opcode', 'Reply', '--destination-mac', vm_mac, '--destination-ip', vm_ip, '-j', 'ACCEPT'])
+                #accept arp replies into the bridge as long as the source mac and ips match the vm
+                util.pread2(['arptables',  action, vm_chain, '-i', vif, '--opcode', 'Reply', '--source-mac',  vm_mac, '--source-ip',  vm_ip, '-j', 'ACCEPT'])
+                #accept any arp requests from this vm. In the future this can be restricted to deny attacks on hosts
+                #also important to restrict source ip and src mac in these requests as they can be used to update arp tables on destination
+                util.pread2(['arptables',  action, vm_chain, '-i', vif, '--opcode', 'Request',  '--source-mac',  vm_mac, '--source-ip',  vm_ip, '-j', 'RETURN'])
+    except:
+        logging.debug("Failed to program arptables  rules for ip")
+        return 'false'
+
+    return 'true'
+
+
+@echo
+def default_network_rules(session, args):
+    vm_name = args.pop('vmName')
+    vm_ip = args.pop('vmIP')
+    vm_id = args.pop('vmID')
+    vm_mac = args.pop('vmMAC')
+    sec_ips = args.pop("secIps")
+    action = "-A"
+
+    try:
+        vm = session.xenapi.VM.get_by_name_label(vm_name)
+        if len(vm) != 1:
+            logging.debug("### Failed to get record for vm  " + vm_name)
+            return 'false'
+        vm_rec = session.xenapi.VM.get_record(vm[0])
+        domid = vm_rec.get('domid')
+    except:
+        logging.debug("### Failed to get domid for vm " + vm_name)
+        return 'false'
+    if domid == '-1':
+        logging.debug("### Failed to get domid for vm (-1):  " + vm_name)
+        return 'false'
+
+    vif = "vif" + domid + ".0"
+    tap = "tap" + domid + ".0"
+    vifs = [vif]
+    try:
+        util.pread2(['ifconfig', tap])
+        vifs.append(tap)
+    except:
+        pass
+
+    delete_rules_for_vm_in_bridge_firewall_chain(vm_name)
+
+
+    vmchain =  chain_name(vm_name)
+    vmchain_egress =  egress_chain_name(vm_name)
+    vmchain_default = chain_name_def(vm_name)
+
+    destroy_ebtables_rules(vmchain)
+
+    try:
+        util.pread2(['iptables', '-N', vmchain])
+    except:
+        util.pread2(['iptables', '-F', vmchain])
+
+    try:
+        util.pread2(['iptables', '-N', vmchain_egress])
+    except:
+        util.pread2(['iptables', '-F', vmchain_egress])
+
+    try:
+        util.pread2(['iptables', '-N', vmchain_default])
+    except:
+        util.pread2(['iptables', '-F', vmchain_default])
+
+    vmipset = vm_name
+    if len(vmipset) > 28:
+        vmipset = vmipset[0:27]
+    #create ipset and add vm ips to that ip set
+    if create_ipset_forvm(vmipset) == False:
+        logging.debug(" failed to create ipset for rule " + str(tokens))
+        return 'false'
+
+    #add primary nic ip to ipset
+    if add_to_ipset(vmipset, [vm_ip], action ) == False:
+        logging.debug(" failed to add vm " + vm_ip + " ip to set ")
+        return 'false'
+
+    #add secondary nic ips to ipset
+    secIpSet = "1"
+    ips = sec_ips.split(';')
+    ips.pop()
+    if ips[0] == "0":
+        secIpSet = "0";
+
+    if secIpSet == "1":
+        logging.debug("Adding ipset for secondary ips")
+        add_to_ipset(vmipset, ips, action)
+        if write_secip_log_for_vm(vm_name, sec_ips, vm_id) == False:
+            logging.debug("Failed to log default network rules, ignoring")
+
+    keyword = '--' + get_ipset_keyword()
+
+    try:
+        for v in vifs:
+            util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', v, '-j', vmchain_default])
+            util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '2', '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '-j', vmchain_default])
+
+        #don't let vm spoof its ip address
+        for v in vifs:
+            #util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '--source', vm_ip,'-p', 'udp', '--dport', '53', '-j', 'RETURN'])
+            util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '-m', 'set', keyword, vmipset, 'src', '-p', 'udp', '--dport', '53', '-j', 'RETURN'])
+            util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '-m', 'set', '!', keyword, vmipset, 'src', '-j', 'DROP'])
+            util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', v, '-m', 'set', '!', keyword, vmipset, 'dst', '-j', 'DROP'])
+            util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '-m', 'set', keyword, vmipset, 'src', '-j', vmchain_egress])
+            util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', v,  '-j', vmchain])
+    except:
+        logging.debug("Failed to program default rules for vm " + vm_name)
+        return 'false'
+
+    default_arp_antispoof(vmchain, vifs, vm_ip, vm_mac)
+    #add default arp rules for secondary ips;
+    if secIpSet == "1":
+        logging.debug("Adding arp rules for sec ip")
+        arp_rules_vmip(vmchain, vifs, ips, vm_mac, action)
+
+    default_ebtables_antispoof_rules(vmchain, vifs, vm_ip, vm_mac)
+
+    if write_rule_log_for_vm(vm_name, vm_id, vm_ip, domid, '_initial_', '-1', vm_mac) == False:
+        logging.debug("Failed to log default network rules, ignoring")
+
+    logging.debug("Programmed default rules for vm " + vm_name)
+    return 'true'
+
+@echo
+def check_domid_changed(session, vmName):
+    curr_domid = '-1'
+    try:
+        vm = session.xenapi.VM.get_by_name_label(vmName)
+        if len(vm) != 1:
+            logging.debug("### Could not get record for vm ## " + vmName)
+        else:
+            vm_rec = session.xenapi.VM.get_record(vm[0])
+            curr_domid = vm_rec.get('domid')
+    except:
+        logging.debug("### Failed to get domid for vm  ## " + vmName)
+
+
+    logfilename = "/var/run/cloud/" + vmName +".log"
+    if not os.path.exists(logfilename):
+        return ['-1', curr_domid]
+
+    lines = (line.rstrip() for line in open(logfilename))
+
+    [_vmName,_vmID,_vmIP,old_domid,_signature,_seqno, _vmMac] = ['_', '-1', '_', '-1', '_', '-1', 'ff:ff:ff:ff:ff:ff']
+    for line in lines:
+        try:
+            [_vmName,_vmID,_vmIP,old_domid,_signature,_seqno,_vmMac] = line.split(',')
+        except ValueError as v:
+            [_vmName,_vmID,_vmIP,old_domid,_signature,_seqno] = line.split(',')
+        break
+
+    return [curr_domid, old_domid]
+
+@echo
+def delete_rules_for_vm_in_bridge_firewall_chain(vmName):
+    vm_name = vmName
+    vmchain = chain_name_def(vm_name)
+
+    delcmd = "iptables-save | grep '\-A BRIDGE-FIREWALL' | grep '%s' | sed 's/-A/-D/'" % vmchain
+    delcmds = util.pread2(['/bin/bash', '-c', delcmd]).split('\n')
+    for cmd in filter(None, delcmds):
+        try:
+            dc = 'iptables ' + cmd
+            util.pread2(filter(None, dc.split(' ')))
+        except:
+            logging.debug("Ignoring failure to delete rules for vm " + vmName)
+
+@echo
+def network_rules_for_rebooted_vm(session, vmName):
+    vm_name = vmName
+    [curr_domid, old_domid] = check_domid_changed(session, vm_name)
+
+    if curr_domid == old_domid:
+        return True
+
+    if old_domid == '-1':
+        return True
+
+    if curr_domid == '-1':
+        return True
+
+    logging.debug("Found a rebooted VM -- reprogramming rules for  " + vm_name)
+
+    delete_rules_for_vm_in_bridge_firewall_chain(vm_name)
+    if 1 in [ vm_name.startswith(c) for c in ['r-', 's-', 'v-', 'l-'] ]:
+        default_network_rules_systemvm(session, {"vmName":vm_name})
+        return True
+
+    vif = "vif" + curr_domid + ".0"
+    tap = "tap" + curr_domid + ".0"
+    vifs = [vif]
+    try:
+        util.pread2(['ifconfig', tap])
+        vifs.append(tap)
+    except:
+        pass
+    vmchain = chain_name(vm_name)
+    vmchain_default = chain_name_def(vm_name)
+
+    for v in vifs:
+        util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', v, '-j', vmchain_default])
+        util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '2', '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '-j', vmchain_default])
+
+    #change antispoof rule in vmchain
+    try:
+        delcmd = "iptables-save | grep '\-A " +  vmchain_default + "' | grep  physdev-in | sed 's/!--set/! --set/' | sed 's/-A/-D/'"
+        delcmd2 = "iptables-save | grep '\-A " +  vmchain_default + "' | grep  physdev-out | sed 's/!--set/! --set/'| sed 's/-A/-D/'"
+        inscmd = "iptables-save | grep '\-A " +  vmchain_default + "' | grep  physdev-in | grep vif | sed -r 's/vif[0-9]+.0/" + vif + "/' | sed 's/!--set/! --set/'"
+        inscmd2 = "iptables-save| grep '\-A " +  vmchain_default + "' | grep  physdev-in | grep tap | sed -r 's/tap[0-9]+.0/" + tap + "/' | sed 's/!--set/! --set/'"
+        inscmd3 = "iptables-save | grep '\-A " +  vmchain_default + "' | grep  physdev-out | grep vif | sed -r 's/vif[0-9]+.0/" + vif + "/' | sed 's/!--set/! --set/'"
+        inscmd4 = "iptables-save| grep '\-A " +  vmchain_default + "' | grep  physdev-out | grep tap | sed -r 's/tap[0-9]+.0/" + tap + "/'  | sed 's/!--set/! --set/'"
+
+        ipts = []
+        for cmd in [delcmd, delcmd2, inscmd, inscmd2, inscmd3, inscmd4]:
+            cmds = util.pread2(['/bin/bash', '-c', cmd]).split('\n')
+            cmds.pop()
+            for c in filter(None,cmds):
+                ipt = c.split(' ')
+                ipt.insert(0, 'iptables')
+                ipts.append(ipt)
+
+        for ipt in ipts:
+            try:
+                util.pread2(filter(None,ipt))
+            except:
+                logging.debug("Failed to rewrite antispoofing rules for vm " + vm_name)
+    except:
+        logging.debug("No rules found for vm " + vm_name)
+
+    destroy_ebtables_rules(vmchain)
+    destroy_arptables_rules(vmchain)
+    [vm_ip, vm_mac] = get_vm_mac_ip_from_log(vmchain)
+    default_arp_antispoof(vmchain, vifs, vm_ip, vm_mac)
+
+    #check whether the vm has secondary ips
+    if is_secondary_ips_set(vm_name) == True:
+        vmips = get_vm_sec_ips(vm_name)
+        #add arp rules for the secondaryp ip
+        for ip in vmips:
+            arp_rules_vmip(vmchain, vifs, [ip], vm_mac, "-A")
+
+
+    default_ebtables_antispoof_rules(vmchain, vifs, vm_ip, vm_mac)
+    rewrite_rule_log_for_vm(vm_name, curr_domid)
+    return True
+
+
+
+@echo
+def get_vm_sec_ips(vm_name):
+    logfilename = "/var/run/cloud/" + vm_name +".ip"
+
+    lines = (line.rstrip() for line in open(logfilename))
+    for line in lines:
+        try:
+            [_vmName,_vmIP,_vmID] = line.split(',')
+            break
+        except ValueError as v:
+            [_vmName,_vmIP,_vmID] = line.split(',')
+
+    _vmIPS = _vmIP.split(":")[:-1]
+    return _vmIPS
+
+@echo
+def is_secondary_ips_set(vm_name):
+    logfilename = "/var/run/cloud/" + vm_name +".ip"
+    if not os.path.exists(logfilename):
+        return False
+
+    return True
+
+@echo
+def rewrite_rule_log_for_vm(vm_name, new_domid):
+    logfilename = "/var/run/cloud/" + vm_name +".log"
+    if not os.path.exists(logfilename):
+        return
+    lines = (line.rstrip() for line in open(logfilename))
+
+    [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = ['_', '-1', '_', '-1', '_', '-1','ff:ff:ff:ff:ff:ff']
+    for line in lines:
+        try:
+            [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = line.split(',')
+            break
+        except ValueError as v:
+            [_vmName,_vmID,_vmIP,_domID,_signature,_seqno] = line.split(',')
+
+    write_rule_log_for_vm(_vmName, _vmID, _vmIP, new_domid, _signature, '-1', _vmMac)
+
+def get_rule_log_for_vm(session, vmName):
+    vm_name = vmName;
+    logfilename = "/var/run/cloud/" + vm_name +".log"
+    if not os.path.exists(logfilename):
+        return ''
+
+    lines = (line.rstrip() for line in open(logfilename))
+
+    [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = ['_', '-1', '_', '-1', '_', '-1', 'ff:ff:ff:ff:ff:ff']
+    for line in lines:
+        try:
+            [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = line.split(',')
+            break
+        except ValueError as v:
+            [_vmName,_vmID,_vmIP,_domID,_signature,_seqno] = line.split(',')
+
+    return ','.join([_vmName, _vmID, _vmIP, _domID, _signature, _seqno])
+
+@echo
+def get_vm_mac_ip_from_log(vm_name):
+    [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = ['_', '-1', '0.0.0.0', '-1', '_', '-1','ff:ff:ff:ff:ff:ff']
+    logfilename = "/var/run/cloud/" + vm_name +".log"
+    if not os.path.exists(logfilename):
+        return ['_', '_']
+
+    lines = (line.rstrip() for line in open(logfilename))
+    for line in lines:
+        try:
+            [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = line.split(',')
+            break
+        except ValueError as v:
+            [_vmName,_vmID,_vmIP,_domID,_signature,_seqno] = line.split(',')
+
+    return [ _vmIP, _vmMac]
+
+@echo
+def get_rule_logs_for_vms(session, args):
+    host_uuid = args.pop('host_uuid')
+    try:
+        thishost = session.xenapi.host.get_by_uuid(host_uuid)
+        hostrec = session.xenapi.host.get_record(thishost)
+        vms = hostrec.get('resident_VMs')
+    except:
+        logging.debug("Failed to get host from uuid " + host_uuid)
+        return ' '
+
+    result = []
+    try:
+        for name in [session.xenapi.VM.get_name_label(x) for x in vms]:
+            if 1 not in [ name.startswith(c) for c in ['r-', 's-', 'v-', 'i-', 'l-'] ]:
+                continue
+            network_rules_for_rebooted_vm(session, name)
+            if name.startswith('i-'):
+                log = get_rule_log_for_vm(session, name)
+                result.append(log)
+    except:
+        logging.debug("Failed to get rule logs, better luck next time!")
+
+    return ";".join(result)
+
+@echo
+def cleanup_rules_for_dead_vms(session):
+    try:
+        vms = session.xenapi.VM.get_all()
+        cleaned = 0
+        for vm_name in [session.xenapi.VM.get_name_label(x) for x in vms]:
+            if 1 in [ vm_name.startswith(c) for c in ['r-', 'i-', 's-', 'v-', 'l-'] ]:
+                vm = session.xenapi.VM.get_by_name_label(vm_name)
+                if len(vm) != 1:
+                    continue
+                vm_rec = session.xenapi.VM.get_record(vm[0])
+                state = vm_rec.get('power_state')
+                if state != 'Running' and state != 'Paused':
+                    logging.debug("vm " + vm_name + " is not running, cleaning up")
+                    destroy_network_rules_for_vm(session, {'vmName':vm_name})
+                    cleaned = cleaned+1
+
+        logging.debug("Cleaned up rules for " + str(cleaned) + " vms")
+    except:
+        logging.debug("Failed to cleanup rules for dead vms!")
+
+
+@echo
+def cleanup_rules(session, args):
+    instance = args.get('instance')
+    if not instance:
+        instance = 'VM'
+    resident_vms = []
+    try:
+        hostname = util.pread2(['/bin/bash', '-c', 'hostname']).split('\n')
+        if len(hostname) < 1:
+            raise Exception('Could not find hostname of this host')
+        thishost = session.xenapi.host.get_by_name_label(hostname[0])
+        if len(thishost) < 1:
+            raise Exception("Could not find host record from hostname %s of this host"%hostname[0])
+        hostrec = session.xenapi.host.get_record(thishost[0])
+        vms = hostrec.get('resident_VMs')
+        resident_vms = [session.xenapi.VM.get_name_label(x) for x in vms]
+        util.SMlog('cleanup_rules: resident_vms= %s' %resident_vms)
+        util.SMlog('cleanup_rules: found %s resident vms on this host %s' % (len(resident_vms)-1, hostname[0]))
+
+        chainscmd = "iptables-save | grep '^:' | awk '{print $1}' | cut -d':' -f2 | sed 's/-def//'| sed 's/-eg//' | sort|uniq"
+        chains = util.pread2(['/bin/bash', '-c', chainscmd]).split('\n')
+        vmchains = [ch  for ch in chains if 1 in [ ch.startswith(c) for c in ['r-', 'i-', 's-', 'v-', 'l-']]]
+        util.SMlog('cleanup_rules: vmchains= %s' %vmchains)
+        util.SMlog('cleanup_rules: found %s iptables chains for vms on this host %s' % (len(vmchains), hostname[0]))
+        cleaned = 0
+        cleanup = []
+        for chain in vmchains:
+            vmname = chain
+            vmpresent = False
+            #looping intentionally because if vmaname in resident_vms is not greedy.
+            #after trimming the vm names which more than 29 chars, resident vm name and iptables chain name is substring of
+            #of resident vm.
+            for rvm in resident_vms:
+                if vmname  in rvm:

Review Comment:
   ```suggestion
                   if vmname in rvm:
   ```



##########
scripts/vm/hypervisor/xenserver/xenserver84/vmops:
##########
@@ -0,0 +1,1607 @@
+#!/usr/bin/python
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Version @VERSION@
+#
+# A plugin for executing script needed by vmops cloud
+
+import os, sys, time
+import XenAPIPlugin
+if os.path.exists("/opt/xensource/sm"):
+    sys.path.extend(["/opt/xensource/sm/", "/usr/local/sbin/", "/sbin/"])
+if os.path.exists("/usr/lib/xcp/sm"):
+    sys.path.extend(["/usr/lib/xcp/sm/", "/usr/local/sbin/", "/sbin/"])
+import base64
+import socket
+import stat
+import tempfile
+import util
+import subprocess
+import zlib
+import cloudstack_pluginlib as lib
+import logging
+from util import CommandException
+
+lib.setup_logging("/var/log/cloud/cloud.log")
+
+def echo(fn):
+    def wrapped(*v, **k):
+        name = fn.__name__
+        #command string is logged in SMlog, so method enter/exit logging into SMlog will help for debugging
+        util.SMlog("#### CLOUD enter  %s ####" % name )
+        res = fn(*v, **k)
+        util.SMlog("#### CLOUD exit  %s ####" % name )
+        return res
+    return wrapped
+
+@echo
+def add_to_VCPUs_params_live(session, args):
+    key = args['key']
+    value = args['value']
+    vmname = args['vmname']
+    try:
+        cmd = ["bash", "/opt/cloud/bin/add_to_vcpus_params_live.sh", vmname, key, value]
+        txt = util.pread2(cmd)
+    except:
+        return 'false'
+    return 'true'
+
+@echo
+def setup_iscsi(session, args):
+    uuid=args['uuid']
+    try:
+        cmd = ["bash", "/opt/cloud/bin/setup_iscsi.sh", uuid]
+        txt = util.pread2(cmd)
+    except:
+        txt = ''
+    return txt
+
+
+@echo
+def preparemigration(session, args):
+    uuid = args['uuid']
+    try:
+        cmd = ["/opt/cloud/bin/make_migratable.sh", uuid]
+        util.pread2(cmd)
+        txt = 'success'
+    except:
+        logging.debug("Catch prepare migration exception" )
+        txt = ''
+
+    return txt
+
+@echo
+def setIptables(session, args):
+    try:
+        cmd = ["/bin/bash", "/opt/cloud/bin/setupxenserver.sh"]
+        txt = util.pread2(cmd)
+        txt = 'success'
+    except:
+        logging.debug("  setIptables execution failed "  )
+        txt = ''
+
+    return txt
+
+@echo
+def pingdomr(session, args):
+    host = args['host']
+    port = args['port']
+    socket.setdefaulttimeout(3)
+    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+    try:
+        s.connect((host,int(port)))
+        txt = 'success'
+    except:
+        txt = ''
+
+    s.close()
+
+    return txt
+
+@echo
+def kill_copy_process(session, args):
+    namelabel = args['namelabel']
+    try:
+        cmd = ["bash", "/opt/cloud/bin/kill_copy_process.sh", namelabel]
+        txt = util.pread2(cmd)
+    except:
+        txt = 'false'
+    return txt
+
+@echo
+def pingxenserver(session, args):
+    txt = 'success'
+    return txt
+
+def pingtest(session, args):
+    sargs = args['args']
+    cmd = sargs.split(' ')
+    cmd.insert(0, "/opt/cloud/bin/pingtest.sh")
+    cmd.insert(0, "/bin/bash")
+    try:
+        txt = util.pread2(cmd)
+        txt = 'success'
+    except:
+        logging.debug("  pingtest failed "  )
+        txt = ''
+
+    return txt
+
+@echo
+def setLinkLocalIP(session, args):
+    brName = args['brName']
+    try:
+        cmd = ["ip", "route", "del", "169.254.0.0/16"]
+        txt = util.pread2(cmd)
+    except:
+        txt = ''
+    try:
+        cmd = ["ifconfig", brName, "169.254.0.1", "netmask", "255.255.0.0"]
+        txt = util.pread2(cmd)
+    except:
+        try:
+            cmd = ['cat', '/etc/xensource/network.conf']
+            result = util.pread2(cmd)
+        except:
+            return 'can not cat network.conf'
+
+        if result.lower().strip() == "bridge":
+            try:
+                cmd = ["brctl", "addbr", brName]
+                txt = util.pread2(cmd)
+            except:
+                pass
+
+        else:
+            try:
+                cmd = ["ovs-vsctl", "add-br", brName]
+                txt = util.pread2(cmd)
+            except:
+                pass
+
+        try:
+            cmd = ["ifconfig", brName, "169.254.0.1", "netmask", "255.255.0.0"]
+            txt = util.pread2(cmd)
+        except:
+            pass
+    try:
+        cmd = ["ip", "route", "add", "169.254.0.0/16", "dev", brName, "src", "169.254.0.1"]
+        txt = util.pread2(cmd)
+    except:
+        txt = ''
+    txt = 'success'
+    return txt
+
+@echo
+def createFile(session, args):
+    file_path = args['filepath']
+    file_contents = args['filecontents']
+
+    try:
+        f = open(file_path, "w")
+        f.write(file_contents)
+        f.close()
+        txt = 'success'
+    except:
+        logging.debug(" failed to create HA proxy cfg file ")
+        txt = ''
+
+    return txt
+
+@echo
+def secureCopyToHost(session, args):
+    host_filepath = args['hostfilepath']
+    src_ip = args['srcip']
+    src_filepath = args['srcfilepath']
+    src_target = "root@" + src_ip + ":" + src_filepath
+    # Make any directories as needed
+    if not os.path.isdir(host_filepath):
+        try:
+            os.makedirs(host_filepath)
+        except OSError as e:
+            if not os.path.isdir(host_filepath):
+                errMsg = "OSError while creating " + host_filepath + " with errno: " + str(e.errno) + " and strerr: " + e.strerror
+                logging.debug(errMsg)
+                return "fail# Cannot create the directory to copy file to " + host_filepath
+
+    # Copy file to created directory
+    txt=""
+    try:
+        txt = util.pread2(['scp','-P','3922','-q','-o','StrictHostKeyChecking=no','-i','/root/.ssh/id_rsa.cloud', src_target, host_filepath])
+        util.pread2(['chmod', 'a+r', os.path.join(host_filepath, os.path.basename(src_filepath))])
+        txt = 'success#' + txt
+    except:
+        logging.error("failed to scp source target " + src_target + " to host at file path " + host_filepath)
+        txt = 'fail#' + txt
+    return txt
+
+@echo
+def createFileInDomr(session, args):
+    src_filepath = args['srcfilepath']
+    dst_path = args['dstfilepath']
+    domrip = args['domrip']
+    cleanup = 'true' if 'cleanup' not in args else args['cleanup']
+    txt=""
+    try:
+        target = "root@" + domrip + ":" + dst_path
+        txt = util.pread2(['scp','-P','3922','-q','-o','StrictHostKeyChecking=no','-i','/root/.ssh/id_rsa.cloud',src_filepath, target])
+        if cleanup == 'true' or not cleanup:
+            util.pread2(['rm',src_filepath])
+        txt = 'succ#' + txt
+    except:
+        logging.debug("failed to copy file " + src_filepath + " from host to VR with ip " + domrip)
+        txt = 'fail#' + txt
+    return txt
+
+@echo
+def runPatchScriptInDomr(session, args):
+    domrip = args['domrip']
+    txt=""
+    try:
+        target = "root@" + domrip
+        txt = util.pread2(['ssh','-p','3922','-i','/root/.ssh/id_rsa.cloud', target, "/bin/bash","/var/cache/cloud/patch-sysvms.sh"])
+        txt = 'succ#' + txt
+    except:
+        logging.debug("failed to run patch script in systemVM with IP:  " + domrip)
+        txt = 'fail#' + txt
+    return txt
+
+@echo
+def deleteFile(session, args):
+    file_path = args["filepath"]
+
+    try:
+        if os.path.isfile(file_path):
+            os.remove(file_path)
+        txt = 'success'
+    except:
+        logging.debug(" failed to remove HA proxy cfg file ")
+        txt = ''
+
+    return txt
+
+#using all the iptables chain names length to 24 because cleanup_rules groups the vm chain excluding -def,-eg
+#to avoid multiple iptables chains for single vm, there using length 24
+def chain_name(vm_name):
+    if vm_name.startswith('i-') or vm_name.startswith('r-'):
+        if vm_name.endswith('untagged'):
+            return '-'.join(vm_name.split('-')[:-1])
+    if len(vm_name) > 25:
+        vm_name = vm_name[0:24]
+    return vm_name
+
+def chain_name_def(vm_name):
+    #iptables chain length max is 29 chars
+    if len(vm_name) > 25:
+        vm_name = vm_name[0:24]
+
+    if vm_name.startswith('i-'):
+        if vm_name.endswith('untagged'):
+            return '-'.join(vm_name.split('-')[:-1]) + "-def"
+        return vm_name + "-def"
+
+    if len(vm_name) > 28:
+        vm_name = vm_name[0:27]
+    return vm_name
+
+def egress_chain_name(vm_name):
+    #iptables chain length max is 29 chars
+    name = chain_name(vm_name)
+    name = name+"-eg"
+    return name
+
+#chain name length is 14 because it has protocol and ports appends
+def chain_name_ipset(vm_name):
+    if vm_name.startswith('i-') or vm_name.startswith('r-'):
+        if vm_name.endswith('untagged'):
+            return ''.join(vm_name.split('')[:-1])
+        if len(vm_name) > 14:
+            vm_name = vm_name[0:13]
+    return vm_name
+
+def egress_chain_name_ipset(vm_name):
+    name = chain_name_ipset(vm_name) + "-e"
+    return name
+
+def ingress_chain_name_ipset(vm_name):
+    name = chain_name_ipset(vm_name)
+    return name
+
+@echo
+def can_bridge_firewall(session, args):
+    try:
+        util.pread2(['ebtables', '-V'])
+        util.pread2(['ipset', '-V'])
+        cmd = ['cat', '/etc/xensource/network.conf']
+        result = util.pread2(cmd)
+        if result.lower().strip() != "bridge":
+            return 'false'
+
+    except:
+        return 'false'
+
+    try:
+        util.pread2(['iptables', '-N', 'BRIDGE-FIREWALL'])
+        util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '-m', 'state', '--state', 'RELATED,ESTABLISHED', '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged',  '-p', 'udp', '--dport', '67', '--sport', '68',  '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged',  '-p', 'udp', '--dport', '68', '--sport', '67',  '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-D', 'FORWARD',  '-j', 'RH-Firewall-1-INPUT'])
+    except:
+        logging.debug('Chain BRIDGE-FIREWALL already exists')
+
+    try:
+        util.pread2(['iptables', '-N', 'BRIDGE-DEFAULT-FIREWALL'])
+        util.pread2(['iptables', '-A', 'BRIDGE-DEFAULT-FIREWALL', '-m', 'state', '--state', 'RELATED,ESTABLISHED', '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-A', 'BRIDGE-DEFAULT-FIREWALL', '-m', 'physdev', '--physdev-is-bridged',  '-p', 'udp', '--dport', '67', '--sport', '68',  '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-A', 'BRIDGE-DEFAULT-FIREWALL', '-m', 'physdev', '--physdev-is-bridged',  '-p', 'udp', '--dport', '68', '--sport', '67',  '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '-j', 'BRIDGE-DEFAULT-FIREWALL'])
+        util.pread2(['iptables', '-D', 'BRIDGE-FIREWALL', '-m', 'state', '--state', 'RELATED,ESTABLISHED', '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-D', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged',  '-p', 'udp', '--dport', '67', '--sport', '68',  '-j', 'ACCEPT'])
+        util.pread2(['iptables', '-D', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged',  '-p', 'udp', '--dport', '68', '--sport', '67',  '-j', 'ACCEPT'])
+    except:
+        logging.debug('Chain BRIDGE-DEFAULT-FIREWALL already exists')
+
+    result = 'true'
+    try:
+        util.pread2(['/bin/bash', '-c', 'iptables -n -L FORWARD | grep BRIDGE-FIREWALL'])
+    except:
+        try:
+            util.pread2(['iptables', '-I', 'FORWARD', '-m', 'physdev', '--physdev-is-bridged', '-j', 'BRIDGE-FIREWALL'])
+            util.pread2(['iptables', '-A', 'FORWARD', '-j', 'DROP'])
+        except:
+            return 'false'
+    default_ebtables_rules()
+    allow_egress_traffic(session)
+    if not os.path.exists('/var/run/cloud'):
+        os.makedirs('/var/run/cloud')
+    if not os.path.exists('/var/cache/cloud'):
+        os.makedirs('/var/cache/cloud')
+    #get_ipset_keyword()
+
+    cleanup_rules_for_dead_vms(session)
+    cleanup_rules(session, args)
+
+    return result
+
+@echo
+def default_ebtables_rules():
+    try:
+        util.pread2(['ebtables', '-N',  'DEFAULT_EBTABLES'])
+        util.pread2(['ebtables', '-A', 'FORWARD', '-j'  'DEFAULT_EBTABLES'])
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '--ip-dst', '255.255.255.255', '--ip-proto', 'udp', '--ip-dport', '67', '-j', 'ACCEPT'])
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '--ip-dst', '255.255.255.255', '--ip-proto', 'udp', '--ip-dport', '68', '-j', 'ACCEPT'])
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'ARP', '--arp-op', 'Request', '-j', 'ACCEPT'])
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'ARP', '--arp-op', 'Reply', '-j', 'ACCEPT'])
+        # deny mac broadcast and multicast
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '-d', 'Broadcast', '-j', 'DROP'])
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '-d', 'Multicast', '-j', 'DROP'])
+        # deny ip broadcast and multicast
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '--ip-dst', '255.255.255.255', '-j', 'DROP'])
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '--ip-dst', '224.0.0.0/4', '-j', 'DROP'])
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv4', '-j', 'RETURN'])
+        # deny ipv6
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', 'IPv6', '-j', 'DROP'])
+        # deny vlan
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES', '-p', '802_1Q', '-j', 'DROP'])
+        # deny all others (e.g., 802.1d, CDP)
+        util.pread2(['ebtables', '-A', 'DEFAULT_EBTABLES',  '-j', 'DROP'])
+    except:
+        logging.debug('Chain DEFAULT_EBTABLES already exists')
+
+
+@echo
+def allow_egress_traffic(session):
+    devs = []
+    for pif in session.xenapi.PIF.get_all():
+        pif_rec = session.xenapi.PIF.get_record(pif)
+        dev = pif_rec.get('device')
+        devs.append(dev + "+")
+    for d in devs:
+        try:
+            util.pread2(['/bin/bash', '-c', "iptables -n -L FORWARD | grep '%s '" % d])
+        except:
+            try:
+                util.pread2(['iptables', '-I', 'FORWARD', '2', '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', d, '-j', 'ACCEPT'])
+            except:
+                logging.debug("Failed to add FORWARD rule through to %s" % d)
+                return 'false'
+    return 'true'
+
+def getIpsetType():
+    try:
+        out = util.pread2(['/bin/bash', '-c', "ipset -v | awk '{print $5}'"])
+        out.replace(".","")
+        if int(out) < 6:
+            return 'iptreemap'
+        else:
+            return 'nethash'
+    except:
+        return 'iptreemap'
+
+def ipset(ipsetname, proto, start, end, cidrs):
+    type = getIpsetType()
+    try:
+        util.pread2(['ipset', '-N', ipsetname, type])
+    except:
+        logging.debug("ipset chain already exists: " + ipsetname)
+
+    result = True
+    ipsettmp = ''.join(''.join(ipsetname.split('-')).split('_')) + str(int(time.time()) % 1000)
+
+    try:
+        util.pread2(['ipset', '-N', ipsettmp, type])
+    except:
+        logging.debug("Failed to create temp ipset, reusing old name= " + ipsettmp)
+        try:
+            util.pread2(['ipset', '-F', ipsettmp])
+        except:
+            logging.debug("Failed to clear old temp ipset name=" + ipsettmp)
+            return False
+    try:
+        for cidr in cidrs:
+            try:
+                util.pread2(['ipset', '-A', ipsettmp, cidr])
+            except CommandException as cex:
+                logging.debug("ipset cidr add failed due to: " + str(cex.reason))
+                if cex.reason.rfind('already in set') == -1:
+                    raise
+    except:
+        logging.debug("Failed to program ipset " + ipsetname)
+        util.pread2(['ipset', '-F', ipsettmp])
+        util.pread2(['ipset', '-X', ipsettmp])
+        return False
+
+    try:
+        util.pread2(['ipset', '-W', ipsettmp, ipsetname])
+    except:
+        logging.debug("Failed to swap ipset, trying to delete and swap ipset: " + ipsetname)
+        # the old ipset entry could be of iphash type, try to delete and recreate
+        try:
+            util.pread2(['ipset', '-X', ipsetname])
+            util.pread2(['ipset', '-N', ipsetname, type])
+            util.pread2(['ipset', '-W', ipsettmp, ipsetname])
+        except:
+            logging.debug("Failed to swap ipset " + ipsetname)
+            result = False
+        logging.debug("Succeeded in re-initializing and swapping ipset")
+
+    try:
+        util.pread2(['ipset', '-F', ipsettmp])
+        util.pread2(['ipset', '-X', ipsettmp])
+    except:
+        # if the temporary name clashes next time we'll just reuse it
+        logging.debug("Failed to delete temp ipset " + ipsettmp)
+
+    return result
+
+@echo
+def destroy_network_rules_for_vm(session, args):
+    vm_name = args.pop('vmName')
+    vmchain = chain_name(vm_name)
+    vmchain_egress = egress_chain_name(vm_name)
+    vmchain_default = chain_name_def(vm_name)
+
+    delete_rules_for_vm_in_bridge_firewall_chain(vm_name)
+    if vm_name.startswith('i-') or vm_name.startswith('r-') or vm_name.startswith('l-'):
+        try:
+            util.pread2(['iptables', '-F', vmchain_default])
+            util.pread2(['iptables', '-X', vmchain_default])
+        except:
+            logging.debug("Ignoring failure to delete chain " + vmchain_default)
+
+    destroy_ebtables_rules(vmchain)
+    destroy_arptables_rules(vmchain)
+
+    try:
+        util.pread2(['iptables', '-F', vmchain])
+        util.pread2(['iptables', '-X', vmchain])
+    except:
+        logging.debug("Ignoring failure to delete ingress chain " + vmchain)
+
+
+    try:
+        util.pread2(['iptables', '-F', vmchain_egress])
+        util.pread2(['iptables', '-X', vmchain_egress])
+    except:
+        logging.debug("Ignoring failure to delete egress chain " + vmchain_egress)
+
+    remove_rule_log_for_vm(vm_name)
+    remove_secip_log_for_vm(vm_name)
+
+    if 1 in [ vm_name.startswith(c) for c in ['r-', 's-', 'v-', 'l-'] ]:
+        return 'true'
+
+    try:
+        setscmd = "ipset --save | grep '%s' | grep -e '^-N' -e '^create' | awk '{print $2}'" % vmchain
+        ipset_names = filter(None, util.pread2(['/bin/bash', '-c', setscmd]).split('\n'))
+        for ipset_name in ipset_names:
+            if not ipset_name:
+                continue
+            util.pread2(['ipset', '-F', ipset_name])
+            util.pread2(['ipset', '-X', ipset_name])
+    except:
+        logging.debug("Failed to destroy ipsets for %" % vm_name)
+
+    return 'true'
+
+@echo
+def destroy_ebtables_rules(vm_chain):
+    delcmd = "ebtables-save | grep '%s' | sed 's/-A/-D/'" % vm_chain
+    delcmds = util.pread2(['/bin/bash', '-c', delcmd]).split('\n')
+    for cmd in filter(None, delcmds):
+        try:
+            dc = 'ebtables ' + cmd
+            util.pread2(filter(None, dc.split(' ')))
+        except:
+            logging.debug("Ignoring failure to delete ebtables rules for vm " + vm_chain)
+    try:
+        util.pread2(['ebtables', '-F', vm_chain])
+        util.pread2(['ebtables', '-X', vm_chain])
+    except:
+        logging.debug("Ignoring failure to delete ebtables chain for vm " + vm_chain)
+
+@echo
+def destroy_arptables_rules(vm_chain):
+    delcmd = "arptables -vL FORWARD | grep '%s' | sed 's/-i any//' | sed 's/-o any//' | awk '{print $1,$2,$3,$4}' " % vm_chain
+    delcmds = util.pread2(['/bin/bash', '-c', delcmd]).split('\n')
+    for cmd in filter(None, delcmds):
+        try:
+            dc = 'arptables -D FORWARD ' + cmd
+            util.pread2(filter(None, dc.split(' ')))
+        except:
+            logging.debug("Ignoring failure to delete arptables rules for vm " + vm_chain)
+
+    try:
+        util.pread2(['arptables', '-F', vm_chain])
+        util.pread2(['arptables', '-X', vm_chain])
+    except:
+        logging.debug("Ignoring failure to delete arptables chain for vm " + vm_chain)
+
+@echo
+def default_ebtables_antispoof_rules(vm_chain, vifs, vm_ip, vm_mac):
+    if vm_mac == 'ff:ff:ff:ff:ff:ff':
+        logging.debug("Ignoring since mac address is not valid")
+        return 'true'
+
+    try:
+        util.pread2(['ebtables', '-N', vm_chain])
+    except:
+        try:
+            util.pread2(['ebtables', '-F', vm_chain])
+        except:
+            logging.debug("Failed to create ebtables antispoof chain, skipping")
+            return 'true'
+
+    # note all rules for packets into the bridge (-i) precede all output rules (-o)
+    # always start after the first rule in the FORWARD chain that jumps to DEFAULT_EBTABLES chain
+    try:
+        for vif in vifs:
+            util.pread2(['ebtables', '-I', 'FORWARD', '2', '-i',  vif,  '-j', vm_chain])
+            util.pread2(['ebtables', '-A', 'FORWARD', '-o',  vif, '-j', vm_chain])
+    except:
+        logging.debug("Failed to program default ebtables FORWARD rules for %s" % vm_chain)
+        return 'false'
+
+    try:
+        for vif in vifs:
+            # only allow source mac that belongs to the vm
+            try:
+                util.pread2(['ebtables', '-t', 'nat', '-I', 'PREROUTING', '-i', vif, '-s', '!' , vm_mac, '-j', 'DROP'])
+            except:
+                util.pread2(['ebtables', '-A', vm_chain, '-i', vif, '-s', '!', vm_mac,  '-j', 'DROP'])
+
+            # do not allow fake dhcp responses
+            util.pread2(['ebtables', '-A', vm_chain, '-i', vif, '-p', 'IPv4', '--ip-proto', 'udp', '--ip-dport', '68', '-j', 'DROP'])
+            # do not allow snooping of dhcp requests
+            util.pread2(['ebtables', '-A', vm_chain, '-o', vif, '-p', 'IPv4', '--ip-proto', 'udp', '--ip-dport', '67', '-j', 'DROP'])
+    except:
+        logging.debug("Failed to program default ebtables antispoof rules for %s" % vm_chain)
+        return 'false'
+
+    return 'true'
+
+@echo
+def default_arp_antispoof(vm_chain, vifs, vm_ip, vm_mac):
+    if vm_mac == 'ff:ff:ff:ff:ff:ff':
+        logging.debug("Ignoring since mac address is not valid")
+        return 'true'
+
+    try:
+        util.pread2(['arptables',  '-N', vm_chain])
+    except:
+        try:
+            util.pread2(['arptables', '-F', vm_chain])
+        except:
+            logging.debug("Failed to create arptables rule, skipping")
+            return 'true'
+
+    # note all rules for packets into the bridge (-i) precede all output rules (-o)
+    try:
+        for vif in vifs:
+            util.pread2(['arptables',  '-I', 'FORWARD', '-i',  vif, '-j', vm_chain])
+            util.pread2(['arptables',  '-A', 'FORWARD', '-o',  vif, '-j', vm_chain])
+    except:
+        logging.debug("Failed to program default arptables rules in FORWARD chain vm=" + vm_chain)
+        return 'false'
+
+    try:
+        for vif in vifs:
+            #accept arp replies into the bridge as long as the source mac and ips match the vm
+            util.pread2(['arptables',  '-A', vm_chain, '-i', vif, '--opcode', 'Reply', '--source-mac',  vm_mac, '--source-ip',  vm_ip, '-j', 'ACCEPT'])
+            #accept any arp requests from this vm. In the future this can be restricted to deny attacks on hosts
+            #also important to restrict source ip and src mac in these requests as they can be used to update arp tables on destination
+            util.pread2(['arptables',  '-A', vm_chain, '-i', vif, '--opcode', 'Request',  '--source-mac',  vm_mac, '--source-ip',  vm_ip, '-j', 'RETURN'])
+            #accept any arp requests to this vm as long as the request is for this vm's ip
+            util.pread2(['arptables',  '-A', vm_chain, '-o', vif, '--opcode', 'Request', '--destination-ip', vm_ip, '-j', 'ACCEPT'])
+            #accept any arp replies to this vm as long as the mac and ip matches
+            util.pread2(['arptables',  '-A', vm_chain, '-o', vif, '--opcode', 'Reply', '--destination-mac', vm_mac, '--destination-ip', vm_ip, '-j', 'ACCEPT'])
+        util.pread2(['arptables',  '-A', vm_chain,  '-j', 'DROP'])
+
+    except:
+        logging.debug("Failed to program default arptables  rules")
+        return 'false'
+
+    return 'true'
+
+
+@echo
+def network_rules_vmSecondaryIp(session, args):
+    vm_name = args.pop('vmName')
+    vm_mac = args.pop('vmMac')
+    ip_secondary = args.pop('vmSecIp')
+    action = args.pop('action')
+    logging.debug("vmMac = "+ vm_mac)
+    logging.debug("vmName = "+ vm_name)
+    #action = "-A"
+    logging.debug("action = "+ action)
+    try:
+        vm = session.xenapi.VM.get_by_name_label(vm_name)
+        if len(vm) != 1:
+            return 'false'
+        vm_rec = session.xenapi.VM.get_record(vm[0])
+        vm_vifs = vm_rec.get('VIFs')
+        vifnums = [session.xenapi.VIF.get_record(vif).get('device') for vif in vm_vifs]
+        domid = vm_rec.get('domid')
+    except:
+        logging.debug("### Failed to get domid or vif list for vm  ##" + vm_name)
+        return 'false'
+
+    if domid == '-1':
+        logging.debug("### Failed to get domid for vm (-1):  " + vm_name)
+        return 'false'
+
+    vifs = ["vif" + domid + "." + v for v in vifnums]
+    #vm_name =  '-'.join(vm_name.split('-')[:-1])
+    vmchain = chain_name(vm_name)
+    add_to_ipset(vmchain, [ip_secondary], action)
+
+    #add arptables rules for the secondary ip
+    arp_rules_vmip(vmchain, vifs, [ip_secondary], vm_mac, action)
+
+    return 'true'
+
+@echo
+def default_network_rules_systemvm(session, args):
+    try:
+        util.pread2(['/bin/bash', '-c', 'iptables -n -L FORWARD | grep BRIDGE-FIREWALL'])
+    except:
+        can_bridge_firewall(session, args)
+
+    vm_name = args.pop('vmName')
+    try:
+        vm = session.xenapi.VM.get_by_name_label(vm_name)
+        if len(vm) != 1:
+            return 'false'
+        vm_rec = session.xenapi.VM.get_record(vm[0])
+        vm_vifs = vm_rec.get('VIFs')
+        vifnums = [session.xenapi.VIF.get_record(vif).get('device') for vif in vm_vifs]
+        domid = vm_rec.get('domid')
+    except:
+        logging.debug("### Failed to get domid or vif list for vm  ##" + vm_name)
+        return 'false'
+
+    if domid == '-1':
+        logging.debug("### Failed to get domid for vm (-1):  " + vm_name)
+        return 'false'
+
+    vifs = ["vif" + domid + "." + v for v in vifnums]
+    #vm_name =  '-'.join(vm_name.split('-')[:-1])
+    vmchain = chain_name(vm_name)
+
+
+    delete_rules_for_vm_in_bridge_firewall_chain(vm_name)
+
+    try:
+        util.pread2(['iptables', '-N', vmchain])
+    except:
+        util.pread2(['iptables', '-F', vmchain])
+
+    for vif in vifs:
+        try:
+            util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', vif, '-j', vmchain])
+            util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '2', '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', vif, '-j', vmchain])
+            util.pread2(['iptables', '-I', vmchain, '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', vif, '-j', 'RETURN'])
+        except:
+            logging.debug("Failed to program default rules")
+            return 'false'
+
+    util.pread2(['iptables', '-A', vmchain, '-j', 'ACCEPT'])
+
+    if write_rule_log_for_vm(vm_name, '-1', '_ignore_', domid, '_initial_', '-1') == False:
+        logging.debug("Failed to log default network rules for systemvm, ignoring")
+    return 'true'
+
+@echo
+def create_ipset_forvm (ipsetname):
+    result = True
+    type = getIpsetType()
+    try:
+        logging.debug("Creating ipset chain .... " + ipsetname)
+        util.pread2(['ipset', '-F', ipsetname])
+        util.pread2(['ipset', '-X', ipsetname])
+        util.pread2(['ipset', '-N', ipsetname, type])
+    except:
+        logging.debug("ipset chain not exists creating.... " + ipsetname)
+        util.pread2(['ipset', '-N', ipsetname, type])
+
+    return result
+
+@echo
+def add_to_ipset(ipsetname, ips, action):
+    result = True
+    for ip in ips:
+        try:
+            logging.debug("vm ip " + ip)
+            util.pread2(['ipset', action, ipsetname, ip])
+        except:
+            logging.debug("vm ip already in ip set" + ip)
+            continue
+
+    return result
+
+@echo
+def arp_rules_vmip (vm_chain, vifs, ips, vm_mac, action):
+    try:
+        if action == "-A":
+            action = "-I"
+        for vif in vifs:
+            for vm_ip in ips:
+                #accept any arp requests to this vm as long as the request is for this vm's ip
+                util.pread2(['arptables',  action, vm_chain, '-o', vif, '--opcode', 'Request', '--destination-ip', vm_ip, '-j', 'ACCEPT'])
+                #accept any arp replies to this vm as long as the mac and ip matches
+                util.pread2(['arptables',  action, vm_chain, '-o', vif, '--opcode', 'Reply', '--destination-mac', vm_mac, '--destination-ip', vm_ip, '-j', 'ACCEPT'])
+                #accept arp replies into the bridge as long as the source mac and ips match the vm
+                util.pread2(['arptables',  action, vm_chain, '-i', vif, '--opcode', 'Reply', '--source-mac',  vm_mac, '--source-ip',  vm_ip, '-j', 'ACCEPT'])
+                #accept any arp requests from this vm. In the future this can be restricted to deny attacks on hosts
+                #also important to restrict source ip and src mac in these requests as they can be used to update arp tables on destination
+                util.pread2(['arptables',  action, vm_chain, '-i', vif, '--opcode', 'Request',  '--source-mac',  vm_mac, '--source-ip',  vm_ip, '-j', 'RETURN'])
+    except:
+        logging.debug("Failed to program arptables  rules for ip")
+        return 'false'
+
+    return 'true'
+
+
+@echo
+def default_network_rules(session, args):
+    vm_name = args.pop('vmName')
+    vm_ip = args.pop('vmIP')
+    vm_id = args.pop('vmID')
+    vm_mac = args.pop('vmMAC')
+    sec_ips = args.pop("secIps")
+    action = "-A"
+
+    try:
+        vm = session.xenapi.VM.get_by_name_label(vm_name)
+        if len(vm) != 1:
+            logging.debug("### Failed to get record for vm  " + vm_name)
+            return 'false'
+        vm_rec = session.xenapi.VM.get_record(vm[0])
+        domid = vm_rec.get('domid')
+    except:
+        logging.debug("### Failed to get domid for vm " + vm_name)
+        return 'false'
+    if domid == '-1':
+        logging.debug("### Failed to get domid for vm (-1):  " + vm_name)
+        return 'false'
+
+    vif = "vif" + domid + ".0"
+    tap = "tap" + domid + ".0"
+    vifs = [vif]
+    try:
+        util.pread2(['ifconfig', tap])
+        vifs.append(tap)
+    except:
+        pass
+
+    delete_rules_for_vm_in_bridge_firewall_chain(vm_name)
+
+
+    vmchain =  chain_name(vm_name)
+    vmchain_egress =  egress_chain_name(vm_name)
+    vmchain_default = chain_name_def(vm_name)
+
+    destroy_ebtables_rules(vmchain)
+
+    try:
+        util.pread2(['iptables', '-N', vmchain])
+    except:
+        util.pread2(['iptables', '-F', vmchain])
+
+    try:
+        util.pread2(['iptables', '-N', vmchain_egress])
+    except:
+        util.pread2(['iptables', '-F', vmchain_egress])
+
+    try:
+        util.pread2(['iptables', '-N', vmchain_default])
+    except:
+        util.pread2(['iptables', '-F', vmchain_default])
+
+    vmipset = vm_name
+    if len(vmipset) > 28:
+        vmipset = vmipset[0:27]
+    #create ipset and add vm ips to that ip set
+    if create_ipset_forvm(vmipset) == False:
+        logging.debug(" failed to create ipset for rule " + str(tokens))
+        return 'false'
+
+    #add primary nic ip to ipset
+    if add_to_ipset(vmipset, [vm_ip], action ) == False:
+        logging.debug(" failed to add vm " + vm_ip + " ip to set ")
+        return 'false'
+
+    #add secondary nic ips to ipset
+    secIpSet = "1"
+    ips = sec_ips.split(';')
+    ips.pop()
+    if ips[0] == "0":
+        secIpSet = "0";
+
+    if secIpSet == "1":
+        logging.debug("Adding ipset for secondary ips")
+        add_to_ipset(vmipset, ips, action)
+        if write_secip_log_for_vm(vm_name, sec_ips, vm_id) == False:
+            logging.debug("Failed to log default network rules, ignoring")
+
+    keyword = '--' + get_ipset_keyword()
+
+    try:
+        for v in vifs:
+            util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', v, '-j', vmchain_default])
+            util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '2', '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '-j', vmchain_default])
+
+        #don't let vm spoof its ip address
+        for v in vifs:
+            #util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '--source', vm_ip,'-p', 'udp', '--dport', '53', '-j', 'RETURN'])
+            util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '-m', 'set', keyword, vmipset, 'src', '-p', 'udp', '--dport', '53', '-j', 'RETURN'])
+            util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '-m', 'set', '!', keyword, vmipset, 'src', '-j', 'DROP'])
+            util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', v, '-m', 'set', '!', keyword, vmipset, 'dst', '-j', 'DROP'])
+            util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '-m', 'set', keyword, vmipset, 'src', '-j', vmchain_egress])
+            util.pread2(['iptables', '-A', vmchain_default, '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', v,  '-j', vmchain])
+    except:
+        logging.debug("Failed to program default rules for vm " + vm_name)
+        return 'false'
+
+    default_arp_antispoof(vmchain, vifs, vm_ip, vm_mac)
+    #add default arp rules for secondary ips;
+    if secIpSet == "1":
+        logging.debug("Adding arp rules for sec ip")
+        arp_rules_vmip(vmchain, vifs, ips, vm_mac, action)
+
+    default_ebtables_antispoof_rules(vmchain, vifs, vm_ip, vm_mac)
+
+    if write_rule_log_for_vm(vm_name, vm_id, vm_ip, domid, '_initial_', '-1', vm_mac) == False:
+        logging.debug("Failed to log default network rules, ignoring")
+
+    logging.debug("Programmed default rules for vm " + vm_name)
+    return 'true'
+
+@echo
+def check_domid_changed(session, vmName):
+    curr_domid = '-1'
+    try:
+        vm = session.xenapi.VM.get_by_name_label(vmName)
+        if len(vm) != 1:
+            logging.debug("### Could not get record for vm ## " + vmName)
+        else:
+            vm_rec = session.xenapi.VM.get_record(vm[0])
+            curr_domid = vm_rec.get('domid')
+    except:
+        logging.debug("### Failed to get domid for vm  ## " + vmName)
+
+
+    logfilename = "/var/run/cloud/" + vmName +".log"
+    if not os.path.exists(logfilename):
+        return ['-1', curr_domid]
+
+    lines = (line.rstrip() for line in open(logfilename))
+
+    [_vmName,_vmID,_vmIP,old_domid,_signature,_seqno, _vmMac] = ['_', '-1', '_', '-1', '_', '-1', 'ff:ff:ff:ff:ff:ff']
+    for line in lines:
+        try:
+            [_vmName,_vmID,_vmIP,old_domid,_signature,_seqno,_vmMac] = line.split(',')
+        except ValueError as v:
+            [_vmName,_vmID,_vmIP,old_domid,_signature,_seqno] = line.split(',')
+        break
+
+    return [curr_domid, old_domid]
+
+@echo
+def delete_rules_for_vm_in_bridge_firewall_chain(vmName):
+    vm_name = vmName
+    vmchain = chain_name_def(vm_name)
+
+    delcmd = "iptables-save | grep '\-A BRIDGE-FIREWALL' | grep '%s' | sed 's/-A/-D/'" % vmchain
+    delcmds = util.pread2(['/bin/bash', '-c', delcmd]).split('\n')
+    for cmd in filter(None, delcmds):
+        try:
+            dc = 'iptables ' + cmd
+            util.pread2(filter(None, dc.split(' ')))
+        except:
+            logging.debug("Ignoring failure to delete rules for vm " + vmName)
+
+@echo
+def network_rules_for_rebooted_vm(session, vmName):
+    vm_name = vmName
+    [curr_domid, old_domid] = check_domid_changed(session, vm_name)
+
+    if curr_domid == old_domid:
+        return True
+
+    if old_domid == '-1':
+        return True
+
+    if curr_domid == '-1':
+        return True
+
+    logging.debug("Found a rebooted VM -- reprogramming rules for  " + vm_name)
+
+    delete_rules_for_vm_in_bridge_firewall_chain(vm_name)
+    if 1 in [ vm_name.startswith(c) for c in ['r-', 's-', 'v-', 'l-'] ]:
+        default_network_rules_systemvm(session, {"vmName":vm_name})
+        return True
+
+    vif = "vif" + curr_domid + ".0"
+    tap = "tap" + curr_domid + ".0"
+    vifs = [vif]
+    try:
+        util.pread2(['ifconfig', tap])
+        vifs.append(tap)
+    except:
+        pass
+    vmchain = chain_name(vm_name)
+    vmchain_default = chain_name_def(vm_name)
+
+    for v in vifs:
+        util.pread2(['iptables', '-A', 'BRIDGE-FIREWALL', '-m', 'physdev', '--physdev-is-bridged', '--physdev-out', v, '-j', vmchain_default])
+        util.pread2(['iptables', '-I', 'BRIDGE-FIREWALL', '2', '-m', 'physdev', '--physdev-is-bridged', '--physdev-in', v, '-j', vmchain_default])
+
+    #change antispoof rule in vmchain
+    try:
+        delcmd = "iptables-save | grep '\-A " +  vmchain_default + "' | grep  physdev-in | sed 's/!--set/! --set/' | sed 's/-A/-D/'"
+        delcmd2 = "iptables-save | grep '\-A " +  vmchain_default + "' | grep  physdev-out | sed 's/!--set/! --set/'| sed 's/-A/-D/'"
+        inscmd = "iptables-save | grep '\-A " +  vmchain_default + "' | grep  physdev-in | grep vif | sed -r 's/vif[0-9]+.0/" + vif + "/' | sed 's/!--set/! --set/'"
+        inscmd2 = "iptables-save| grep '\-A " +  vmchain_default + "' | grep  physdev-in | grep tap | sed -r 's/tap[0-9]+.0/" + tap + "/' | sed 's/!--set/! --set/'"
+        inscmd3 = "iptables-save | grep '\-A " +  vmchain_default + "' | grep  physdev-out | grep vif | sed -r 's/vif[0-9]+.0/" + vif + "/' | sed 's/!--set/! --set/'"
+        inscmd4 = "iptables-save| grep '\-A " +  vmchain_default + "' | grep  physdev-out | grep tap | sed -r 's/tap[0-9]+.0/" + tap + "/'  | sed 's/!--set/! --set/'"
+
+        ipts = []
+        for cmd in [delcmd, delcmd2, inscmd, inscmd2, inscmd3, inscmd4]:
+            cmds = util.pread2(['/bin/bash', '-c', cmd]).split('\n')
+            cmds.pop()
+            for c in filter(None,cmds):
+                ipt = c.split(' ')
+                ipt.insert(0, 'iptables')
+                ipts.append(ipt)
+
+        for ipt in ipts:
+            try:
+                util.pread2(filter(None,ipt))
+            except:
+                logging.debug("Failed to rewrite antispoofing rules for vm " + vm_name)
+    except:
+        logging.debug("No rules found for vm " + vm_name)
+
+    destroy_ebtables_rules(vmchain)
+    destroy_arptables_rules(vmchain)
+    [vm_ip, vm_mac] = get_vm_mac_ip_from_log(vmchain)
+    default_arp_antispoof(vmchain, vifs, vm_ip, vm_mac)
+
+    #check whether the vm has secondary ips
+    if is_secondary_ips_set(vm_name) == True:
+        vmips = get_vm_sec_ips(vm_name)
+        #add arp rules for the secondaryp ip
+        for ip in vmips:
+            arp_rules_vmip(vmchain, vifs, [ip], vm_mac, "-A")
+
+
+    default_ebtables_antispoof_rules(vmchain, vifs, vm_ip, vm_mac)
+    rewrite_rule_log_for_vm(vm_name, curr_domid)
+    return True
+
+
+
+@echo
+def get_vm_sec_ips(vm_name):
+    logfilename = "/var/run/cloud/" + vm_name +".ip"
+
+    lines = (line.rstrip() for line in open(logfilename))
+    for line in lines:
+        try:
+            [_vmName,_vmIP,_vmID] = line.split(',')
+            break
+        except ValueError as v:
+            [_vmName,_vmIP,_vmID] = line.split(',')
+
+    _vmIPS = _vmIP.split(":")[:-1]
+    return _vmIPS
+
+@echo
+def is_secondary_ips_set(vm_name):
+    logfilename = "/var/run/cloud/" + vm_name +".ip"
+    if not os.path.exists(logfilename):
+        return False
+
+    return True
+
+@echo
+def rewrite_rule_log_for_vm(vm_name, new_domid):
+    logfilename = "/var/run/cloud/" + vm_name +".log"
+    if not os.path.exists(logfilename):
+        return
+    lines = (line.rstrip() for line in open(logfilename))
+
+    [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = ['_', '-1', '_', '-1', '_', '-1','ff:ff:ff:ff:ff:ff']
+    for line in lines:
+        try:
+            [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = line.split(',')
+            break
+        except ValueError as v:
+            [_vmName,_vmID,_vmIP,_domID,_signature,_seqno] = line.split(',')
+
+    write_rule_log_for_vm(_vmName, _vmID, _vmIP, new_domid, _signature, '-1', _vmMac)
+
+def get_rule_log_for_vm(session, vmName):
+    vm_name = vmName;
+    logfilename = "/var/run/cloud/" + vm_name +".log"
+    if not os.path.exists(logfilename):
+        return ''
+
+    lines = (line.rstrip() for line in open(logfilename))
+
+    [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = ['_', '-1', '_', '-1', '_', '-1', 'ff:ff:ff:ff:ff:ff']
+    for line in lines:
+        try:
+            [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = line.split(',')
+            break
+        except ValueError as v:
+            [_vmName,_vmID,_vmIP,_domID,_signature,_seqno] = line.split(',')
+
+    return ','.join([_vmName, _vmID, _vmIP, _domID, _signature, _seqno])
+
+@echo
+def get_vm_mac_ip_from_log(vm_name):
+    [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = ['_', '-1', '0.0.0.0', '-1', '_', '-1','ff:ff:ff:ff:ff:ff']
+    logfilename = "/var/run/cloud/" + vm_name +".log"
+    if not os.path.exists(logfilename):
+        return ['_', '_']
+
+    lines = (line.rstrip() for line in open(logfilename))
+    for line in lines:
+        try:
+            [_vmName,_vmID,_vmIP,_domID,_signature,_seqno,_vmMac] = line.split(',')
+            break
+        except ValueError as v:
+            [_vmName,_vmID,_vmIP,_domID,_signature,_seqno] = line.split(',')
+
+    return [ _vmIP, _vmMac]
+
+@echo
+def get_rule_logs_for_vms(session, args):
+    host_uuid = args.pop('host_uuid')
+    try:
+        thishost = session.xenapi.host.get_by_uuid(host_uuid)
+        hostrec = session.xenapi.host.get_record(thishost)
+        vms = hostrec.get('resident_VMs')
+    except:
+        logging.debug("Failed to get host from uuid " + host_uuid)
+        return ' '
+
+    result = []
+    try:
+        for name in [session.xenapi.VM.get_name_label(x) for x in vms]:
+            if 1 not in [ name.startswith(c) for c in ['r-', 's-', 'v-', 'i-', 'l-'] ]:
+                continue
+            network_rules_for_rebooted_vm(session, name)
+            if name.startswith('i-'):
+                log = get_rule_log_for_vm(session, name)
+                result.append(log)
+    except:
+        logging.debug("Failed to get rule logs, better luck next time!")
+
+    return ";".join(result)
+
+@echo
+def cleanup_rules_for_dead_vms(session):
+    try:
+        vms = session.xenapi.VM.get_all()
+        cleaned = 0
+        for vm_name in [session.xenapi.VM.get_name_label(x) for x in vms]:
+            if 1 in [ vm_name.startswith(c) for c in ['r-', 'i-', 's-', 'v-', 'l-'] ]:
+                vm = session.xenapi.VM.get_by_name_label(vm_name)
+                if len(vm) != 1:
+                    continue
+                vm_rec = session.xenapi.VM.get_record(vm[0])
+                state = vm_rec.get('power_state')
+                if state != 'Running' and state != 'Paused':
+                    logging.debug("vm " + vm_name + " is not running, cleaning up")
+                    destroy_network_rules_for_vm(session, {'vmName':vm_name})
+                    cleaned = cleaned+1
+
+        logging.debug("Cleaned up rules for " + str(cleaned) + " vms")
+    except:
+        logging.debug("Failed to cleanup rules for dead vms!")
+
+
+@echo
+def cleanup_rules(session, args):
+    instance = args.get('instance')
+    if not instance:
+        instance = 'VM'
+    resident_vms = []
+    try:
+        hostname = util.pread2(['/bin/bash', '-c', 'hostname']).split('\n')
+        if len(hostname) < 1:
+            raise Exception('Could not find hostname of this host')
+        thishost = session.xenapi.host.get_by_name_label(hostname[0])
+        if len(thishost) < 1:
+            raise Exception("Could not find host record from hostname %s of this host"%hostname[0])
+        hostrec = session.xenapi.host.get_record(thishost[0])
+        vms = hostrec.get('resident_VMs')
+        resident_vms = [session.xenapi.VM.get_name_label(x) for x in vms]
+        util.SMlog('cleanup_rules: resident_vms= %s' %resident_vms)
+        util.SMlog('cleanup_rules: found %s resident vms on this host %s' % (len(resident_vms)-1, hostname[0]))
+
+        chainscmd = "iptables-save | grep '^:' | awk '{print $1}' | cut -d':' -f2 | sed 's/-def//'| sed 's/-eg//' | sort|uniq"
+        chains = util.pread2(['/bin/bash', '-c', chainscmd]).split('\n')
+        vmchains = [ch  for ch in chains if 1 in [ ch.startswith(c) for c in ['r-', 'i-', 's-', 'v-', 'l-']]]

Review Comment:
   ```suggestion
           vmchains = [ch for ch in chains if 1 in [ ch.startswith(c) for c in ['r-', 'i-', 's-', 'v-', 'l-']]]
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2798185638

   @Pearl1594 a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2799136002

   <b>[SF] Trillian test result (tid-12966)</b>
   Environment: xenserver-84 (x2), Advanced Networking with Mgmt server ol8
   Total time taken: 76707 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10684-t12966-xenserver-84.zip
   Smoke tests completed. 128 look OK, 13 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_guest_OS_mapping_check_with_hypervisor | `Error` | 0.05 | test_guest_os.py
   test_01_condensed_drs_algorithm | `Failure` | 214.52 | test_cluster_drs.py
   test_02_balanced_drs_algorithm | `Failure` | 180.50 | test_cluster_drs.py
   test_07_deploy_vm_with_extraconfig_xenserver | `Error` | 120.95 | test_deploy_vm_extra_config_data.py
   test_01_verify_ipv6_network | `Failure` | 754.07 | test_network_ipv6.py
   ContextSuite context=TestSharedNetworkWithConfigDrive>:setup | `Error` | 10.57 | test_network.py
   test_01_non_strict_host_anti_affinity | `Error` | 200.07 | test_nonstrict_affinity_group.py
   test_02_non_strict_host_affinity | `Error` | 112.00 | test_nonstrict_affinity_group.py
   test_02_create_volume | `Error` | 4.24 | test_resource_names.py
   test_02_RVR_Network_FW_PF_SSH_default_routes_egress_false | `Failure` | 505.51 | test_routers_network_ops.py
   test_03_RVR_Network_check_router_state | `Failure` | 285.74 | test_routers_network_ops.py
   test_04_extract_template | `Failure` | 1.10 | test_templates.py
   test_01_scale_up_verify | `Failure` | 516.27 | test_vm_autoscaling.py
   test_02_update_vmprofile_and_vmgroup | `Failure` | 256.82 | test_vm_autoscaling.py
   test_06_download_detached_volume | `Failure` | 199.81 | test_volumes.py
   test_01_verify_ipv6_vpc | `Failure` | 745.97 | test_vpc_ipv6.py
   test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | `Failure` | 594.36 | test_vpc_redundant.py
   test_02_redundant_VPC_default_routes | `Failure` | 547.24 | test_vpc_redundant.py
   test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers | `Failure` | 367.66 | test_vpc_redundant.py
   test_04_rvpc_network_garbage_collector_nics | `Failure` | 305.82 | test_vpc_redundant.py
   test_05_rvpc_multi_tiers | `Failure` | 505.29 | test_vpc_redundant.py
   test_05_rvpc_multi_tiers | `Error` | 505.32 | test_vpc_redundant.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2795440108

   @Pearl1594 a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2795586162

   @blueorangutan test ol8 xenserver-84 keepEnv


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2844566505

   Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13232


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2820575676

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=10684&metric=new_coverage&view=list) (required ≥ 40%)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Maintainability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2828367641

   > I'll investigate it on XCP-ng side, must be the newer Open vSwitch version (compared to 7.6/8.2) we share with XenServer, maybe some default behavior.
   
   thanks a lot @bleader 
   
   I also suspect it is due to different OVS version (2.5 vs 2.17). but could not figure out what caused it.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2823417738

   Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13140


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2824426127

   @Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + xcpng83) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2862141030

   @Pearl1594 a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "rohityadavcloud (via GitHub)" <gi...@apache.org>.
rohityadavcloud commented on code in PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#discussion_r2037260835


##########
scripts/vm/hypervisor/xenserver/xenserver84/vmops:
##########
@@ -0,0 +1,1607 @@
+#!/usr/bin/python

Review Comment:
   suggestion - should this be /usr/bin/python3 (or use /usr/bin/env python3)? cc @Pearl1594 @harikrishna-patnala @weizhouapache - this would need to be added on all the .py scripts that must run with py3.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on code in PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#discussion_r2037556319


##########
scripts/vm/hypervisor/xenserver/xenserver84/vmopsSnapshot:
##########
@@ -0,0 +1,622 @@
+#!/usr/bin/python

Review Comment:
   btw: is there a script named `vmopspremium` ?



##########
scripts/vm/hypervisor/xenserver/xenserver84/vmopsSnapshot:
##########
@@ -0,0 +1,622 @@
+#!/usr/bin/python

Review Comment:
   python3 too ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2794211665

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2795809596

   @Pearl1594 a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2840922475

   <b>[SF] Trillian test result (tid-13180)</b>
   Environment: xcpng83 (x2), Advanced Networking with Mgmt server ol8
   Total time taken: 77774 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10684-t13180-xcpng83.zip
   Smoke tests completed. 135 look OK, 6 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_07_deploy_vm_with_extraconfig_xenserver | `Error` | 133.70 | test_deploy_vm_extra_config_data.py
   ContextSuite context=TestSharedNetworkWithConfigDrive>:setup | `Error` | 10.76 | test_network.py
   test_02_create_volume | `Error` | 2.26 | test_resource_names.py
   test_04_extract_template | `Failure` | 1.11 | test_templates.py
   test_02_restore_vm_strict_tags_failure | `Failure` | 78.94 | test_vm_strict_host_tags.py
   test_02_scale_vm_strict_tags_failure | `Failure` | 81.12 | test_vm_strict_host_tags.py
   test_06_deploy_vm_on_any_host_with_strict_tags_failure | `Failure` | 4.74 | test_vm_strict_host_tags.py
   test_06_download_detached_volume | `Failure` | 204.97 | test_volumes.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2837899367

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=10684&metric=new_coverage&view=list) (required ≥ 40%)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Maintainability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2837549561

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2837867020

   @blueorangutan test ol8 xcpng83


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2821250672

   @olivierlambert
   When we tested redundant VRs with this PR, we faced the issue that both VRs become PRIMARY if they run on different hosts.
   In our investigation,we found that the multicast packet (for VRRP) can be captureed on xenbr1 bridge on the host, but it is not forwarded to the xenbr1 bridge on another host. The problem does not exist with xcpng 76 and 82.
   
   Do you have idea what might cause it ? Maybe some settings are missing.
   we checked the iptables rules on the xcp-ng 76/82/84 hosts, they look almost the same.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2831984274

   @Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + xcpng83) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2868270232

   <b>[SF] Trillian test result (tid-13242)</b>
   Environment: xcpng83 (x2), Advanced Networking with Mgmt server ol8
   Total time taken: 75161 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10684-t13242-xcpng83.zip
   Smoke tests completed. 140 look OK, 1 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   ContextSuite context=TestSharedNetworkWithConfigDrive>:setup | `Error` | 1532.02 | test_network.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2862359658

   Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13297


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2875542084

   <b>[SF] Trillian Build Failed (tid-13286)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2798252485

   Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13024


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2795539786

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=10684&metric=new_coverage&view=list) (required ≥ 40%)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [E Maintainability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2795884814

   Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13017


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2795673571

   <b>[SF] Trillian Build Failed (tid-12947)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2807213416

   @Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + xenserver-84) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2800366325

   @blueorangutan test ol8 xenserver-84


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 closed pull request #10684: [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible
URL: https://github.com/apache/cloudstack/pull/10684


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2807208132

   @blueorangutan test ol8 xenserver-84


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2823420886

   @blueorangutan test ol8 xcpng83 keepEnv


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2840808221

   <b>[SF] Trillian test result (tid-13179)</b>
   Environment: xenserver-84 (x2), Advanced Networking with Mgmt server ol8
   Total time taken: 73095 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10684-t13179-xenserver-84.zip
   Smoke tests completed. 135 look OK, 6 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_07_deploy_vm_with_extraconfig_xenserver | `Error` | 121.41 | test_deploy_vm_extra_config_data.py
   ContextSuite context=TestSharedNetworkWithConfigDrive>:setup | `Error` | 9.82 | test_network.py
   test_02_create_volume | `Error` | 3.28 | test_resource_names.py
   test_04_extract_template | `Failure` | 1.10 | test_templates.py
   test_02_restore_vm_strict_tags_failure | `Failure` | 90.25 | test_vm_strict_host_tags.py
   test_02_scale_vm_strict_tags_failure | `Failure` | 77.22 | test_vm_strict_host_tags.py
   test_06_deploy_vm_on_any_host_with_strict_tags_failure | `Failure` | 6.76 | test_vm_strict_host_tags.py
   test_06_download_detached_volume | `Failure` | 198.84 | test_volumes.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#discussion_r2065738410


##########
plugins/hypervisors/ovm/pom.xml:
##########
@@ -29,7 +29,7 @@
     </parent>
     <dependencies>
         <dependency>
-            <groupId>net.java.dev.vcc.thirdparty</groupId>
+            <groupId>com.citrix.hypervisor</groupId>

Review Comment:
   I think we should (instead) deprecate ovm?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2853190636

   @Pearl1594 a [SL] Trillian-Jenkins matrix job (EL8 mgmt + EL8 KVM, Ubuntu22 mgmt + Ubuntu22 KVM, EL8 mgmt + VMware 7.0u3, EL9 mgmt + XCP-ng 8.2 ) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2853192869

   @blueorangutan test ol8 xenserver-84


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "rohityadavcloud (via GitHub)" <gi...@apache.org>.
rohityadavcloud commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2792346490

   Good to see this, @Pearl1594 can we also add support for XCP-ng 8.3 (& related files as needed)? cc @weizhouapache @harikrishna-patnala 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on code in PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#discussion_r2037393214


##########
scripts/vm/hypervisor/xenserver/xenserver84/vmops:
##########
@@ -0,0 +1,1607 @@
+#!/usr/bin/python

Review Comment:
   `/usr/bin/env python3` looks good



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2792382047

   yes @rohityadavcloud . Working with @harikrishna-patnala towards that. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2795684341

   Hosts get added, but systemVMs fail to come up due to missing SR of name "XenServer Tools or XCP-ng Tools or Citrix Hypervisor Tools"


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2798373629

   @Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + xenserver-84) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2800367761

   @Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + xenserver-84) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2816320984

   @blueorangutan test ol8 xenserver-84


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2820442986

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2821224322

   <b>[SF] Trillian Build Failed (tid-13085)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2828003439

   > @weizhouapache I have no idea. I'm not familiar with this, but maybe we might have someone internally who is. Let me ask around.
   
   @olivierlambert 
   after some investigation, we found that multicast (for example vrrp) packet can be sent from xs/xcp-ng host (other rocky/ubuntu hosts in the same network can receive the packets), but the host cannot receive the multicast packets from other hosts in the same network.
   It happens not only with the vm bridges (xapiXX), but also the default bridges (xenbr0, xenbr1)
   
   xcpng 7.6/8.2 hosts work, but 8.3/8.4 hosts do not.
   
   cc @Pearl1594 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2823589297

   <b>[SF] Trillian Build Failed (tid-13095)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2823723733

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "bleader (via GitHub)" <gi...@apache.org>.
bleader commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2828351152

   I'll investigate it on XCP-ng side, must be the newer Open vSwitch version (compared to 7.6/8.2) we share with XenServer, maybe some default behavior.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland merged PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2829413492

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=10684&metric=new_coverage&view=list) (required ≥ 40%)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Maintainability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2790871272

   @weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + xenserver-84) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2794057815

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=10684&metric=new_coverage&view=list) (required ≥ 40%)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2837752932

   Ran successfully with new template:
   ```
   Create a redundant VPC with two networks with two VMs in each network ... === TestName: test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | Status : SUCCESS ===
   ok
   Create a redundant VPC with two networks with two VMs in each network and check default routes ... === TestName: test_02_redundant_VPC_default_routes | Status : SUCCESS ===
   ok
   Create a redundant VPC with two networks with two VMs in each network ... === TestName: test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers | Status : SUCCESS ===
   ok
   Create a redundant VPC with 1 Tier, 1 VM, 1 ACL, 1 PF and test Network GC Nics ... === TestName: test_04_rvpc_network_garbage_collector_nics | Status : SUCCESS ===
   ok
   Create a redundant VPC with multiple tiers ... === TestName: test_05_rvpc_multi_tiers | Status : SUCCESS ===
   ok
   
   ----------------------------------------------------------------------
   Ran 5 tests in 4867.242s
   
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2837554495

   @Pearl1594 a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2820907757

   @blueorangutan test ol8 xcpng83


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2853193497

   @blueorangutan test ol8 xcpng83


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2798147853

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=10684&metric=new_coverage&view=list) (required ≥ 40%)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [E Maintainability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2808534512

   <b>[SF] Trillian Build Failed (tid-13006)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2795580838

   <b>[SF] Trillian Build Failed (tid-12946)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2790865988

   @blueorangutan test ol8 xenserver-84 keepEnv


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2794453174

   Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13010


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2790638882

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=10684&metric=new_coverage&view=list) (required ≥ 40%)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on code in PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#discussion_r2037622871


##########
scripts/vm/hypervisor/xenserver/xenserver84/vmopsSnapshot:
##########
@@ -0,0 +1,622 @@
+#!/usr/bin/python

Review Comment:
   my bad - seems like I changed it on the env I was testing on :facepalm: 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2809132722

   This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2798181451

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2798374608

   @Pearl1594 [SL] unsupported parameters provided. Supported mgmt server os are: `ol8, ol9, debian12, rocky8, alma9, suse15, centos7, centos6, alma8, ubuntu18, ubuntu22, ubuntu20, ubuntu24`. Supported hypervisors are: `kvm-centos6, kvm-centos7, kvm-rocky8, kvm-ol8, kvm-ol9, kvm-alma8, kvm-alma9, kvm-ubuntu18, kvm-ubuntu20, kvm-ubuntu22, kvm-ubuntu24, kvm-debian12, kvm-suse15, vmware-55u3, vmware-60u2, vmware-65u2, vmware-67u3, vmware-70u1, vmware-70u2, vmware-70u3, vmware-80, vmware-80u1, vmware-80u2, vmware-80u3, xenserver-65sp1, xenserver-71, xenserver-74, xenserver-84, xcpng74, xcpng76, xcpng80, xcpng81, xcpng82, xcpng83`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2844440768

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=10684&metric=new_coverage&view=list) (required ≥ 40%)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Maintainability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2851435430

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=10684&metric=new_coverage&view=list) (required ≥ 40%)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Maintainability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2853193346

   @Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + xenserver-84) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2856061036

   <b>[SF] Trillian test result (tid-13207)</b>
   Environment: kvm-ubuntu22 (x2), Advanced Networking with Mgmt server u22
   Total time taken: 61798 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10684-t13207-kvm-ubuntu22.zip
   Smoke tests completed. 139 look OK, 2 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_oobm_multiple_mgmt_server_ownership | `Failure` | 30.88 | test_outofbandmanagement.py
   test_02_list_cpvm_vm | `Failure` | 0.04 | test_ssvm.py
   test_04_cpvm_internals | `Failure` | 0.05 | test_ssvm.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2856425001

   <b>[SF] Trillian test result (tid-13208)</b>
   Environment: vmware-70u3 (x2), Advanced Networking with Mgmt server ol8
   Total time taken: 67120 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10684-t13208-vmware-70u3.zip
   Smoke tests completed. 138 look OK, 3 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_01_deployVMInSharedNetwork | `Error` | 181.12 | test_network.py
   test_02_restore_vm_with_disk_offering | `Error` | 63.66 | test_restore_vm.py
   test_03_restore_vm_with_disk_offering_custom_size | `Error` | 59.47 | test_restore_vm.py
   test_02_restore_vm_strict_tags_failure | `Error` | 55.85 | test_vm_strict_host_tags.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2856893132

   <b>[SF] Trillian test result (tid-13209)</b>
   Environment: xcpng82 (x2), Advanced Networking with Mgmt server ol9
   Total time taken: 82436 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10684-t13209-xcpng82.zip
   Smoke tests completed. 139 look OK, 2 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   ContextSuite context=TestSharedNetworkWithConfigDrive>:setup | `Error` | 10.60 | test_network.py
   test_10_list_volumes | `Failure` | 371.05 | test_volumes.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2823960229

   Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13144


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2865171930

   @rohityadavcloud a [SL] Trillian-Jenkins test job (ol8 mgmt + xcpng83) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2831982785

   @blueorangutan test ol8 xcpng83


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2833296294

   <b>[SF] Trillian test result (tid-13161)</b>
   Environment: xcpng83 (x2), Advanced Networking with Mgmt server ol8
   Total time taken: 80806 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10684-t13161-xcpng83.zip
   Smoke tests completed. 127 look OK, 14 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_guest_OS_mapping_check_with_hypervisor | `Error` | 0.04 | test_guest_os.py
   test_01_condensed_drs_algorithm | `Failure` | 220.80 | test_cluster_drs.py
   test_02_balanced_drs_algorithm | `Failure` | 181.54 | test_cluster_drs.py
   test_07_deploy_vm_with_extraconfig_xenserver | `Error` | 142.64 | test_deploy_vm_extra_config_data.py
   test_01_verify_ipv6_network | `Failure` | 797.14 | test_network_ipv6.py
   ContextSuite context=TestSharedNetworkWithConfigDrive>:setup | `Error` | 11.62 | test_network.py
   test_01_non_strict_host_anti_affinity | `Error` | 203.53 | test_nonstrict_affinity_group.py
   test_02_non_strict_host_affinity | `Error` | 116.40 | test_nonstrict_affinity_group.py
   test_02_create_volume | `Error` | 4.29 | test_resource_names.py
   test_03_RVR_Network_check_router_state | `Failure` | 308.94 | test_routers_network_ops.py
   test_05_scale_vm_dont_allow_disk_offering_change | `Failure` | 70.71 | test_scale_vm.py
   test_04_extract_template | `Failure` | 1.11 | test_templates.py
   test_02_restore_vm_strict_tags_failure | `Failure` | 96.22 | test_vm_strict_host_tags.py
   test_02_scale_vm_strict_tags_failure | `Failure` | 77.05 | test_vm_strict_host_tags.py
   test_06_deploy_vm_on_any_host_with_strict_tags_failure | `Failure` | 4.64 | test_vm_strict_host_tags.py
   test_06_download_detached_volume | `Failure` | 202.94 | test_volumes.py
   test_01_verify_ipv6_vpc | `Failure` | 793.60 | test_vpc_ipv6.py
   test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | `Failure` | 622.24 | test_vpc_redundant.py
   test_02_redundant_VPC_default_routes | `Failure` | 587.57 | test_vpc_redundant.py
   test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers | `Failure` | 406.79 | test_vpc_redundant.py
   test_04_rvpc_network_garbage_collector_nics | `Failure` | 334.46 | test_vpc_redundant.py
   test_05_rvpc_multi_tiers | `Failure` | 512.49 | test_vpc_redundant.py
   test_05_rvpc_multi_tiers | `Error` | 512.51 | test_vpc_redundant.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2793320277

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2795578220

   @blueorangutan test ol8 xenserver-84 keepEnv


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2795807296

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2803587282

   <b>[SF] Trillian test result (tid-12974)</b>
   Environment: xenserver-84 (x2), Advanced Networking with Mgmt server ol8
   Total time taken: 81949 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10684-t12974-xenserver-84.zip
   Smoke tests completed. 127 look OK, 14 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_guest_OS_mapping_check_with_hypervisor | `Error` | 0.04 | test_guest_os.py
   test_01_condensed_drs_algorithm | `Failure` | 167.50 | test_cluster_drs.py
   test_02_balanced_drs_algorithm | `Failure` | 186.56 | test_cluster_drs.py
   test_07_deploy_vm_with_extraconfig_xenserver | `Error` | 134.62 | test_deploy_vm_extra_config_data.py
   test_01_verify_ipv6_network | `Failure` | 704.49 | test_network_ipv6.py
   ContextSuite context=TestSharedNetworkWithConfigDrive>:setup | `Error` | 7.52 | test_network.py
   test_01_non_strict_host_anti_affinity | `Error` | 214.85 | test_nonstrict_affinity_group.py
   test_02_non_strict_host_affinity | `Error` | 123.46 | test_nonstrict_affinity_group.py
   test_02_create_volume | `Error` | 3.28 | test_resource_names.py
   test_03_RVR_Network_check_router_state | `Failure` | 306.57 | test_routers_network_ops.py
   test_10_reboot_cpvm_forced | `Error` | 12.50 | test_ssvm.py
   test_04_extract_template | `Failure` | 32.15 | test_templates.py
   test_01_volume_usage | `Error` | 108.46 | test_usage.py
   test_06_download_detached_volume | `Failure` | 331.09 | test_volumes.py
   test_01_verify_ipv6_vpc | `Failure` | 745.65 | test_vpc_ipv6.py
   test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | `Failure` | 639.40 | test_vpc_redundant.py
   test_02_redundant_VPC_default_routes | `Failure` | 579.36 | test_vpc_redundant.py
   test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers | `Failure` | 406.15 | test_vpc_redundant.py
   test_04_rvpc_network_garbage_collector_nics | `Failure` | 333.46 | test_vpc_redundant.py
   test_05_rvpc_multi_tiers | `Failure` | 564.28 | test_vpc_redundant.py
   test_05_rvpc_multi_tiers | `Error` | 564.30 | test_vpc_redundant.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2853188023

   @blueorangutan test matrix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2793329133

   @Pearl1594 a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2816853406

   <b>[SF] Trillian test result (tid-13063)</b>
   Environment: xenserver-84 (x2), Advanced Networking with Mgmt server ol8
   Total time taken: 74938 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10684-t13063-xenserver-84.zip
   Smoke tests completed. 129 look OK, 12 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_guest_OS_mapping_check_with_hypervisor | `Error` | 0.04 | test_guest_os.py
   test_01_condensed_drs_algorithm | `Failure` | 217.22 | test_cluster_drs.py
   test_02_balanced_drs_algorithm | `Failure` | 202.17 | test_cluster_drs.py
   test_07_deploy_vm_with_extraconfig_xenserver | `Error` | 144.94 | test_deploy_vm_extra_config_data.py
   test_01_verify_ipv6_network | `Failure` | 742.79 | test_network_ipv6.py
   ContextSuite context=TestSharedNetworkWithConfigDrive>:setup | `Error` | 10.54 | test_network.py
   test_01_non_strict_host_anti_affinity | `Error` | 197.44 | test_nonstrict_affinity_group.py
   test_02_non_strict_host_affinity | `Error` | 121.59 | test_nonstrict_affinity_group.py
   test_02_create_volume | `Error` | 3.25 | test_resource_names.py
   test_03_RVR_Network_check_router_state | `Failure` | 283.50 | test_routers_network_ops.py
   test_04_extract_template | `Failure` | 1.09 | test_templates.py
   test_01_volume_usage | `Error` | 110.19 | test_usage.py
   test_06_download_detached_volume | `Failure` | 198.78 | test_volumes.py
   test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | `Failure` | 575.94 | test_vpc_redundant.py
   test_02_redundant_VPC_default_routes | `Failure` | 531.33 | test_vpc_redundant.py
   test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers | `Failure` | 379.67 | test_vpc_redundant.py
   test_04_rvpc_network_garbage_collector_nics | `Failure` | 293.61 | test_vpc_redundant.py
   test_05_rvpc_multi_tiers | `Failure` | 473.17 | test_vpc_redundant.py
   test_05_rvpc_multi_tiers | `Error` | 473.19 | test_vpc_redundant.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2820454332

   @Pearl1594 a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2823212451

   @Pearl1594 a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2823817457

   @Pearl1594 a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2824042958

   Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13145


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "olivierlambert (via GitHub)" <gi...@apache.org>.
olivierlambert commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2823544901

   @weizhouapache I have no idea. I'm not familiar with this, but maybe we might have someone internally who is. Let me ask around.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2837677396

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=10684&metric=new_coverage&view=list) (required ≥ 40%)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Maintainability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2837788029

   Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13209


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2841342776

   https://github.com/apache/cloudstack/pull/10684/commits/3509d13d5146d5cc6a3a551c2f5bf8c3e59ac32d fixes the issue with the way extra config is passed. 
   Before fix:
   ```
   [root@ref-trl-8431-x-mol8-pearl-dsilva-marvin ~]# nosetests --with-xunit --xunit-file=results.xml --with-marvin --marvin-config=/marvin/ref-trl-8431-x-Mol8-pearl-dsilva-advanced-cfg -s -a tags=before --hypervisor=Xenserver /marvin/tests/smoke/test_deploy_vm_extra_config_data.py
   /usr/local/lib/python3.6/site-packages/paramiko/transport.py:32: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.6.
     from cryptography.hazmat.backends import default_backend
   
   ==== Marvin Init Started ====
   
   === Marvin Parse Config Successful ===
   
   === Marvin Setting TestData Successful===
   
   ==== Log Folder Path: /marvin/MarvinLogs/Apr_30_2025_09_14_32_YGPKI3 All logs will be available here ====
   
   === Marvin Init Logging Successful===
   
   ==== Marvin Init Successful ====
   === TestName: test_07_deploy_vm_with_extraconfig_xenserver | Status : EXCEPTION ===
   
   === Final results are now copied to: /marvin//MarvinLogs/test_deploy_vm_extra_config_data_L96KRM ===
   
   ```
   
   Error thrown on Xen:
   ```
   2025-04-30 08:50:18,876 DEBUG [c.c.a.ApiServlet] (qtp1390913202-17:[ctx-0661945c, ctx-8c964097, ctx-d0696d21]) (logid:f3928490) ===END===  10.0.112.109 -- GET  jobid=73e90964-c8a9-4dd2-b9d5-1afb8c54c037&command=queryAsyncJobResult&response=json&apiKey=LIN6rqXuaJwMPfGYFh13qDwYz5VNNz1J2J6qIOWcd3oLQOq0WtD4CwRundBL6rzXToa3lQOC_vKjI3nkHtiD8Q&signature=zhix3C3GW%2BmFsjrPyyNggORyUas%3D
   2025-04-30 08:50:19,166 WARN  [c.c.h.x.r.XcpServer83Resource] (DirectAgent-244:[ctx-e32986ce]) (logid:73e90964) Task failed! Task record:                 uuid: 6e081024-12f1-7b91-8535-c7bd9d2a6006
              nameLabel: Async.VM.start_on
        nameDescription:
      allowedOperations: []
      currentOperations: {}
                created: Wed Apr 30 08:52:59 UTC 2025
               finished: Wed Apr 30 08:53:05 UTC 2025
                 status: failure
             residentOn: com.xensource.xenapi.Host@aa444b17
               progress: 1.0
                   type: <none/>
                 result:
              errorInfo: [INTERNAL_ERROR, xenopsd internal error: Domain.Domain_build_pre_failed("Calling 'shadow_allocation_set 3 MiB' failed: Xenctrl.Error(\"22: Invalid argument\")")]
            otherConfig: {debug_info:cancel_points_seen=1}
              subtaskOf: com.xensource.xenapi.Task@aaf13f6f
               subtasks: []
              backtrace: (((process xapi)(filename ocaml/xapi-client/client.ml)(line 7))((process xapi)(filename ocaml/xapi-client/client.ml)(line 19))((process xapi)(filename ocaml/xapi-client/client.ml)(line 5845))((process xapi)(filename ocaml/libs/xapi-stdext/lib/xapi-stdext-pervasives/pervasiveext.ml)(line 24))((process xapi)(filename ocaml/libs/xapi-stdext/lib/xapi-stdext-pervasives/pervasiveext.ml)(line 39))((process xapi)(filename ocaml/xapi/message_forwarding.ml)(line 146))((process xapi)(filename ocaml/libs/xapi-stdext/lib/xapi-stdext-pervasives/pervasiveext.ml)(line 24))((process xapi)(filename ocaml/libs/xapi-stdext/lib/xapi-stdext-pervasives/pervasiveext.ml)(line 39))((process xapi)(filename ocaml/xapi/message_forwarding.ml)(line 1938))((process xapi)(filename ocaml/libs/xapi-stdext/lib/xapi-stdext-pervasives/pervasiveext.ml)(line 24))((process xapi)(filename ocaml/libs/xapi-stdext/lib/xapi-stdext-pervasives/pervasiveext.ml)(line 39))((process xapi)(filename ocaml/libs/x
 api-stdext/lib/xapi-stdext-pervasives/pervasiveext.ml)(line 24))((process xapi)(filename ocaml/libs/xapi-stdext/lib/xapi-stdext-pervasives/pervasiveext.ml)(line 39))((process xapi)(filename ocaml/xapi/message_forwarding.ml)(line 1922))((process xapi)(filename ocaml/xapi/rbac.ml)(line 191))((process xapi)(filename ocaml/xapi/rbac.ml)(line 200))((process xapi)(filename ocaml/xapi/server_helpers.ml)(line 75)))
   
   2025-04-30 08:50:19,183 INFO  [c.c.c.ClusterManagerImpl] (Cluster-Heartbeat-1:[ctx-84fdefd7]) (logid:fc0a7c8f) No inactive management server node found
   2025-04-30 08:50:19,183 DEBUG [c.c.c.ClusterManagerImpl] (Cluster-Heartbeat-1:[ctx-84fdefd7]) (logid:fc0a7c8f) Peer scan is finished. profiler: Done. Duration: 2ms , profilerQueryActiveList: Done. Duration: 1ms, , profilerSyncClusterInfo: Done. Duration: 0ms, profilerInvalidatedNodeList: Done. Duration: 0ms, profilerRemovedList: Done. Duration: 0ms
   ```
   
   
   Post fix:
   ```
   [root@ref-trl-8431-x-mol8-pearl-dsilva-marvin ~]# nosetests --with-xunit --xunit-file=results.xml --with-marvin --marvin-config=/marvin/ref-trl-8431-x-Mol8-pearl-dsilva-advanced-cfg -s -a tags=after --hypervisor=Xenserver /marvin/tests/smoke/test_deploy_vm_extra_config_data.py
   /usr/local/lib/python3.6/site-packages/paramiko/transport.py:32: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.6.
     from cryptography.hazmat.backends import default_backend
   
   ==== Marvin Init Started ====
   
   === Marvin Parse Config Successful ===
   
   === Marvin Setting TestData Successful===
   
   ==== Log Folder Path: /marvin/MarvinLogs/Apr_30_2025_09_16_42_MFF43T All logs will be available here ====
   
   === Marvin Init Logging Successful===
   
   ==== Marvin Init Successful ====
   ====Trying SSH Connection: Host:10.0.35.194 User:root                                   Port:22 RetryCnt:60===
   ===SSH to Host 10.0.35.194 port : 22 SUCCESSFUL===
   {Cmd: xe vm-list name-label=i-2-9-VM params=uuid  via Host: 10.0.35.194} {returns: ['uuid ( RO)    : 7e391f0c-1fd5-329a-660e-0c42f196eb5e', '', '']}
   {Cmd: xe vm-param-get param-name=HVM-boot-policy uuid=7e391f0c-1fd5-329a-660e-0c42f196eb5e via Host: 10.0.35.194} {returns: ['""']}
   {Cmd: xe vm-param-get param-name=PV-bootloader uuid=7e391f0c-1fd5-329a-660e-0c42f196eb5e via Host: 10.0.35.194} {returns: ['pygrub']}
   {Cmd: xe vm-param-get param-name=PV-args uuid=7e391f0c-1fd5-329a-660e-0c42f196eb5e via Host: 10.0.35.194} {returns: ['hvc0']}
   === TestName: test_07_deploy_vm_with_extraconfig_xenserver | Status : SUCCESS ===
   
   === Final results are now copied to: /marvin//MarvinLogs/test_deploy_vm_extra_config_data_Y8S84E ===
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "rohityadavcloud (via GitHub)" <gi...@apache.org>.
rohityadavcloud commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2865166107

   
   @blueorangutan test ol8 xcpng83
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2856724988

   <b>[SF] Trillian test result (tid-13211)</b>
   Environment: xcpng83 (x2), Advanced Networking with Mgmt server ol8
   Total time taken: 74220 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10684-t13211-xcpng83.zip
   Smoke tests completed. 140 look OK, 1 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   ContextSuite context=TestSharedNetworkWithConfigDrive>:setup | `Error` | 7.55 | test_network.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2823728684

   @weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2816321469

   @Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + xenserver-84) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2821037677

   <b>[SF] Trillian Build Failed (tid-13083)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2834384377

   > > I'll investigate it on XCP-ng side, must be the newer Open vSwitch version (compared to 7.6/8.2) we share with XenServer, maybe some default behavior.
   > 
   > thanks a lot @bleader
   > 
   > I also suspect it is due to different OVS version (2.5 vs 2.17). but could not figure out what caused it.
   
   @bleader @olivierlambert 
   we may have found the root cause
   we use a nested environment, the nic adaptor of eth0 was set to vmxnet3 for the xcpng/xenserver hosts
   we changed to e1000 nic adaptor, it seems to work
   
   thanks @Pearl1594 , good finding


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2851295794

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2851510706

   Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13263


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "rohityadavcloud (via GitHub)" <gi...@apache.org>.
rohityadavcloud closed pull request #10684: Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible
URL: https://github.com/apache/cloudstack/pull/10684


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2865282622

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=10684&metric=new_coverage&view=list) (required ≥ 40%)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Maintainability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2853195287

   @Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + xcpng83) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2837850606

   @Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + xenserver-84) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2837868383

   @Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + xcpng83) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2837849450

   @blueorangutan test ol8 xenserver-84


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2790508740

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2790880011

   <b>[SF] Trillian Build Failed (tid-12931)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2798374107

   @blueorangutan test ol8 xenserver-81


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on code in PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#discussion_r2037590258


##########
scripts/vm/hypervisor/xenserver/xenserver84/vmopsSnapshot:
##########
@@ -0,0 +1,622 @@
+#!/usr/bin/python

Review Comment:
   i thought i changed this and there is a file names vmopspremium



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2795586614

   @Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + xenserver-84) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "rohityadavcloud (via GitHub)" <gi...@apache.org>.
rohityadavcloud commented on code in PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#discussion_r2037260835


##########
scripts/vm/hypervisor/xenserver/xenserver84/vmops:
##########
@@ -0,0 +1,1607 @@
+#!/usr/bin/python

Review Comment:
   suggestion - should this be /usr/bin/python3 (or use /usr/bin/env python3)? cc @Pearl1594 @harikrishna-patnala @weizhouapache 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2820911380

   @Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + xcpng83) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2820702256

   Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13130


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2823816403

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2824420041

   @blueorangutan test ol8 xcpng83


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2823294183

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=10684&metric=new_coverage&view=list) (required ≥ 40%)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Maintainability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2829914666

   <b>[SF] Trillian test result (tid-13108)</b>
   Environment: xcpng83 (x2), Advanced Networking with Mgmt server ol8
   Total time taken: 154810 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10684-t13108-xcpng83.zip
   Smoke tests completed. 98 look OK, 43 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_01_events_resource | `Error` | 1517.88 | test_events_resource.py
   test_guest_OS_mapping_check_with_hypervisor | `Error` | 0.04 | test_guest_os.py
   test_provision_certificate | `Failure` | 104.68 | test_certauthority_root.py
   test_01_condensed_drs_algorithm | `Failure` | 217.61 | test_cluster_drs.py
   test_02_balanced_drs_algorithm | `Failure` | 197.53 | test_cluster_drs.py
   test_06_deploy_vm_with_extraconfig_throws_exception_xenserver | `Error` | 9.73 | test_deploy_vm_extra_config_data.py
   test_07_deploy_vm_with_extraconfig_xenserver | `Error` | 158.36 | test_deploy_vm_extra_config_data.py
   ContextSuite context=TestInternalLb>:setup | `Error` | 0.00 | test_internal_lb.py
   ContextSuite context=TestDeployVMFromISO>:setup | `Error` | 0.00 | test_deploy_vm_iso.py
   ContextSuite context=TestIpv4Routing>:setup | `Error` | 0.00 | test_ipv4_routing.py
   ContextSuite context=TestDeployVMsInParallel>:setup | `Error` | 0.00 | test_deploy_vms_in_parallel.py
   ContextSuite context=TestRemoteDiagnostics>:setup | `Error` | 0.00 | test_diagnostics.py
   ContextSuite context=TestDeployVmWithVariedPlanners>:setup | `Error` | 0.00 | test_deploy_vms_with_varied_deploymentplanners.py
   ContextSuite context=TestDeployVmWithUserData>:setup | `Error` | 0.00 | test_deploy_vm_with_userdata.py
   test_01_create_iso_with_checksum_sha1 | `Error` | 66.74 | test_iso.py
   test_02_create_iso_with_checksum_sha256 | `Error` | 66.60 | test_iso.py
   test_03_create_iso_with_checksum_md5 | `Error` | 66.61 | test_iso.py
   test_04_create_iso_with_no_checksum | `Error` | 66.62 | test_iso.py
   test_01_create_iso | `Failure` | 1520.12 | test_iso.py
   ContextSuite context=TestISO>:setup | `Error` | 3039.83 | test_iso.py
   ContextSuite context=TestDomainsServiceOfferings>:setup | `Error` | 1521.63 | test_domain_service_offerings.py
   test_01_browser_migrate_template | `Error` | 65.92 | test_image_store_object_migration.py
   test_01_invalid_upgrade_kubernetes_cluster | `Failure` | 0.01 | test_kubernetes_clusters.py
   test_02_upgrade_kubernetes_cluster | `Failure` | 0.01 | test_kubernetes_clusters.py
   test_03_deploy_and_scale_kubernetes_cluster | `Failure` | 0.01 | test_kubernetes_clusters.py
   test_04_autoscale_kubernetes_cluster | `Failure` | 0.01 | test_kubernetes_clusters.py
   test_05_basic_lifecycle_kubernetes_cluster | `Failure` | 0.01 | test_kubernetes_clusters.py
   test_06_delete_kubernetes_cluster | `Failure` | 0.01 | test_kubernetes_clusters.py
   test_08_upgrade_kubernetes_ha_cluster | `Failure` | 0.01 | test_kubernetes_clusters.py
   test_10_vpc_tier_kubernetes_cluster | `Failure` | 0.01 | test_kubernetes_clusters.py
   test_11_test_unmanaged_cluster_lifecycle | `Error` | 0.01 | test_kubernetes_clusters.py
   test_01_add_delete_kubernetes_supported_version | `Error` | 1803.19 | test_kubernetes_supported_versions.py
   ContextSuite context=TestListIdsParams>:setup | `Error` | 0.00 | test_list_ids_parameter.py
   ContextSuite context=TestListVolumes>:setup | `Error` | 0.00 | test_list_volumes.py
   ContextSuite context=TestLoadBalance>:setup | `Error` | 0.00 | test_loadbalance.py
   ContextSuite context=TestMetrics>:setup | `Error` | 0.00 | test_metrics_api.py
   test_nic_secondaryip_add_remove | `Error` | 1517.40 | test_multipleips_per_nic.py
   ContextSuite context=TestNestedVirtualization>:setup | `Error` | 0.00 | test_nested_virtualization.py
   ContextSuite context=TestNetworkACL>:setup | `Error` | 0.00 | test_network_acl.py
   ContextSuite context=TestIpv6Network>:setup | `Error` | 0.00 | test_network_ipv6.py
   ContextSuite context=TestNetworkPermissions>:setup | `Error` | 0.00 | test_network_permissions.py
   test_delete_account | `Error` | 1517.83 | test_network.py
   test_delete_network_while_vm_on_it | `Error` | 1.21 | test_network.py
   test_deploy_vm_l2network | `Error` | 1.26 | test_network.py
   test_l2network_restart | `Error` | 2.33 | test_network.py
   ContextSuite context=TestPortForwarding>:setup | `Error` | 3.59 | test_network.py
   ContextSuite context=TestPublicIP>:setup | `Error` | 13.07 | test_network.py
   test_reboot_router | `Failure` | 0.08 | test_network.py
   test_releaseIP | `Error` | 6.83 | test_network.py
   test_releaseIP_using_IP | `Error` | 7.09 | test_network.py
   ContextSuite context=TestRouterRules>:setup | `Error` | 7.20 | test_network.py
   ContextSuite context=TestSharedNetworkWithConfigDrive>:setup | `Error` | 13.79 | test_network.py
   ContextSuite context=TestPrivateGwACL>:setup | `Error` | 0.00 | test_privategw_acl.py
   ContextSuite context=TestAdapterTypeForNic>:setup | `Error` | 0.00 | test_nic_adapter_type.py
   test_01_nic | `Error` | 1517.92 | test_nic.py
   test_01_non_strict_host_anti_affinity | `Error` | 250.60 | test_nonstrict_affinity_group.py
   test_02_non_strict_host_affinity | `Error` | 131.06 | test_nonstrict_affinity_group.py
   test_01_add_primary_storage_disabled_host | `Error` | 1517.72 | test_primary_storage.py
   test_01_deploy_vms_storage_tags | `Error` | 8.51 | test_primary_storage.py
   ContextSuite context=TestIsolatedNetworksPasswdServer>:setup | `Error` | 0.00 | test_password_server.py
   ContextSuite context=TestPortForwardingRules>:setup | `Error` | 0.00 | test_portforwardingrules.py
   ContextSuite context=TestProjectSuspendActivate>:setup | `Error` | 1530.58 | test_projects.py
   test_02_create_volume | `Error` | 4.34 | test_resource_names.py
   test_03_RVR_Network_check_router_state | `Failure` | 348.09 | test_routers_network_ops.py
   test_05_scale_vm_dont_allow_disk_offering_change | `Failure` | 75.02 | test_scale_vm.py
   test_04_extract_template | `Failure` | 1.10 | test_templates.py
   test_02_restore_vm_strict_tags_failure | `Failure` | 122.11 | test_vm_strict_host_tags.py
   test_02_scale_vm_strict_tags_failure | `Failure` | 97.66 | test_vm_strict_host_tags.py
   test_06_deploy_vm_on_any_host_with_strict_tags_failure | `Failure` | 4.73 | test_vm_strict_host_tags.py
   test_06_download_detached_volume | `Failure` | 203.90 | test_volumes.py
   test_01_verify_ipv6_vpc | `Failure` | 811.70 | test_vpc_ipv6.py
   test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL | `Failure` | 681.39 | test_vpc_redundant.py
   test_02_redundant_VPC_default_routes | `Failure` | 620.86 | test_vpc_redundant.py
   test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers | `Failure` | 456.59 | test_vpc_redundant.py
   test_04_rvpc_network_garbage_collector_nics | `Failure` | 377.26 | test_vpc_redundant.py
   test_05_rvpc_multi_tiers | `Failure` | 550.43 | test_vpc_redundant.py
   test_05_rvpc_multi_tiers | `Error` | 550.46 | test_vpc_redundant.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 closed pull request #10684: Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible
URL: https://github.com/apache/cloudstack/pull/10684


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2841495238

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=10684&metric=new_coverage&view=list) (required ≥ 40%)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Maintainability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2844371540

   @Pearl1594 a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2855865361

   <b>[SF] Trillian test result (tid-13206)</b>
   Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
   Total time taken: 56594 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10684-t13206-kvm-ol8.zip
   Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
   Only failed and skipped tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2851302988

   @Pearl1594 a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2862286884

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=10684&metric=new_coverage&view=list) (required ≥ 40%)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [C Maintainability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2862136699

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2795840770

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=10684&metric=new_coverage&view=list) (required ≥ 40%)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [E Maintainability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684) (required ≥ B)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=10684)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2794217368

   @Pearl1594 a [SL] Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2798373185

   @blueorangutan test ol8 xenserver-84


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2790675267

   Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12999


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support xenserver 84 - make scripts python3 compatible [cloudstack]

Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2795433482

   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [WIP] Support XenServer 8.4 / XCP 8.3 - make scripts python3 compatible [cloudstack]

Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #10684:
URL: https://github.com/apache/cloudstack/pull/10684#issuecomment-2807351374

   <b>[SF] Trillian Build Failed (tid-13004)<b/>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org