2013-02-28 07:59:28 +00:00
|
|
|
==============================
|
2013-03-01 23:28:03 +00:00
|
|
|
Getting Started With Rackspace
|
2013-02-28 07:59:28 +00:00
|
|
|
==============================
|
|
|
|
|
2013-12-11 13:34:41 +00:00
|
|
|
Rackspace is a major public cloud platform which may be configured using either
|
|
|
|
the `rackspace` or the `openstack` driver, depending on your needs.
|
2013-02-28 07:59:28 +00:00
|
|
|
|
2015-08-10 15:20:26 +00:00
|
|
|
Please note that the `rackspace` driver is intended only for 1st gen instances,
|
2014-02-08 12:29:32 +00:00
|
|
|
aka, "the old cloud" at Rackspace. It is required for 1st gen instances, but
|
|
|
|
will *not* work with OpenStack-based instances. Unless you explicitly have a
|
|
|
|
reason to use it, it is highly recommended that you use the `openstack` driver
|
|
|
|
instead.
|
2013-02-28 07:59:28 +00:00
|
|
|
|
2014-09-04 02:10:51 +00:00
|
|
|
|
|
|
|
Dependencies
|
|
|
|
============
|
|
|
|
* Libcloud >= 0.13.2
|
|
|
|
|
|
|
|
|
|
|
|
Configuration
|
|
|
|
=============
|
2014-12-11 15:51:43 +00:00
|
|
|
To use the `openstack` driver (recommended), set up the cloud configuration at
|
|
|
|
``/etc/salt/cloud.providers`` or
|
2013-04-02 18:25:45 +00:00
|
|
|
``/etc/salt/cloud.providers.d/rackspace.conf``:
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
2013-04-06 14:08:24 +00:00
|
|
|
my-rackspace-config:
|
2013-04-02 18:25:45 +00:00
|
|
|
# Set the location of the salt-master
|
|
|
|
#
|
|
|
|
minion:
|
|
|
|
master: saltmaster.example.com
|
|
|
|
|
|
|
|
# Configure Rackspace using the OpenStack plugin
|
|
|
|
#
|
|
|
|
identity_url: 'https://identity.api.rackspacecloud.com/v2.0/tokens'
|
|
|
|
compute_name: cloudServersOpenStack
|
|
|
|
protocol: ipv4
|
|
|
|
|
|
|
|
# Set the compute region:
|
|
|
|
#
|
|
|
|
compute_region: DFW
|
|
|
|
|
|
|
|
# Configure Rackspace authentication credentials
|
|
|
|
#
|
|
|
|
user: myname
|
|
|
|
tenant: 123456
|
|
|
|
apikey: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
|
2015-06-17 22:41:03 +00:00
|
|
|
driver: openstack
|
2013-04-04 23:06:55 +00:00
|
|
|
|
2013-04-02 18:25:45 +00:00
|
|
|
|
2014-12-11 15:51:43 +00:00
|
|
|
To use the `rackspace` driver, set up the cloud configuration at
|
|
|
|
``/etc/salt/cloud.providers`` or
|
2013-12-11 13:34:41 +00:00
|
|
|
``/etc/salt/cloud.providers.d/rackspace.conf``:
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
my-rackspace-config:
|
2015-06-17 22:41:03 +00:00
|
|
|
driver: rackspace
|
2013-12-11 13:34:41 +00:00
|
|
|
# The Rackspace login user
|
|
|
|
user: fred
|
|
|
|
# The Rackspace user's apikey
|
|
|
|
apikey: 901d3f579h23c8v73q9
|
|
|
|
|
|
|
|
The settings that follow are for using Rackspace with the `openstack` driver,
|
|
|
|
and will not work with the `rackspace` driver.
|
|
|
|
|
2015-08-10 15:20:26 +00:00
|
|
|
.. note::
|
|
|
|
.. versionchanged:: 2015.8.0
|
|
|
|
|
|
|
|
The ``provider`` parameter in cloud provider definitions was renamed to ``driver``. This
|
|
|
|
change was made to avoid confusion with the ``provider`` parameter that is used in cloud profile
|
|
|
|
definitions. Cloud provider definitions now use ``driver`` to refer to the Salt cloud module that
|
|
|
|
provides the underlying functionality to connect to a cloud host, while cloud profiles continue
|
|
|
|
to use ``provider`` to refer to provider configurations that you define.
|
2013-04-02 18:25:45 +00:00
|
|
|
|
2013-03-07 21:35:44 +00:00
|
|
|
Compute Region
|
|
|
|
==============
|
2013-04-02 18:25:45 +00:00
|
|
|
|
2013-11-14 13:29:57 +00:00
|
|
|
Rackspace currently has six compute regions which may be used:
|
2013-02-28 07:59:28 +00:00
|
|
|
|
2013-06-21 00:58:36 +00:00
|
|
|
.. code-block:: bash
|
2013-03-07 21:35:44 +00:00
|
|
|
|
|
|
|
DFW -> Dallas/Forth Worth
|
|
|
|
ORD -> Chicago
|
2013-08-10 09:18:29 +00:00
|
|
|
SYD -> Sydney
|
2013-03-07 21:35:44 +00:00
|
|
|
LON -> London
|
2013-09-25 21:07:20 +00:00
|
|
|
IAD -> Northern Virginia
|
2013-11-14 13:29:57 +00:00
|
|
|
HKG -> Hong Kong
|
2013-03-07 21:35:44 +00:00
|
|
|
|
2014-04-30 20:55:30 +00:00
|
|
|
Note: Currently the LON region is only available with a UK account, and UK accounts cannot access other regions
|
2013-04-07 13:48:51 +00:00
|
|
|
|
2013-03-07 21:35:44 +00:00
|
|
|
Authentication
|
|
|
|
==============
|
2013-04-02 18:25:45 +00:00
|
|
|
|
2014-12-11 15:51:43 +00:00
|
|
|
The ``user`` is the same user as is used to log into the Rackspace Control
|
|
|
|
Panel. The ``tenant`` and ``apikey`` can be found in the API Keys area of the
|
|
|
|
Control Panel. The ``apikey`` will be labeled as API Key (and may need to be
|
2013-03-07 21:35:44 +00:00
|
|
|
generated), and ``tenant`` will be labeled as Cloud Account Number.
|
|
|
|
|
2014-12-11 15:51:43 +00:00
|
|
|
An initial profile can be configured in ``/etc/salt/cloud.profiles`` or
|
2013-09-25 20:26:31 +00:00
|
|
|
``/etc/salt/cloud.profiles.d/rackspace.conf``:
|
2013-04-02 18:25:45 +00:00
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
openstack_512:
|
2013-09-24 22:37:59 +00:00
|
|
|
provider: my-rackspace-config
|
2013-11-14 13:29:57 +00:00
|
|
|
size: 512 MB Standard
|
2013-04-02 18:25:45 +00:00
|
|
|
image: Ubuntu 12.04 LTS (Precise Pangolin)
|
|
|
|
|
2013-03-07 21:35:44 +00:00
|
|
|
To instantiate a machine based on this profile:
|
2013-02-28 07:59:28 +00:00
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
2013-03-07 21:35:44 +00:00
|
|
|
# salt-cloud -p openstack_512 myinstance
|
2013-02-28 07:59:28 +00:00
|
|
|
|
2013-03-07 21:35:44 +00:00
|
|
|
This will create a virtual machine at Rackspace with the name ``myinstance``.
|
2014-12-11 15:51:43 +00:00
|
|
|
This operation may take several minutes to complete, depending on the current
|
2013-03-07 21:35:44 +00:00
|
|
|
load at the Rackspace data center.
|
2013-02-28 07:59:28 +00:00
|
|
|
|
2014-12-11 15:51:43 +00:00
|
|
|
Once the instance has been created with salt-minion installed, connectivity to
|
2013-03-07 21:35:44 +00:00
|
|
|
it can be verified with Salt:
|
2013-02-28 07:59:28 +00:00
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
2013-03-07 21:35:44 +00:00
|
|
|
# salt myinstance test.ping
|
2013-02-28 07:59:28 +00:00
|
|
|
|
2013-09-01 20:47:16 +00:00
|
|
|
RackConnect Environments
|
2015-06-17 22:41:03 +00:00
|
|
|
------------------------
|
2013-09-01 20:47:16 +00:00
|
|
|
|
2013-09-01 20:48:59 +00:00
|
|
|
Rackspace offers a hybrid hosting configuration option called RackConnect that
|
2013-12-11 13:34:41 +00:00
|
|
|
allows you to use a physical firewall appliance with your cloud servers. When
|
|
|
|
this service is in use the public_ip assigned by nova will be replaced by a NAT
|
|
|
|
ip on the firewall. For salt-cloud to work properly it must use the newly
|
|
|
|
assigned "access ip" instead of the Nova assigned public ip. You can enable that
|
|
|
|
capability by adding this to your profiles:
|
2013-09-01 20:47:16 +00:00
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
openstack_512:
|
|
|
|
provider: my-openstack-config
|
2013-11-14 13:29:57 +00:00
|
|
|
size: 512 MB Standard
|
2013-09-01 20:47:16 +00:00
|
|
|
image: Ubuntu 12.04 LTS (Precise Pangolin)
|
|
|
|
rackconnect: True
|
2013-06-01 18:28:28 +00:00
|
|
|
|
2013-09-29 22:15:09 +00:00
|
|
|
Managed Cloud Environments
|
2015-06-17 22:41:03 +00:00
|
|
|
--------------------------
|
2013-09-29 22:15:09 +00:00
|
|
|
|
2013-12-11 13:34:41 +00:00
|
|
|
Rackspace offers a managed service level of hosting. As part of the managed
|
|
|
|
service level you have the ability to choose from base of lamp installations on
|
|
|
|
cloud server images. The post build process for both the base and the lamp
|
|
|
|
installations used Chef to install things such as the cloud monitoring agent and
|
|
|
|
the cloud backup agent. It also takes care of installing the lamp stack if
|
|
|
|
selected. In order to prevent the post installation process from stomping over
|
|
|
|
the bootstrapping you can add the below to your profiles.
|
2013-09-29 22:15:09 +00:00
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
openstack_512:
|
|
|
|
provider: my-rackspace-config
|
2013-11-14 13:29:57 +00:00
|
|
|
size: 512 MB Standard
|
2013-09-29 22:15:09 +00:00
|
|
|
image: Ubuntu 12.04 LTS (Precise Pangolin)
|
|
|
|
managedcloud: True
|
|
|
|
|
2013-06-01 18:31:38 +00:00
|
|
|
First and Next Generation Images
|
|
|
|
--------------------------------
|
2013-06-01 18:28:28 +00:00
|
|
|
|
2014-12-12 19:32:16 +00:00
|
|
|
Rackspace provides two sets of virtual machine images, *first*, and *next*
|
2013-06-01 18:28:28 +00:00
|
|
|
generation. As of ``0.8.9`` salt-cloud will default to using the *next*
|
2014-12-11 15:51:43 +00:00
|
|
|
generation images. To force the use of first generation images, on the profile
|
2013-06-01 18:28:28 +00:00
|
|
|
configuration please add:
|
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
FreeBSD-9.0-512:
|
2013-09-25 20:26:31 +00:00
|
|
|
provider: my-rackspace-config
|
2013-11-14 13:29:57 +00:00
|
|
|
size: 512 MB Standard
|
2013-06-01 18:28:28 +00:00
|
|
|
image: FreeBSD 9.0
|
|
|
|
force_first_gen: True
|
2015-01-03 03:28:45 +00:00
|
|
|
|
|
|
|
Private Subnets
|
2015-08-10 15:20:26 +00:00
|
|
|
---------------
|
|
|
|
By default salt-cloud will not add Rackspace private networks to new servers. To enable
|
2015-01-03 03:28:45 +00:00
|
|
|
a private network to a server instantiated by salt cloud, add the following section
|
2015-08-10 15:20:26 +00:00
|
|
|
to the provider file (typically ``/etc/salt/cloud.providers.d/rackspace.conf``)
|
2015-01-03 03:28:45 +00:00
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
networks:
|
|
|
|
- fixed:
|
|
|
|
# This is the private network
|
|
|
|
- private-network-id
|
|
|
|
# This is Rackspace's "PublicNet"
|
|
|
|
- 00000000-0000-0000-0000-000000000000
|
|
|
|
# This is Rackspace's "ServiceNet"
|
|
|
|
- 11111111-1111-1111-1111-111111111111
|
|
|
|
|
|
|
|
To get the Rackspace private network ID, go to Networking, Networks and hover over the private network name.
|
|
|
|
|
|
|
|
The order of the networks in the above code block does not map to the order of the
|
|
|
|
ethernet devices on newly created servers. Public IP will always be first ( eth0 )
|
|
|
|
followed by servicenet ( eth1 ) and then private networks.
|
|
|
|
|
|
|
|
Enabling the private network per above gives the option of using the private subnet for
|
|
|
|
all master-minion communication, including the bootstrap install of salt-minion. To
|
|
|
|
enable the minion to use the private subnet, update the master: line in the minion:
|
|
|
|
section of the providers file. To configure the master to only listen on the private
|
|
|
|
subnet IP, update the interface: line in the /etc/salt/master file to be the private
|
|
|
|
subnet IP of the salt master.
|