1. How to automate a script that creates a slice, deploys 2 VMs on different sites

How to automate a script that creates a slice, deploys 2 VMs on different sites

Home Forums FABRIC General Questions and Discussion How to automate a script that creates a slice, deploys 2 VMs on different sites

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #8428
    Bohdan Dyshlevyy
    Participant

      Hi everyone,

      I’m trying to automate a network test between two virtual machines located on different FABRIC sites. I’d like to have a single script that performs the following steps automatically:

      1. Creates a slice.

      2. Deploys two VMs on two different sites.

      3. Automatically connects to each VM.

      4. Runs a ping between them to measure latency.

      5. Runs an iperf test to measure bandwidth.

      In addition, I’d like this script to run automatically once or twice per week, like a scheduled test, without manual intervention. Ideally, the script should handle everything end-to-end (including SSH connections, command execution, etc.).

      What’s the best way to approach this using FABRIC tools? Is there an example using FABlib or another recommended method to do this kind of scheduled test?

      Thanks in advance for your help!

      #8430
      Acheme Acheme
      Participant

        Hi Bohdan,

        Yes, with FABlib you can create your slice with the VMs and the networking needed.  Also your script needs to have a time dependent function that performs the test at the intervals you specify using addresses of the nodes you created earlier. You can save the results in the FABRIC nodes or scp them to your local computer as well.

        I am not sure there is such an example script, if that is what you are asking though.

        #8454
        yoursunny
        Participant

          Step 1-5 are easy to do.

          I’d like this script to run automatically once or twice per week

          This is the difficult part.
          I believe it’s impossible within JupyterHub, because the container shuts down after an hour.

          It should be possible to install FABlib on your own server and invoke a script that does step 1-5 via crontab.
          This then requires you obtain a long-lived authentication token, and then it’s set-and-forget until the token expires.

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.