salt-cloud.rst 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. ==============
  2. ``salt-cloud``
  3. ==============
  4. Provision virtual machines in the cloud with Salt
  5. Synopsis
  6. ========
  7. .. code-block:: bash
  8. salt-cloud -m /etc/salt/cloud.map
  9. salt-cloud -m /etc/salt/cloud.map NAME
  10. salt-cloud -m /etc/salt/cloud.map NAME1 NAME2
  11. salt-cloud -p PROFILE NAME
  12. salt-cloud -p PROFILE NAME1 NAME2 NAME3 NAME4 NAME5 NAME6
  13. Description
  14. ===========
  15. Salt Cloud is the system used to provision virtual machines on various public
  16. clouds via a cleanly controlled profile and mapping system.
  17. Options
  18. =======
  19. .. program:: salt-cloud
  20. .. include:: _includes/common-options.rst
  21. Execution Options
  22. -----------------
  23. .. option:: -L LOCATION, --location=LOCATION
  24. Specify which region to connect to.
  25. .. option:: -a ACTION, --action=ACTION
  26. Perform an action that may be specific to this cloud provider. This
  27. argument requires one or more instance names to be specified.
  28. .. option:: -f <FUNC-NAME> <PROVIDER>, --function=<FUNC-NAME> <PROVIDER>
  29. Perform an function that may be specific to this cloud provider, that does
  30. not apply to an instance. This argument requires a provider to be specified
  31. (i.e.: nova).
  32. .. option:: -p PROFILE, --profile=PROFILE
  33. Select a single profile to build the named cloud VMs from. The profile must
  34. be defined in the specified profiles file.
  35. .. option:: -m MAP, --map=MAP
  36. Specify a map file to use. If used without any other options, this option
  37. will ensure that all of the mapped VMs are created. If the named VM already
  38. exists then it will be skipped.
  39. .. option:: -H, --hard
  40. When specifying a map file, the default behavior is to ensure that all of
  41. the VMs specified in the map file are created. If the --hard option is
  42. set, then any VMs that exist on configured cloud providers that are
  43. not specified in the map file will be destroyed. Be advised that this can
  44. be a destructive operation and should be used with care.
  45. .. option:: -d, --destroy
  46. Pass in the name(s) of VMs to destroy, salt-cloud will search the
  47. configured cloud providers for the specified names and destroy the
  48. VMs. Be advised that this is a destructive operation and should be used
  49. with care. Can be used in conjunction with the -m option to specify a map
  50. of VMs to be deleted.
  51. .. option:: -P, --parallel
  52. Normally when building many cloud VMs they are executed serially. The -P
  53. option will run each cloud vm build in a separate process allowing for
  54. large groups of VMs to be build at once.
  55. Be advised that some cloud provider's systems don't seem to be well suited
  56. for this influx of vm creation. When creating large groups of VMs watch the
  57. cloud provider carefully.
  58. .. option:: -u, --update-bootstrap
  59. Update salt-bootstrap to the latest stable bootstrap release.
  60. .. option:: -y, --assume-yes
  61. Default yes in answer to all confirmation questions.
  62. .. option:: -k, --keep-tmp
  63. Do not remove files from /tmp/ after deploy.sh finishes.
  64. .. option:: --show-deploy-args
  65. Include the options used to deploy the minion in the data returned.
  66. .. option:: --script-args=SCRIPT_ARGS
  67. Script arguments to be fed to the bootstrap script when deploying the VM.
  68. Query Options
  69. -------------
  70. .. option:: -Q, --query
  71. Execute a query and return some information about the nodes running on
  72. configured cloud providers
  73. .. option:: -F, --full-query
  74. Execute a query and print out all available information about all cloud VMs.
  75. Can be used in conjunction with -m to display only information about the
  76. specified map.
  77. .. option:: -S, --select-query
  78. Execute a query and print out selected information about all cloud VMs.
  79. Can be used in conjunction with -m to display only information about the
  80. specified map.
  81. .. option:: --list-providers
  82. Display a list of configured providers.
  83. .. option:: --list-profiles
  84. .. versionadded:: 2014.7.0
  85. Display a list of configured profiles. Pass in a cloud provider to view
  86. the provider's associated profiles, such as ``digitalocean``, or pass in
  87. ``all`` to list all the configured profiles.
  88. Cloud Providers Listings
  89. ------------------------
  90. .. option:: --list-locations=LIST_LOCATIONS
  91. Display a list of locations available in configured cloud providers. Pass
  92. the cloud provider that available locations are desired on, aka "linode",
  93. or pass "all" to list locations for all configured cloud providers
  94. .. option:: --list-images=LIST_IMAGES
  95. Display a list of images available in configured cloud providers. Pass the
  96. cloud provider that available images are desired on, aka "linode", or pass
  97. "all" to list images for all configured cloud providers
  98. .. option:: --list-sizes=LIST_SIZES
  99. Display a list of sizes available in configured cloud providers. Pass the
  100. cloud provider that available sizes are desired on, aka "AWS", or pass
  101. "all" to list sizes for all configured cloud providers
  102. Cloud Credentials
  103. -----------------
  104. .. option:: --set-password=<USERNAME> <PROVIDER>
  105. Configure password for a cloud provider and save it to the keyring.
  106. PROVIDER can be specified with or without a driver, for example:
  107. "--set-password bob rackspace" or more specific "--set-password bob
  108. rackspace:openstack" DEPRECATED!
  109. .. include:: _includes/output-options.rst
  110. Examples
  111. ========
  112. To create 4 VMs named web1, web2, db1, and db2 from specified profiles:
  113. .. code-block:: bash
  114. salt-cloud -p fedora_rackspace web1 web2 db1 db2
  115. To read in a map file and create all VMs specified therein:
  116. .. code-block:: bash
  117. salt-cloud -m /path/to/cloud.map
  118. To read in a map file and create all VMs specified therein in parallel:
  119. .. code-block:: bash
  120. salt-cloud -m /path/to/cloud.map -P
  121. To delete any VMs specified in the map file:
  122. .. code-block:: bash
  123. salt-cloud -m /path/to/cloud.map -d
  124. To delete any VMs NOT specified in the map file:
  125. .. code-block:: bash
  126. salt-cloud -m /path/to/cloud.map -H
  127. To display the status of all VMs specified in the map file:
  128. .. code-block:: bash
  129. salt-cloud -m /path/to/cloud.map -Q
  130. See also
  131. ========
  132. :manpage:`salt-cloud(7)`
  133. :manpage:`salt(7)`
  134. :manpage:`salt-master(1)`
  135. :manpage:`salt-minion(1)`