1
0

softlayer.rst 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. ==============================
  2. Getting Started With SoftLayer
  3. ==============================
  4. SoftLayer is a public cloud host, and baremetal hardware hosting service.
  5. Dependencies
  6. ============
  7. The SoftLayer driver for Salt Cloud requires the softlayer package, which is
  8. available at PyPI:
  9. https://pypi.python.org/pypi/SoftLayer
  10. This package can be installed using ``pip`` or ``easy_install``:
  11. .. code-block:: bash
  12. # pip install softlayer
  13. # easy_install softlayer
  14. Configuration
  15. =============
  16. Set up the cloud config at ``/etc/salt/cloud.providers``:
  17. .. code-block:: yaml
  18. # Note: These examples are for /etc/salt/cloud.providers
  19. my-softlayer:
  20. # Set up the location of the salt master
  21. minion:
  22. master: saltmaster.example.com
  23. # Set the SoftLayer access credentials (see below)
  24. user: MYUSER1138
  25. apikey: 'e3b68aa711e6deadc62d5b76355674beef7cc3116062ddbacafe5f7e465bfdc9'
  26. driver: softlayer
  27. my-softlayer-hw:
  28. # Set up the location of the salt master
  29. minion:
  30. master: saltmaster.example.com
  31. # Set the SoftLayer access credentials (see below)
  32. user: MYUSER1138
  33. apikey: 'e3b68aa711e6deadc62d5b76355674beef7cc3116062ddbacafe5f7e465bfdc9'
  34. driver: softlayer_hw
  35. .. note::
  36. .. versionchanged:: 2015.8.0
  37. The ``provider`` parameter in cloud provider definitions was renamed to ``driver``. This
  38. change was made to avoid confusion with the ``provider`` parameter that is used in cloud profile
  39. definitions. Cloud provider definitions now use ``driver`` to refer to the Salt cloud module that
  40. provides the underlying functionality to connect to a cloud host, while cloud profiles continue
  41. to use ``provider`` to refer to provider configurations that you define.
  42. Access Credentials
  43. ==================
  44. The ``user`` setting is the same user as is used to log into the SoftLayer
  45. Administration area. The ``apikey`` setting is found inside the Admin area after
  46. logging in:
  47. * Hover over the ``Account`` menu item.
  48. * Click the ``Users`` link.
  49. * Find the ``API Key`` column and click ``View``.
  50. Profiles
  51. ========
  52. Cloud Profiles
  53. ~~~~~~~~~~~~~~
  54. Set up an initial profile at ``/etc/salt/cloud.profiles``:
  55. .. code-block:: yaml
  56. base_softlayer_ubuntu:
  57. provider: my-softlayer
  58. image: UBUNTU_LATEST
  59. cpu_number: 1
  60. ram: 1024
  61. disk_size: 100
  62. local_disk: True
  63. hourly_billing: True
  64. domain: example.com
  65. location: sjc01
  66. # Optional
  67. max_net_speed: 1000
  68. private_vlan: 396
  69. private_network: True
  70. private_ssh: True
  71. # Use a dedicated host instead of cloud
  72. dedicated_host_id: 1234
  73. # May be used _instead_of_ image
  74. global_identifier: 320d8be5-46c0-dead-cafe-13e3c51
  75. Most of the above items are required; optional items are specified below.
  76. image
  77. -----
  78. Images to build an instance can be found using the ``--list-images`` option:
  79. .. code-block:: bash
  80. # salt-cloud --list-images my-softlayer
  81. The setting used will be labeled as ``template``.
  82. cpu_number
  83. ----------
  84. This is the number of CPU cores that will be used for this instance. This
  85. number may be dependent upon the image that is used. For instance:
  86. .. code-block:: yaml
  87. Red Hat Enterprise Linux 6 - Minimal Install (64 bit) (1 - 4 Core):
  88. ----------
  89. name:
  90. Red Hat Enterprise Linux 6 - Minimal Install (64 bit) (1 - 4 Core)
  91. template:
  92. REDHAT_6_64
  93. Red Hat Enterprise Linux 6 - Minimal Install (64 bit) (5 - 100 Core):
  94. ----------
  95. name:
  96. Red Hat Enterprise Linux 6 - Minimal Install (64 bit) (5 - 100 Core)
  97. template:
  98. REDHAT_6_64
  99. Note that the template (meaning, the `image` option) for both of these is the
  100. same, but the names suggests how many CPU cores are supported.
  101. ram
  102. ---
  103. This is the amount of memory, in megabytes, that will be allocated to this
  104. instance.
  105. disk_size
  106. ---------
  107. The amount of disk space that will be allocated to this image, in gigabytes.
  108. .. code-block:: yaml
  109. base_softlayer_ubuntu:
  110. disk_size: 100
  111. Using Multiple Disks
  112. ~~~~~~~~~~~~~~~~~~~~
  113. .. versionadded:: 2015.8.1
  114. SoftLayer allows up to 5 disks to be specified for a virtual machine upon
  115. creation. Multiple disks can be specified either as a list or a comma-delimited
  116. string. The first ``disk_size`` specified in the string or list will be the first
  117. disk size assigned to the VM.
  118. List Example:
  119. .. code-block:: yaml
  120. base_softlayer_ubuntu:
  121. disk_size: ['100', '20', '20']
  122. String Example:
  123. .. code-block:: yaml
  124. base_softlayer_ubuntu:
  125. disk_size: '100, 20, 20'
  126. local_disk
  127. ----------
  128. When true the disks for the computing instance will be provisioned on the host
  129. which it runs, otherwise SAN disks will be provisioned.
  130. hourly_billing
  131. --------------
  132. When true the computing instance will be billed on hourly usage, otherwise it
  133. will be billed on a monthly basis.
  134. domain
  135. ------
  136. The domain name that will be used in the FQDN (Fully Qualified Domain Name) for
  137. this instance. The `domain` setting will be used in conjunction with the
  138. instance name to form the FQDN.
  139. use_fqdn
  140. --------
  141. If set to True, the Minion will be identified by the FQDN (Fully Qualified Domain
  142. Name) which is a result of combining the ``domain`` configuration value and the
  143. Minion name specified either via the CLI or a map file rather than only using the
  144. short host name, or Minion ID. Default is False.
  145. .. versionadded:: 2016.3.0
  146. For example, if the value of ``domain`` is ``example.com`` and a new VM was created
  147. via the CLI with ``salt-cloud -p base_softlayer_ubuntu my-vm``, the resulting
  148. Minion ID would be ``my-vm.example.com``.
  149. .. note::
  150. When enabling the ``use_fqdn`` setting, the Minion ID will be the FQDN and will
  151. interact with salt commands with the FQDN instead of the short hostname. However,
  152. due to the way the SoftLayer API is constructed, some Salt Cloud functions such
  153. as listing nodes or destroying VMs will only list the short hostname of the VM
  154. instead of the FQDN.
  155. Example output displaying the SoftLayer hostname quirk mentioned in the note above
  156. (note the Minion ID is ``my-vm.example.com``, but the VM to be destroyed is listed
  157. with its short hostname, ``my-vm``):
  158. .. code-block:: bash
  159. # salt-key -L
  160. Accepted Keys:
  161. my-vm.example.com
  162. Denied Keys:
  163. Unaccepted Keys:
  164. Rejected Keys:
  165. #
  166. #
  167. # salt my-vm.example.com test.version
  168. my-vm.example.com:
  169. 2018.3.4
  170. #
  171. #
  172. # salt-cloud -d my-vm.example.com
  173. [INFO ] salt-cloud starting
  174. [INFO ] POST https://api.softlayer.com/xmlrpc/v3.1/SoftLayer_Account
  175. The following virtual machines are set to be destroyed:
  176. softlayer-config:
  177. softlayer:
  178. my-vm
  179. Proceed? [N/y] y
  180. ... proceeding
  181. [INFO ] Destroying in non-parallel mode.
  182. [INFO ] POST https://api.softlayer.com/xmlrpc/v3.1/SoftLayer_Account
  183. [INFO ] POST https://api.softlayer.com/xmlrpc/v3.1/SoftLayer_Virtual_Guest
  184. softlayer-config:
  185. ----------
  186. softlayer:
  187. ----------
  188. my-vm:
  189. True
  190. location
  191. --------
  192. Images to build an instance can be found using the `--list-locations` option:
  193. .. code-block:: bash
  194. # salt-cloud --list-location my-softlayer
  195. max_net_speed
  196. -------------
  197. Specifies the connection speed for the instance's network components. This
  198. setting is optional. By default, this is set to 10.
  199. post_uri
  200. --------
  201. Specifies the uri location of the script to be downloaded and run after the instance
  202. is provisioned.
  203. .. versionadded:: 2015.8.1
  204. Example:
  205. .. code-block:: yaml
  206. base_softlayer_ubuntu:
  207. post_uri: 'https://SOMESERVERIP:8000/myscript.sh'
  208. public_vlan
  209. -----------
  210. If it is necessary for an instance to be created within a specific frontend
  211. VLAN, the ID for that VLAN can be specified in either the provider or profile
  212. configuration.
  213. This ID can be queried using the `list_vlans` function, as described below. This
  214. setting is optional.
  215. If this setting is set to `None`, salt-cloud will connect to the private ip of
  216. the server.
  217. .. note::
  218. If this setting is not provided and the server is not built with a public
  219. vlan, `private_ssh` or `private_wds` will need to be set to make sure that
  220. salt-cloud attempts to connect to the private ip.
  221. private_vlan
  222. ------------
  223. If it is necessary for an instance to be created within a specific backend VLAN,
  224. the ID for that VLAN can be specified in either the provider or profile
  225. configuration.
  226. This ID can be queried using the `list_vlans` function, as described below. This
  227. setting is optional.
  228. private_network
  229. ---------------
  230. If a server is to only be used internally, meaning it does not have a public
  231. VLAN associated with it, this value would be set to True. This setting is
  232. optional. The default is False.
  233. private_ssh or private_wds
  234. --------------------------
  235. Whether to run the deploy script on the server using the public IP address
  236. or the private IP address. If set to True, Salt Cloud will attempt to SSH or
  237. WinRM into the new server using the private IP address. The default is False.
  238. This settiong is optional.
  239. global_identifier
  240. -----------------
  241. When creating an instance using a custom template, this option is set to the
  242. corresponding value obtained using the `list_custom_images` function. This
  243. option will not be used if an `image` is set, and if an `image` is not set, it
  244. is required.
  245. The profile can be realized now with a salt command:
  246. .. code-block:: bash
  247. # salt-cloud -p base_softlayer_ubuntu myserver
  248. Using the above configuration, this will create `myserver.example.com`.
  249. Once the instance has been created with salt-minion installed, connectivity to
  250. it can be verified with Salt:
  251. .. code-block:: bash
  252. # salt 'myserver.example.com' test.version
  253. Dedicated Host
  254. ~~~~~~~~~~~~~~
  255. Soflayer allows the creation of new VMs in a dedicated host. This means that
  256. you can order and pay a fixed amount for a bare metal dedicated host and use
  257. it to provision as many VMs as you can fit in there. If you want your VMs to
  258. be launched in a dedicated host, instead of Sofltayer's cloud, set the
  259. ``dedicated_host_id`` parameter in your profile.
  260. dedicated_host_id
  261. -----------------
  262. The id of the dedicated host where the VMs should be created. If not set, VMs
  263. will be created in Softlayer's cloud instead.
  264. Bare metal Profiles
  265. ~~~~~~~~~~~~~~~~~~~
  266. Set up an initial profile at ``/etc/salt/cloud.profiles``:
  267. .. code-block:: yaml
  268. base_softlayer_hw_centos:
  269. provider: my-softlayer-hw
  270. # CentOS 6.0 - Minimal Install (64 bit)
  271. image: 13963
  272. # 2 x 2.0 GHz Core Bare Metal Instance - 2 GB Ram
  273. size: 1921
  274. # 500GB SATA II
  275. hdd: 1267
  276. # San Jose 01
  277. location: 168642
  278. domain: example.com
  279. # Optional
  280. vlan: 396
  281. port_speed: 273
  282. banwidth: 248
  283. Most of the above items are required; optional items are specified below.
  284. image
  285. -----
  286. Images to build an instance can be found using the `--list-images` option:
  287. .. code-block:: bash
  288. # salt-cloud --list-images my-softlayer-hw
  289. A list of `id`s and names will be provided. The `name` will describe the
  290. operating system and architecture. The `id` will be the setting to be used in
  291. the profile.
  292. size
  293. ----
  294. Sizes to build an instance can be found using the `--list-sizes` option:
  295. .. code-block:: bash
  296. # salt-cloud --list-sizes my-softlayer-hw
  297. A list of `id`s and names will be provided. The `name` will describe the speed
  298. and quantity of CPU cores, and the amount of memory that the hardware will
  299. contain. The `id` will be the setting to be used in the profile.
  300. hdd
  301. ---
  302. There is currently only one size of hard disk drive (HDD) that is available for
  303. hardware instances on SoftLayer:
  304. .. code-block:: yaml
  305. 1267: 500GB SATA II
  306. The `hdd` setting in the profile should be 1267. Other sizes may be
  307. added in the future.
  308. location
  309. --------
  310. Locations to build an instance can be found using the `--list-images` option:
  311. .. code-block:: bash
  312. # salt-cloud --list-locations my-softlayer-hw
  313. A list of IDs and names will be provided. The `location` will describe the
  314. location in human terms. The `id` will be the setting to be used in the profile.
  315. domain
  316. ------
  317. The domain name that will be used in the FQDN (Fully Qualified Domain Name) for
  318. this instance. The `domain` setting will be used in conjunction with the
  319. instance name to form the FQDN.
  320. vlan
  321. ----
  322. If it is necessary for an instance to be created within a specific VLAN, the ID
  323. for that VLAN can be specified in either the provider or profile configuration.
  324. This ID can be queried using the `list_vlans` function, as described below.
  325. port_speed
  326. ----------
  327. Specifies the speed for the instance's network port. This setting refers to an
  328. ID within the SoftLayer API, which sets the port speed. This setting is
  329. optional. The default is 273, or, 100 Mbps Public & Private Networks. The
  330. following settings are available:
  331. * 273: 100 Mbps Public & Private Networks
  332. * 274: 1 Gbps Public & Private Networks
  333. * 21509: 10 Mbps Dual Public & Private Networks (up to 20 Mbps)
  334. * 21513: 100 Mbps Dual Public & Private Networks (up to 200 Mbps)
  335. * 2314: 1 Gbps Dual Public & Private Networks (up to 2 Gbps)
  336. * 272: 10 Mbps Public & Private Networks
  337. bandwidth
  338. ---------
  339. Specifies the network bandwidth available for the instance. This setting refers
  340. to an ID within the SoftLayer API, which sets the bandwidth. This setting is
  341. optional. The default is 248, or, 5000 GB Bandwidth. The following settings are
  342. available:
  343. * 248: 5000 GB Bandwidth
  344. * 129: 6000 GB Bandwidth
  345. * 130: 8000 GB Bandwidth
  346. * 131: 10000 GB Bandwidth
  347. * 36: Unlimited Bandwidth (10 Mbps Uplink)
  348. * 125: Unlimited Bandwidth (100 Mbps Uplink)
  349. Actions
  350. =======
  351. The following actions are currently supported by the SoftLayer Salt Cloud
  352. driver.
  353. show_instance
  354. ~~~~~~~~~~~~~
  355. This action is a thin wrapper around `--full-query`, which displays details on a
  356. single instance only. In an environment with several machines, this will save a
  357. user from having to sort through all instance data, just to examine a single
  358. instance.
  359. .. code-block:: bash
  360. $ salt-cloud -a show_instance myinstance
  361. Functions
  362. =========
  363. The following functions are currently supported by the SoftLayer Salt Cloud
  364. driver.
  365. list_vlans
  366. ~~~~~~~~~~
  367. This function lists all VLANs associated with the account, and all known data
  368. from the SoftLayer API concerning those VLANs.
  369. .. code-block:: bash
  370. $ salt-cloud -f list_vlans my-softlayer
  371. $ salt-cloud -f list_vlans my-softlayer-hw
  372. The `id` returned in this list is necessary for the `vlan` option when creating
  373. an instance.
  374. list_custom_images
  375. ~~~~~~~~~~~~~~~~~~
  376. This function lists any custom templates associated with the account, that can
  377. be used to create a new instance.
  378. .. code-block:: bash
  379. $ salt-cloud -f list_custom_images my-softlayer
  380. The `globalIdentifier` returned in this list is necessary for the
  381. `global_identifier` option when creating an image using a custom template.
  382. Optional Products for SoftLayer HW
  383. ==================================
  384. The softlayer_hw driver supports the ability to add optional products, which
  385. are supported by SoftLayer's API. These products each have an ID associated with
  386. them, that can be passed into Salt Cloud with the `optional_products` option:
  387. .. code-block:: yaml
  388. softlayer_hw_test:
  389. provider: my-softlayer-hw
  390. # CentOS 6.0 - Minimal Install (64 bit)
  391. image: 13963
  392. # 2 x 2.0 GHz Core Bare Metal Instance - 2 GB Ram
  393. size: 1921
  394. # 500GB SATA II
  395. hdd: 1267
  396. # San Jose 01
  397. location: 168642
  398. domain: example.com
  399. optional_products:
  400. # MySQL for Linux
  401. - id: 28
  402. # Business Continuance Insurance
  403. - id: 104
  404. These values can be manually obtained by looking at the source of an order page
  405. on the SoftLayer web interface. For convenience, many of these values are listed
  406. here:
  407. Public Secondary IP Addresses
  408. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  409. * 22: 4 Public IP Addresses
  410. * 23: 8 Public IP Addresses
  411. Primary IPv6 Addresses
  412. ~~~~~~~~~~~~~~~~~~~~~~
  413. * 17129: 1 IPv6 Address
  414. Public Static IPv6 Addresses
  415. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  416. * 1481: /64 Block Static Public IPv6 Addresses
  417. OS-Specific Addon
  418. ~~~~~~~~~~~~~~~~~
  419. * 17139: XenServer Advanced for XenServer 6.x
  420. * 17141: XenServer Enterprise for XenServer 6.x
  421. * 2334: XenServer Advanced for XenServer 5.6
  422. * 2335: XenServer Enterprise for XenServer 5.6
  423. * 13915: Microsoft WebMatrix
  424. * 21276: VMware vCenter 5.1 Standard
  425. Control Panel Software
  426. ~~~~~~~~~~~~~~~~~~~~~~
  427. * 121: cPanel/WHM with Fantastico and RVskin
  428. * 20778: Parallels Plesk Panel 11 (Linux) 100 Domain w/ Power Pack
  429. * 20786: Parallels Plesk Panel 11 (Windows) 100 Domain w/ Power Pack
  430. * 20787: Parallels Plesk Panel 11 (Linux) Unlimited Domain w/ Power Pack
  431. * 20792: Parallels Plesk Panel 11 (Windows) Unlimited Domain w/ Power Pack
  432. * 2340: Parallels Plesk Panel 10 (Linux) 100 Domain w/ Power Pack
  433. * 2339: Parallels Plesk Panel 10 (Linux) Unlimited Domain w/ Power Pack
  434. * 13704: Parallels Plesk Panel 10 (Windows) Unlimited Domain w/ Power Pack
  435. Database Software
  436. ~~~~~~~~~~~~~~~~~
  437. * 29: MySQL 5.0 for Windows
  438. * 28: MySQL for Linux
  439. * 21501: Riak 1.x
  440. * 20893: MongoDB
  441. * 30: Microsoft SQL Server 2005 Express
  442. * 92: Microsoft SQL Server 2005 Workgroup
  443. * 90: Microsoft SQL Server 2005 Standard
  444. * 94: Microsoft SQL Server 2005 Enterprise
  445. * 1330: Microsoft SQL Server 2008 Express
  446. * 1340: Microsoft SQL Server 2008 Web
  447. * 1337: Microsoft SQL Server 2008 Workgroup
  448. * 1334: Microsoft SQL Server 2008 Standard
  449. * 1331: Microsoft SQL Server 2008 Enterprise
  450. * 2179: Microsoft SQL Server 2008 Express R2
  451. * 2173: Microsoft SQL Server 2008 Web R2
  452. * 2183: Microsoft SQL Server 2008 Workgroup R2
  453. * 2180: Microsoft SQL Server 2008 Standard R2
  454. * 2176: Microsoft SQL Server 2008 Enterprise R2
  455. Anti-Virus & Spyware Protection
  456. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  457. * 594: McAfee VirusScan Anti-Virus - Windows
  458. * 414: McAfee Total Protection - Windows
  459. Insurance
  460. ~~~~~~~~~
  461. * 104: Business Continuance Insurance
  462. Monitoring
  463. ~~~~~~~~~~
  464. * 55: Host Ping
  465. * 56: Host Ping and TCP Service Monitoring
  466. Notification
  467. ~~~~~~~~~~~~
  468. * 57: Email and Ticket
  469. Advanced Monitoring
  470. ~~~~~~~~~~~~~~~~~~~
  471. * 2302: Monitoring Package - Basic
  472. * 2303: Monitoring Package - Advanced
  473. * 2304: Monitoring Package - Premium Application
  474. Response
  475. ~~~~~~~~
  476. * 58: Automated Notification
  477. * 59: Automated Reboot from Monitoring
  478. * 60: 24x7x365 NOC Monitoring, Notification, and Response
  479. Intrusion Detection & Protection
  480. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  481. * 413: McAfee Host Intrusion Protection w/Reporting
  482. Hardware & Software Firewalls
  483. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  484. * 411: APF Software Firewall for Linux
  485. * 894: Microsoft Windows Firewall
  486. * 410: 10Mbps Hardware Firewall
  487. * 409: 100Mbps Hardware Firewall
  488. * 408: 1000Mbps Hardware Firewall