|
这个脚本跑了9000多次,平均每次3分钟,运行了快20天,加上之前有几次手动中断了的,差不多24天才抢到一台2x12的
- [2021-12-01 04:50:37]start the [9293] time try
- {
- "data": {
- "agent-config": {
- "are-all-plugins-disabled": false,
- "is-management-disabled": false,
- "is-monitoring-disabled": false,
- "plugins-config": null
- },
- "availability-config": {
- "is-live-migration-preferred": null,
- "recovery-action": "RESTORE_INSTANCE"
- },
- "availability-domain": "pplh:AP-SINGAPORE-1-AD-1",
- "capacity-reservation-id": null,
复制代码
再附上简单的脚本,官方API,没有被封的风险
- for i in `seq 1 10000`; do
- echo "[`date '+%Y-%m-%d %H:%M:%S'`]start the [$i] time try"
- oci compute instance launch \
- --availability-domain pplh:AP-SINGAPORE-1-AD-1 \
- --display-name instance-20211109-1023 \
- --image-id ocid1.image.oc1.ap-singapore-1.xxxxxx \
- --subnet-id ocid1.subnet.oc1.ap-singapore-1.xxxxxx \
- --shape VM.Standard.A1.Flex \
- --assign-public-ip true \
- --metadata '{"ssh_authorized_keys": "xxxxxx"}' \
- --shape-config '{"ocpus": 2, "memoryInGbs": 12}' \
- --compartment-id ocid1.tenancy.oc1..xxxxxx
- if [ "$?" -ne 0 ]; then
- sleep 60s
- else
- echo "created successfully, exit"
- break
- fi
- done
复制代码 |
|