@@ -302,40 +302,37 @@ Create a CVM instance:
302302
303303``` bash
304304rm -f /tmp/lh-* .txt &&
305- VM_TOKEN=$( openssl rand -base64 16 | tr -dc ' a-zA-Z0-9' | head -c 16) && echo " $VM_TOKEN " > /tmp/lh-token.txt &&
306- VM_TOKEN=$VM_TOKEN bash scripts/tools/tencent-cloud/helper.sh create-cvm.py 2> /tmp/lh-instance.txt && VM_INSTANCE=$( cat /tmp/lh-instance.txt) &&
307- bash scripts/tools/tencent-cloud/helper.sh query-cvm-ip.py --instance $VM_INSTANCE 2> /tmp/lh-ip.txt && VM_IP=$( cat /tmp/lh-ip.txt) &&
308- echo " Instance: $VM_INSTANCE , IP: ubuntu@$VM_IP "
305+ echo $( openssl rand -base64 16 | tr -dc ' a-zA-Z0-9' | head -c 16) > /tmp/lh-token.txt &&
306+ VM_TOKEN=$( cat /tmp/lh-token.txt) bash scripts/tools/tencent-cloud/helper.sh create-cvm.py --id /tmp/lh-instance.txt
307+ bash scripts/tools/tencent-cloud/helper.sh query-cvm-ip.py --instance $( cat /tmp/lh-instance.txt) --id /tmp/lh-ip.txt &&
308+ echo " Instance: $( cat /tmp/lh-instance.txt) , IP: ubuntu@$( cat /tmp/lh-ip.txt) , Password: $( cat /tmp/lh-token.txt) " && sleep 5 &&
309+ bash scripts/setup-lighthouse/build.sh --ip $( cat /tmp/lh-ip.txt) --os ubuntu --user ubuntu --password $( cat /tmp/lh-token.txt) &&
310+ bash scripts/tools/tencent-cloud/helper.sh create-image.py --instance $( cat /tmp/lh-instance.txt) --id /tmp/lh-image.txt &&
311+ bash scripts/tools/tencent-cloud/helper.sh share-image.py --image $( cat /tmp/lh-image.txt) &&
312+ echo " Image: $( cat /tmp/lh-image.txt) created and shared." &&
313+ bash scripts/tools/tencent-cloud/helper.sh remove-cvm.py --instance $( cat /tmp/lh-instance.txt)
309314```
310315
311- Run blueprint script :
316+ Next, create a test CVM instance with the image :
312317
313318``` bash
314- VM_IP= $( cat /tmp/lh-ip.txt ) && VM_TOKEN= $( cat /tmp/lh-token.txt ) && VM_INSTANCE= $( cat /tmp/lh-instance .txt) &&
315- bash scripts/setup-lighthouse/build .sh --ip $VM_IP --os ubuntu --user ubuntu --password $VM_TOKEN &&
316- bash scripts/tools/tencent-cloud/helper.sh create-image .py --instance $VM_INSTANCE 2> /tmp/lh-image .txt && VM_IMAGE= $( cat /tmp/lh-image .txt) &&
317- bash scripts/tools/tencent-cloud/helper.sh share-image.py --image $VM_IMAGE &&
318- echo " Image: $VM_IMAGE created and shared. "
319+ echo $( openssl rand -base64 16 | tr -dc ' a-zA-Z0-9 ' | head -c 16 ) > /tmp/lh-token2 .txt &&
320+ VM_TOKEN= $( cat /tmp/lh-token2.txt ) bash scripts/tools/tencent-cloud/helper .sh create-verify.py --image $( cat /tmp/lh-image.txt ) --id /tmp/lh-test.txt &&
321+ bash scripts/tools/tencent-cloud/helper.sh query-cvm-ip .py --instance $( cat /tmp/lh-test .txt) --id /tmp/lh-ip2 .txt &&
322+ echo " IP: ubuntu@ $( cat /tmp/lh-ip2.txt ) , Password: $( cat /tmp/lh-token2.txt ) " &&
323+ echo " http:// $( cat /tmp/lh-ip2.txt ) "
319324```
320325
321- Next, create a test CVM instance with the image :
326+ Verify then cleanup the test CVM instance:
322327
323328``` bash
324- TEST_TOKEN=$( openssl rand -base64 16 | tr -dc ' a-zA-Z0-9' | head -c 16) && VM_IMAGE=$( cat /tmp/lh-image.txt) &&
325- VM_TOKEN=$TEST_TOKEN bash scripts/tools/tencent-cloud/helper.sh create-verify-cvm.py --image $VM_IMAGE 2> /tmp/lh-test.txt && TEST_INSTANCE=$( cat /tmp/lh-test.txt) &&
326- bash scripts/tools/tencent-cloud/helper.sh query-cvm-ip.py --instance $TEST_INSTANCE 2> /tmp/lh-ip2.txt && TEST_IP=$( cat /tmp/lh-ip2.txt) &&
327- echo " Instance: $TEST_INSTANCE , IP: ubuntu@$TEST_IP , Password: $TEST_TOKEN " &&
328- echo " http://$TEST_IP "
329+ bash scripts/tools/tencent-cloud/helper.sh remove-cvm.py --instance $( cat /tmp/lh-test.txt)
329330```
330331
331- Then run the script to remove all the CVM, disk images, and snapshots:
332+ After publish to lighthouse, cleanup the CVM, disk images, and snapshots:
332333
333334``` bash
334- VM_INSTANCE=$( cat /tmp/lh-instance.txt) && VM_IMAGE=$( cat /tmp/lh-image.txt) && TEST_INSTANCE=$( cat /tmp/lh-test.txt) &&
335- (bash scripts/tools/tencent-cloud/helper.sh remove-cvm.py --instance $TEST_INSTANCE || echo OK) &&
336- (bash scripts/tools/tencent-cloud/helper.sh remove-cvm.py --instance $VM_INSTANCE || echo OK) &&
337- (bash scripts/tools/tencent-cloud/helper.sh remove-image.py --image $VM_IMAGE || echo OK) &&
338- echo " Cleanup Instance: $VM_INSTANCE , Image: $VM_IMAGE OK."
335+ bash scripts/tools/tencent-cloud/helper.sh remove-image.py --image $( cat /tmp/lh-image.txt)
339336```
340337
341338# Tips
0 commit comments