blob: 7ba5c849071ef41c56d366e64a002ea2a247b108 [file] [log] [blame]
dfilppi9981f552017-08-07 20:10:53 +00001
2.. highlight:: yaml
3
4Tips
5====
6
7* It is highly recommended to **ensure that Openstack names are unique** (for a given type): While Openstack allows for same name objects, having identical names for objects of the same type might lead to ambiguities and errors.
8
9* To set up DNS servers for Openstack servers (whether it's the Cloudify Manager or application VMs), one may use the Openstack ``dns_nameservers`` parameter for the [Subnet type](#cloudifyopenstacknodessubnet) - that is, pass the parameter directly to Neutron by using the ``args`` input of the operations in Subnet node, e.g.::
10
11 my_subnet_node:
12 interfaces:
13 cloudify.interfaces.lifecycle:
14 create:
15 inputs:
16 args:
17 dns_nameservers: [1.2.3.4]
18 cloudify.interfaces.validation:
19 creation:
20 inputs:
21 args:
22 dns_nameservers: [1.2.3.4]
23
24 This will set up ``1.2.3.4`` as the DNS server for all servers on this subnet.
25
26* Public keys, unlike the rest of the Openstack resources, are user-based rather than tenant-based. When errors indicate a missing keypair, make sure you're using the correct user rather than tenant.
27
28* ICMP rules show up on Horizon (Openstack GUI) as ones defined using ``type`` and ``code`` fields, rather than a port range. However, in the actual Neutron (and Nova, in case of Nova-net security groups) service, these fields are represented using the standard port range fields (i.e., ``type`` and ``code`` correspond to ``port_range_min`` and ``port_range_max`` (respectively) on Neutron security groups, and to ``from_port`` and ``to_port`` (respectively) on Nova-net security groups).
29
30 ** For example, to set a security group rule which allows **ping** from anywhere, the following setting may be declared in the blueprint:
31 * ``protocol``: ``icmp``
32 * ``port_range_min``: ``0`` (type)
33 * ``port_range_max``: ``0`` (code)
34 * ``remote_ip_prefix``: ``0.0.0.0/0``
35
36* To use Openstack Neutron's ML2 extensions, use the ``args`` input for the Network's ``create`` operation. For example, the `provider network <http://developer.openstack.org/api-ref-networking-v2-ext.html#createProviderNetwork>`_ may be set in the following way::
37
38 my_network:
39 type: cloudify.openstack.nodes.Network
40 ...
41 interfaces:
42 cloudify.interfaces.lifecycle:
43 create:
44 inputs:
45 args:
46 # Note that for this parameter to work, OpenStack must be configured to use Neutron's ML2 extensions
47 provider:network_type: vxlan
48
49* Ordering NICs in the Openstack plugin can be done in the 1.4 version of the Openstack plugin by simply stating the relationships to the various networks (or ports) in the desired order, e.g.::
50
51 node_templates:
52 server:
53 type: cloudify.openstack.nodes.Server
54 relationships:
55 - target: network1
56 type: cloudify.relationships.connected_to
57 - target: network2
58 type: cloudify.relationships.connected_to
59
60 network1:
61 type: cloudify.openstack.nodes.Network
62 properties:
63 resource_id: network1
64
65 network2:
66 type: cloudify.openstack.nodes.Network
67 properties:
68 resource_id: network2
69
70 In the example above, network1 will be connected to a NIC preceding the one network2 will - however these wont be eth0/eth1, but rather eth1/eth2 - because by default, the management network will be prepended to the networks list (i.e. it'll be assigned to eth0).
71 To avoid this prepending, one should explicitly declare a relationship to the management network, where the network's represented in the blueprint by an existing resource (using the "use_external_resource" property).
72 This will cause the management network adhere the NICs ordering as the rest of them.
73 Example::
74
75 node_templates:
76 server:
77 type: cloudify.openstack.nodes.Server
78 properties:
79 management_network_name: network2
80 relationships:
81 - target: network1
82 type: cloudify.relationships.connected_to
83 - target: network2
84 type: cloudify.relationships.connected_to
85 - target: network3
86 type: cloudify.relationships.connected_to
87
88 network1:
89 type: cloudify.openstack.nodes.Network
90 properties:
91 resource_id: network1
92
93 network2:
94 type: cloudify.openstack.nodes.Network
95 properties:
96 use_external_resource: true
97 resource_id: network2
98
99 network3:
100 type: cloudify.openstack.nodes.Network
101 properties:
102 use_external_resource: true
103 resource_id: network3
104
105 In this example, "network2" represents the management network, yet it'll be connected to eth1, while "network1" will take eth0, and "network3" (which also happened to already exist) will get connected to eth2.
106
107 The server's property "management_network_name: network2" is not mandatory for this to work - this was just to make the example clear - yet the management network can also be inferred from the provider context (which is what happens when this property isn't explicitly set). Were the provider context to have "network2" set as the management network, this example would've worked just the same with this property omitted.
108
109Misc
110====
111
112* The plugin's operations are each **transactional**
113 (and therefore also retryable on failures),
114 yet not **idempotent**.
115 Attempting to execute the same operation twice is likely to fail.
116
117* Over this documentation, it's been mentioned multiple times that some configuration-saving information may be available in the Provider Context.
118 The Openstack manager blueprint and Openstack provider both create this relevant information,
119 and therefore if either was used for bootstrapping, the Provider Context will be available for the Openstack plugin to use.
120
121The exact details of the structure of the Openstack Provider Context are not documented since this feature is going through deprecation and will be replaced with a more advanced one.