Created
November 6, 2014 18:45
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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