Alert.png The wiki is deprecated and due to be decommissioned by the end of September 2022.
The content is being migrated to other supports, new updates will be ignored and lost.
If needed you can get in touch with EGI SDIS team using operations @ egi.eu.

Difference between revisions of "rOCCI:ROCCI-cli AWS Examples"

From EGIWiki
Jump to navigation Jump to search
Line 5: Line 5:
You need:
You need:


* a VOMS proxy certificate
* a VOMS proxy certificate. The following examples expect it to be located in file <code>/tmp/x509up_u`id -u`</code>
* an OCCI client
* an OCCI client or an HTTP client
* an SSH key pair
** Examples given here use the ''rOCCI-cli'' client (available either from the [https://appdb.egi.eu/store/software/rocci.cli EGI AppDB] or from [https://github.com/EGI-FCTF/rOCCI-cli GitHub]).
** Simple HTTPs client such as <code>curl</code> may also be used for rudimentary management.
* an SSH key pair (in case you really wish to log into your virtual machines). The following examples expect your public key to be located in <code>~/.ssh/id_rsa.pub</code>


= Examples =
= Examples =

Revision as of 12:49, 27 April 2017

This page gives simple examples of using the OCCI gateway to Amazon Services as presented at the 2017 EGI Conference and Indigo Summit. You have been probably redirected here through a QR code.

Prerequisites

You need:

  • a VOMS proxy certificate. The following examples expect it to be located in file /tmp/x509up_u`id -u`
  • an OCCI client or an HTTP client
    • Examples given here use the rOCCI-cli client (available either from the EGI AppDB or from GitHub).
    • Simple HTTPs client such as curl may also be used for rudimentary management.
  • an SSH key pair (in case you really wish to log into your virtual machines). The following examples expect your public key to be located in ~/.ssh/id_rsa.pub

Examples

Listing Available Images

occi --endpoint https://awsocci.cesnet.cz:11443/ --auth x509 --user-cred /tmp/x509up_u`id -u` --voms --action list --resource os_tpl

Listing Available Resource Sizes

occi --endpoint https://awsocci.cesnet.cz:11443/ --auth x509 --user-cred /tmp/x509up_u`id -u` --voms --action list --resource resource_tpl

Creating a Virtual Machine

VMID=$(occi --endpoint https://awsocci.cesnet.cz:11443/ --auth x509 --user-cred /tmp/x509up_u`id -u` --voms --action create --resource compute \
--mixin os_tpl#ami-971238f1 --mixin resource_tpl#t2_micro --attribute occi.core.title="VMby${USER}" \
--context public_key="file://${HOME}/.ssh/id_rsa.pub" --link /network/vpc-e2e4f686)

Describing a Virtual Machine

occi --endpoint https://awsocci.cesnet.cz:11443/ --auth x509 --user-cred /tmp/x509up_u`id -u` --voms --action describe --resource ${VMID}

Deleting a Virtual Machine

occi --endpoint https://awsocci.cesnet.cz:11443/ --auth x509 --user-cred /tmp/x509up_u`id -u` --voms --action delete --resource ${VMID}