Skip to content

Instantly share code, notes, and snippets.

@arax
Last active May 20, 2016 08:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arax/d7883fe433a6254a6918 to your computer and use it in GitHub Desktop.
Save arax/d7883fe433a6254a6918 to your computer and use it in GitHub Desktop.
Manual verification for rOCCI-server installations

Manual verification for rOCCI-server installations

Pre-flight check

occi -d -v
CLI:  4.3.1
API:  4.3.1
Core: 4.3.2

Adding the --debug option to any of the following commands will produce a verbose output useful for debugging.

Getting model (from the query interface)

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --dump-model

Listing os_tpl mixins

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action list --resource os_tpl

Describing os_tpl mixins

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action describe --resource os_tpl

Listing resource_tpl mixins

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action list --resource resource_tpl

Describing resource_tpl mixins

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action describe --resource resource_tpl

Creating compute

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action create --resource compute --mixin $OS_TPL --mixin $RESOURCE_TPL --attribute occi.core.title="MyrOCCIVM"

Creating compute w/ contextualization

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action create --resource compute --mixin $OS_TPL --mixin $RESOURCE_TPL --attribute occi.core.title="MyrOCCIVM" \
     --context user_data="file://$ABSOLUTE_PATH_TO_FILE" --context public_key="file://$ABSOLUTE_PATH_TO_PUB"

Listing computes

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action list --resource compute

Describing computes

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action describe --resource compute

Triggering basic actions on compute

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action trigger --resource $RELATIVE_COMPUTE_URL --trigger-action stop

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action trigger --resource $RELATIVE_COMPUTE_URL --trigger-action start

Creating storage

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action create --resource storage --attribute occi.core.title="mystorage" --attribute occi.storage.size="1"

Listing storages

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action list --resource storage

Describing storages

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action describe --resource storage

Attaching storage to compute

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action link --resource $RELATIVE_COMPUTE_URL --link $RELATIVE_STORAGE_URL

Detaching storage from compute

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action unlink --resource $RELATIVE_STORAGELINK_URL

Destroying storage

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action delete --resource $RELATIVE_STORAGE_URL

Creating network

This is still specific for enabled backend!

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action create --resource network \
     --mixin http://schemas.ogf.org/occi/infrastructure/network#ipnetwork \
     --mixin http://opennebula.org/occi/infrastructure#network \
     --attribute occi.core.title="mynetwork" --attribute occi.network.address="10.1.1.0/24" \
     --attribute org.opennebula.network.bridge="onebr1"

Listing networks

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action list --resource network

Describing networks

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action describe --resource network

Attaching network to compute

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action link --resource $RELATIVE_COMPUTE_URL --link $RELATIVE_NETWORK_URL

Detaching network from compute

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action unlink --resource $RELATIVE_NETWORKINTERFACE_URL

Destroying network

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action delete --resource $RELATIVE_NETWORK_URL

Destroying compute

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action delete --resource $RELATIVE_COMPUTE_URL

Create compute w/ inline links

occi --endpoint $OCCI_HTTP_ENDPOINT --auth basic --username $USERNAME --password $PASSWORD \
     --action create --resource compute --mixin $OS_TPL --mixin $RESOURCE_TPL --attribute occi.core.title="MyrOCCIVM" \
     --link $RELATIVE_STORAGE_URL --link $RELATIVE_NETWORK_URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment