<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>15.9. Load Balancer Rules</title><link rel="stylesheet" type="text/css" href="Common_Content/css/default.css" /><link rel="stylesheet" media="print" href="Common_Content/css/print.css" type="text/css" /><meta name="generator" content="publican 2.8" /><meta name="package" content="Apache_CloudStack-Admin_Guide-4.1.0-it-IT-1-" /><script type="text/javascript" src="../../../../../toc.js"></script><script type="text/javascript">
              addID('Apache_CloudStack');
              
	      addID('Apache_CloudStack.4.1.0');
              
              addID('Apache_CloudStack.4.1.0.books');
	      addID('Apache_CloudStack.4.1.0.Admin_Guide');
              </script><link rel="home" href="index.html" title="Manuale di Amministrazione CloudStack" /><link rel="up" href="networks.html" title="Capitolo 15. Managing Networks and Traffic" /><link rel="prev" href="external-firewalls-and-load-balancers.html" title="15.8. External Firewalls and Load Balancers" /><link rel="next" href="guest-ip-ranges.html" title="15.10. Guest IP Ranges" /></head><body class="toc_embeded "><div id="tocdiv" class="toc"><iframe id="tocframe" class="toc" src="../../../../toc.html">This is an iframe, to view it upgrade your browser or enable iframe display.</iframe></div><p id="title"><a class="left" href="http://cloudstack.apache.org"><img src="Common_Content/images/image_left.png" alt="Product Site" /></a><a class="right" href="http://cloudstack.apache.org/docs"><img src="Common_Content/images/image_right.png" alt="Documentation Site" /></a></p><ul class="docnav"><li class="previous"><a accesskey="p" href="external-firewalls-and-load-balancers.html"><strong>Indietro</strong></a></li><li class="next"><a accesskey="n" href="guest-ip-ranges.html"><strong>Avanti</strong></a></li></ul><div xml:lang="it-IT" class="section" id="load-balancer-rules" lang="it-IT"><div class="titlepage"><div><div><h2 class="title" id="load-balancer-rules">15.9. Load Balancer Rules</h2></div></div></div><div class="para">
		A CloudStack user or administrator may create load balancing rules that balance traffic received at a public IP to one or more VMs. A user creates a rule, specifies an algorithm, and assigns the rule to a set of VMs.
	</div><div class="note"><div class="admonition_header"><h2>Nota</h2></div><div class="admonition"><div class="para">
			If you create load balancing rules while using a network service offering that includes an external load balancer device such as NetScaler, and later change the network service offering to one that uses the CloudStack virtual router, you must create a firewall rule on the virtual router for each of your existing load balancing rules so that they continue to function.
		</div></div></div><div class="para">
	</div><div xml:lang="it-IT" class="section" id="add-load-balancer-rule" lang="it-IT"><div class="titlepage"><div><div><h3 class="title" id="add-load-balancer-rule">15.9.1. Adding a Load Balancer Rule</h3></div></div></div><div class="orderedlist"><ol><li class="listitem"><div class="para">
				Log in to the CloudStack UI as an administrator or end user.
			</div></li><li class="listitem"><div class="para">
				In the left navigation, choose Network.
			</div></li><li class="listitem"><div class="para">
				Click the name of the network where you want to load balance the traffic.
			</div></li><li class="listitem"><div class="para">
				Click View IP Addresses.
			</div></li><li class="listitem"><div class="para">
				Click the IP address for which you want to create the rule, then click the Configuration tab.
			</div></li><li class="listitem"><div class="para">
				In the Load Balancing node of the diagram, click View All.
			</div><div class="para">
				In a Basic zone, you can also create a load balancing rule without acquiring or selecting an IP address. CloudStack internally assign an IP when you create the load balancing rule, which is listed in the IP Addresses page when the rule is created.
			</div><div class="para">
				To do that, select the name of the network, then click Add Load Balancer tab. Continue with <a class="xref" href="load-balancer-rules.html#config-lb">7</a>.
			</div></li><li class="listitem" id="config-lb"><div class="para">
				Fill in the following:
			</div><div class="itemizedlist"><ul><li class="listitem"><div class="para">
						<span class="bold bold"><strong>Name</strong></span>: A name for the load balancer rule.
					</div></li><li class="listitem"><div class="para">
						<span class="bold bold"><strong>Public Port</strong></span>: The port receiving incoming traffic to be balanced.
					</div></li><li class="listitem"><div class="para">
						<span class="bold bold"><strong>Private Port</strong></span>: The port that the VMs will use to receive the traffic.
					</div></li><li class="listitem"><div class="para">
						<span class="bold bold"><strong>Algorithm</strong></span>: Choose the load balancing algorithm you want CloudStack to use. CloudStack supports a variety of well-known algorithms. If you are not familiar with these choices, you will find plenty of information about them on the Internet.
					</div></li><li class="listitem"><div class="para">
						<span class="bold bold"><strong>Stickiness</strong></span>: (Optional) Click Configure and choose the algorithm for the stickiness policy. See Sticky Session Policies for Load Balancer Rules.
					</div></li><li class="listitem"><div class="para">
						<span class="bold bold"><strong>AutoScale</strong></span>: Click Configure and complete the AutoScale configuration as explained in <a class="xref" href="external-firewalls-and-load-balancers.html#autoscale">Sezione 15.8.5, «Configuring AutoScale»</a>.
					</div></li></ul></div></li><li class="listitem"><div class="para">
				Click Add VMs, then select two or more VMs that will divide the load of incoming traffic, and click Apply.
			</div><div class="para">
				The new load balancer rule appears in the list. You can repeat these steps to add more load balancer rules for this IP address.
			</div></li></ol></div></div><div xml:lang="it-IT" class="section" id="sticky-session-policies-for-lb-rules" lang="it-IT"><div class="titlepage"><div><div><h3 class="title" id="sticky-session-policies-for-lb-rules">15.9.2. Sticky Session Policies for Load Balancer Rules</h3></div></div></div><div class="para">
		Sticky sessions are used in Web-based applications to ensure continued availability of information across the multiple requests in a user's session. For example, if a shopper is filling a cart, you need to remember what has been purchased so far. The concept of "stickiness" is also referred to as persistence or maintaining state.
	</div><div class="para">
		Any load balancer rule defined in CloudStack can have a stickiness policy. The policy consists of a name, stickiness method, and parameters. The parameters are name-value pairs or flags, which are defined by the load balancer vendor. The stickiness method could be load balancer-generated cookie, application-generated cookie, or source-based. In the source-based method, the source IP address is used to identify the user and locate the user’s stored data. In the other methods, cookies are used. The cookie generated by the load balancer or application is included in request and response URLs to create persistence. The cookie name can be specified by the administrator or automatically generated. A variety of options are provided to control the exact behavior of cookies, such as how they are generated and whether they are cached.
	</div><div class="para">
		For the most up to date list of available stickiness methods, see the CloudStack UI or call listNetworks and check the SupportedStickinessMethods capability.
	</div></div></div><ul class="docnav"><li class="previous"><a accesskey="p" href="external-firewalls-and-load-balancers.html"><strong>Indietro</strong>15.8. External Firewalls and Load Balancers</a></li><li class="up"><a accesskey="u" href="#"><strong>Risali</strong></a></li><li class="home"><a accesskey="h" href="index.html"><strong>Partenza</strong></a></li><li class="next"><a accesskey="n" href="guest-ip-ranges.html"><strong>Avanti</strong>15.10. Guest IP Ranges</a></li></ul></body></html>
