Advertisement
fkeles

stress-instances-in-pool.sh

May 11th, 2023
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.64 KB | Source Code | 0 0
  1. # find instances in instance pool
  2. for i in $(oci compute-management instance-pool list-instances --compartment-id ocid1.compartment.oc1..<compartment-id> --instance-pool-id ocid1.instancepool.oc1.uk-london-1.<instancepool-id> --query 'data[*].id' --raw-output |sed 's/\"//g;s/,//g'|egrep -v -e "\[" -e "\]")
  3. do
  4.     # run stress-ng command on the instance
  5.     oci instance-agent command create --compartment-id ocid1.compartment.oc1..<compartment-id> --timeout-in-seconds 3700 --target '{"instance-id": "'$i'"}' --content '{"output": {"output-type": "TEXT"},"source": {"source-type": "TEXT","text": "sudo stress-ng --cpu 0 --cpu-method all -t 10m"}}'
  6. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement