Only pass distinct services to enabled_services list
[apex-tripleo-heat-templates.git] / deployed-server / README.rst
1 TripleO with Deployed Servers
2 =============================
3
4 The deployed-server set of templates can be used to deploy TripleO via
5 tripleo-heat-templates to servers that are already installed with a base
6 operating system.
7
8 When OS::TripleO::Server is mapped to the deployed-server.yaml template via the
9 provided deployed-server-environment.yaml resource registry, Nova and Ironic
10 are not used to create any server instances. Heat continues to create the
11 SoftwareDeployment resources, and they are made available to the already
12 deployed and running servers.
13
14 Template Usage
15 --------------
16 To use these templates pass the included environment file to the deployment
17 command::
18
19     -e deployed-server/deployed-server-environment.yaml
20
21 Deployed Server configuration
22 -----------------------------
23 It is currently assumed that the deployed servers being used have the required
24 set of software and packages already installed on them. These exact
25 requirements must match how such a server would look if it were deployed the
26 standard way via Ironic using the TripleO overcloud-full image.
27
28 An easy way to help get this setup for development is to use an overcloud-full
29 image from an already existing TripleO setup. Create the vm's for the already
30 deployed server, and use the overcloud-full image as their disk.
31
32 Each server must have a fqdn set that resolves to an IP address on a routable
33 network (e.g., the hostname should not resolve to 127.0.0.1).  The hostname
34 will be detected on each server via the hostnamectl --static command.
35
36 Each server also must have a route to the configured IP address on the
37 undercloud where the OpenStack services are listening. This is the value for
38 local_ip in the undercloud.conf.
39
40 It's recommended that each server have at least 2 nic's. One used for external
41 management such as ssh, and one used for the OpenStack deployment itself. Since
42 the overcloud deployment will reconfigure networking on the configured nic to
43 be used by OpenStack, the external management nic is needed as a fallback so
44 that all connectivity is not lost in case of a configuration error. Be sure to
45 use correct nic config templates as needed, since the nodes will not receive
46 dhcp from the undercloud neutron-dhcp-agent service.
47
48 For example, the net-config-static-bridge.yaml template could be used for
49 controllers, and the net-config-static.yaml template could be used for computes
50 by specifying:
51
52 resource_registry:
53   OS::TripleO::Controller::Net::SoftwareConfig: /home/stack/deployed-server/tripleo-heat-templates/net-config-static-bridge.yaml
54   OS::TripleO::Compute::Net::SoftwareConfig: /home/stack/deployed-server/tripleo-heat-templates/net-config-static.yaml
55
56 In a setup where the first nic on the servers is used for external management,
57 set the nic's to be used for OpenStack to nic2:
58
59 parameter_defaults:
60   NeutronPublicInterface: nic2
61   HypervisorNeutronPublicInterface: nic2
62
63 The above nic config templates also require a route to the ctlplane network to
64 be defined. Define the needed parameters as necessary for your environment, for
65 example:
66
67 parameter_defaults:
68   ControlPlaneDefaultRoute: 192.168.122.130
69   ControlPlaneSubnetCidr: "24"
70   EC2MetadataIp: "192.168.24.1"
71
72 In this example, 192.168.122.130 is the external management IP of an
73 undercloud, thus it is the default route for the configured local_ip value of
74 192.168.24.1.
75
76
77 os-collect-config
78 -----------------
79 os-collect-config on each deployed server must be manually configured to poll
80 the Heat API for the available SoftwareDeployments. An example configuration
81 for /etc/os-collect-config.conf looks like:
82
83     [DEFAULT]
84     collectors=heat
85     command=os-refresh-config
86
87     [heat]
88     # you can get these values from stackrc on the undercloud
89     user_id=<a user that can connect to heat> # note this must be the ID, not the username
90     password=<a password>
91     auth_url=<keystone url>
92     project_id=<project_id> # note, this must be the ID, not project name
93     stack_id=<stack_id>
94     resource_name=<resource_name>
95
96 Note that the stack_id value is the id of the nested stack containing the
97 resource (identified by resource_name) implemented by the deployed-server.yaml
98 templates.
99
100 Once the configuration for os-collect-config has been defined, the service
101 needs to be restarted. Once restarted, it will start polling Heat and applying
102 the SoftwareDeployments.
103
104 A sample script at deployed-server/scripts/get-occ-config.sh is included that
105 will automatically generate the os-collect-config configuration needed on each
106 server, ssh to each server, copy the configuration, and restart the
107 os-collect-config service.
108
109 .. warning::
110    The get-occ-config.sh script is not intended for production use, as it
111    copies admin credentials to each of the deployed nodes.
112
113 The script can only be used once the stack id's of the nested deployed-server
114 stacks have been created via Heat. This usually only takes a couple of minutes
115 once the deployment command has been started. Once the following output is seen
116 from the deployment command, the script should be ready to run:
117
118     [Controller]: CREATE_IN_PROGRESS state changed
119     [NovaCompute]: CREATE_IN_PROGRESS state changed
120
121 The user running the script must be able to ssh as root to each server.  Define
122 the names of your custom roles (if applicable) and hostnames of the deployed
123 servers you intend to use for each role type. For each role name, a
124 corresponding <role-name>_hosts variable should also be defined, e.g.::
125
126     export ROLES="Controller NewtorkNode StorageNode Compute"
127     export Controller_hosts="10.0.0.1 10.0.0.2 10.0.0.3"
128     export NetworkNode_hosts="10.0.0.4 10.0.0.5 10.0.0.6"
129     export StorageNode_hosts="10.0.0.7 10.0.08"
130     export Compute_hosts="10.0.0.9 10.0.0.10 10.0.0.11"
131
132 Then run the script on the undercloud with a stackrc file sourced, and
133 the script will copy the needed os-collect-config.conf configuration to each
134 server and restart the os-collect-config service.