2012-06-23 21:13:54 +00:00
|
|
|
VM Profiles
|
|
|
|
===========
|
|
|
|
|
|
|
|
Salt cloud designates virtual machines inside the profile configuration file.
|
2014-12-11 15:51:43 +00:00
|
|
|
The profile configuration file defaults to ``/etc/salt/cloud.profiles`` and is
|
2013-03-07 21:17:09 +00:00
|
|
|
a yaml configuration. The syntax for declaring profiles is simple:
|
2012-06-23 21:13:54 +00:00
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
fedora_rackspace:
|
2013-03-07 21:17:09 +00:00
|
|
|
provider: rackspace
|
|
|
|
image: Fedora 17
|
|
|
|
size: 256 server
|
2014-06-06 19:47:28 +00:00
|
|
|
script: bootstrap-salt
|
2012-06-23 21:13:54 +00:00
|
|
|
|
2014-06-06 19:47:28 +00:00
|
|
|
It should be noted that the ``script`` option defaults to ``bootstrap-salt``,
|
|
|
|
and does not normally need to be specified. Further examples in this document
|
|
|
|
will not show the ``script`` option.
|
2013-04-02 18:25:45 +00:00
|
|
|
|
|
|
|
A few key pieces of information need to be declared and can change based on the
|
2013-01-19 00:36:25 +00:00
|
|
|
public cloud provider. A number of additional parameters can also be inserted:
|
2012-06-23 21:13:54 +00:00
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
centos_rackspace:
|
2013-03-07 21:17:09 +00:00
|
|
|
provider: rackspace
|
|
|
|
image: CentOS 6.2
|
|
|
|
size: 1024 server
|
|
|
|
minion:
|
|
|
|
master: salt.example.com
|
2013-03-22 19:59:12 +00:00
|
|
|
append_domain: webs.example.com
|
2013-09-23 12:43:35 +00:00
|
|
|
grains:
|
|
|
|
role: webserver
|
2013-03-07 21:17:09 +00:00
|
|
|
|
2013-04-02 18:25:45 +00:00
|
|
|
|
2013-03-07 21:17:09 +00:00
|
|
|
The image must be selected from available images. Similarly, sizes must be
|
|
|
|
selected from the list of sizes. To get a list of available images and sizes
|
|
|
|
use the following command:
|
2013-02-28 07:58:11 +00:00
|
|
|
|
|
|
|
.. code-block:: bash
|
2013-03-07 21:17:09 +00:00
|
|
|
|
2013-02-28 07:58:11 +00:00
|
|
|
salt-cloud --list-images openstack
|
|
|
|
salt-cloud --list-sizes openstack
|
|
|
|
|
2012-06-23 21:13:54 +00:00
|
|
|
|
2014-12-11 15:51:43 +00:00
|
|
|
Some parameters can be specified in the main Salt cloud configuration file and
|
|
|
|
then are applied to all cloud profiles. For instance if only a single cloud
|
|
|
|
provider is being used then the provider option can be declared in the Salt
|
2013-04-02 18:25:45 +00:00
|
|
|
cloud configuration file.
|
|
|
|
|
|
|
|
|
|
|
|
Multiple Configuration Files
|
|
|
|
----------------------------
|
2013-04-01 23:37:35 +00:00
|
|
|
|
|
|
|
In addition to ``/etc/salt/cloud.profiles``, profiles can also be specified in
|
2014-12-11 15:51:43 +00:00
|
|
|
any file matching ``cloud.profiles.d/*conf`` which is a sub-directory relative
|
|
|
|
to the profiles configuration file(with the above configuration file as an
|
|
|
|
example, ``/etc/salt/cloud.profiles.d/*.conf``). This allows for more
|
2013-04-01 23:37:35 +00:00
|
|
|
extensible configuration, and plays nicely with various configuration
|
|
|
|
management tools as well as version control systems.
|
|
|
|
|
2013-04-02 18:25:45 +00:00
|
|
|
|
2012-08-01 15:44:15 +00:00
|
|
|
Larger Example
|
|
|
|
--------------
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
2013-11-22 17:56:57 +00:00
|
|
|
rhel_ec2:
|
|
|
|
provider: ec2
|
2013-03-07 21:17:09 +00:00
|
|
|
image: ami-e565ba8c
|
2014-09-27 17:09:08 +00:00
|
|
|
size: t1.micro
|
2013-03-07 21:17:09 +00:00
|
|
|
minion:
|
|
|
|
cheese: edam
|
2012-08-01 15:44:15 +00:00
|
|
|
|
2013-11-22 17:56:57 +00:00
|
|
|
ubuntu_ec2:
|
|
|
|
provider: ec2
|
2013-03-07 21:17:09 +00:00
|
|
|
image: ami-7e2da54e
|
2014-09-27 17:09:08 +00:00
|
|
|
size: t1.micro
|
2013-03-07 21:17:09 +00:00
|
|
|
minion:
|
|
|
|
cheese: edam
|
2013-01-09 22:52:13 +00:00
|
|
|
|
2012-08-01 15:44:15 +00:00
|
|
|
ubuntu_rackspace:
|
2013-03-07 21:17:09 +00:00
|
|
|
provider: rackspace
|
|
|
|
image: Ubuntu 12.04 LTS
|
|
|
|
size: 256 server
|
|
|
|
minion:
|
|
|
|
cheese: edam
|
2012-08-01 15:44:15 +00:00
|
|
|
|
|
|
|
fedora_rackspace:
|
2013-03-07 21:17:09 +00:00
|
|
|
provider: rackspace
|
|
|
|
image: Fedora 17
|
|
|
|
size: 256 server
|
|
|
|
minion:
|
|
|
|
cheese: edam
|
2012-08-01 15:44:15 +00:00
|
|
|
|
|
|
|
cent_linode:
|
2013-03-07 21:17:09 +00:00
|
|
|
provider: linode
|
|
|
|
image: CentOS 6.2 64bit
|
|
|
|
size: Linode 512
|
2012-08-01 15:44:15 +00:00
|
|
|
|
|
|
|
cent_gogrid:
|
2013-03-07 21:17:09 +00:00
|
|
|
provider: gogrid
|
|
|
|
image: 12834
|
|
|
|
size: 512MB
|
2012-08-01 15:44:15 +00:00
|
|
|
|
|
|
|
cent_joyent:
|
2013-03-07 21:17:09 +00:00
|
|
|
provider: joyent
|
|
|
|
image: centos-6
|
2014-12-11 15:51:43 +00:00
|
|
|
size: Small 1GB
|