| 5 | |
| 6 | $ ssh-keygen -t rsa -b 2048 -f tmpfedcloud |
| 7 | $ cat > tmpfedcloud.login << EOFusers: |
| 8 | - name: cloudadm |
| 9 | sudo: ALL=(ALL) NOPASSWD:ALL |
| 10 | lock-passwd: true |
| 11 | ssh-import-id: cloudadm |
| 12 | ssh-authorized-keys: |
| 13 | - `cat tmpfedcloud.pub` |
| 14 | EOF |
| 15 | export ENDPOINT=https://carach5.ics.muni.cz:11443 |
| 16 | export OS_TPL=http://occi.carach5.ics.muni.cz/occi/infrastructure/os_tpl#uuid_egi_ubuntu_server_14_04_lts_fedcloud_warg_131 |
| 17 | export RES_TPL=http://fedcloud.egi.eu/occi/compute/flavour/1.0#small |
| 18 | |
| 19 | VM_ID=$(occi --endpoint $ENDPOINT --auth x509 --user-cred $X509_USER_PROXY --voms --action create --resource compute --attribute occi.core.title="MyFirstVM1" --mixin $OS_TPL --mixin $RES_TPL --context user_data="file://$PWD/tmpfedcloud.login") |
| 20 | occi --endpoint $ENDPOINT --auth x509 --user-cred $X509_USER_PROXY --voms --action describe --resource ${VM_ID} |
| 21 | ssh -i tmpfedcloud cloudadm@${IP} |
| 22 | occi --endpoint $ENDPOINT --auth x509 --user-cred $X509_USER_PROXY --voms --action delete --resource ${VM_ID} |