Skip to content

Instantly share code, notes, and snippets.

@trentm
Created November 6, 2014 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trentm/97c44ff0fb69c38921bc to your computer and use it in GitHub Desktop.
Save trentm/97c44ff0fb69c38921bc to your computer and use it in GitHub Desktop.
Hack SmartDataCenter's CNAPI (historically this chunk of functionality was called DAPI) to allow "customer" provisioning (i.e. via cloudapi) on the headnode for dev/testing.
function hack_dapi_for_headnode_provisioning {
local cnapi_zone=\$(vmadm lookup -1 alias=cnapi0)
# TODO: don't change if already done
echo "# Hack DAPI to allow headnode provisioning"
local config_path=/zones/\$cnapi_zone/root/opt/smartdc/cnapi/sapi_manifests/cnapi/template
sed -e "
s:hard-filter-headnode:identity:g;
s:hard-filter-min-ram:identity:g;
s:hard-filter-min-disk:identity:g;
s:hard-filter-min-cpu:identity:g;
" \$config_path >\$config_path.new
mv \$config_path.new \$config_path
svcadm -z \$cnapi_zone restart config-agent
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment