Create a new VM node for PTU benchmarking automatically.
You don't need to create VM in the portal, saving the processes to choose VM and region, wait VM to start and then configure the SSH connection from local network.
- The ptu_vm.sh script serves as an automation tool for provisioning and managing Azure virtual machines (VMs) specifically set up for PTU. It accepts an argument that directs the script to either create or delete resources. In the 'create' mode, it establishes a new Azure VM within a resource group, sets up the Azure AD login for SSH access, and transfers a test script to the VM for benchmarking. In contrast, the 'delete' mode prompts the user for confirmation before proceeding to remove the VM and its associated resource group, preventing accidental data loss.
Usage:
bash ptu_vm.sh create|delete
create command can also detect the resource group name and VM name existance so as to save time for follow-up creations. It additionally transfers a test script to the newly created VM and prepares the environment by cloning a benchmarking tool repository.
-
The accompanying test_ptuscript.sh script is intended for the initial setup and execution of performance tests on the Azure VM. It checks and installs Python and pip if they are not already installed and ensures all Python dependencies listed in requirements.txt are present. Once the setup is complete, the script moves into the benchmarking directory, sets necessary environment variables, and invokes a Python module to conduct the performance test, capturing the output for analysis. Together, these scripts provide an end-to-end solution for managing VM lifecycles and conducting performance tests in a cloud-based environment.
Use the command generated by the first script and login to the VM to execute the PTU benchmarking script.
Usage: ssh -o StrictHostKeyChecking=no [email protected]
bash test_ptuscript.sh
Note: after VM creation, if cannot SSH login to the VM, try to check the network settings on portal of VM. Make sure to delete the JITRule of "Deny" and add a high priority "Allow" rule for port 22: