4. Glossary
Counter
Condition
AutoScale Policy
AutoScale VM Profile
AutoScale VM Group
Timing parameters:
Duration
Interval
Source:
https://cwiki.apache.org/confluence/display/CLOUDSTACK/Autosc
aling
Quiet time
Destroy vm grace
period
5. NetScaler entity contains
3 components:
•
•
•
A Load Balancing virtual server
A Service Group
Monitors
Steps:
1.
2.
3.
4.
5.
6.
Source: http://support.citrix.com/proddocs/topic/ns-system-10-1map/ns-autoscale-how-autoscale-works-con.html
CS uses NetScaler API to push
AutoScale configuration
NetScaler calls CS API requests
to deploy min number of VMs
CS provisions min number of
VMs on hypervisor
NetScaler discovers the newly
created VM's IP addresses,
binds them into service group
and loadbalances traffic to VMs
NetScaler monitors service
group by collecting SNMP
metrics from the VMs
NetScaler triggers scale-up or
scale-down events based-on
pre-defined policies at step 1.
7. What is it ?
a native solution
reproduce NetScaler
AutoScale engine operation
8. Reproduce
Load Balancing Virtual Server
Virtual Router’s HAProxy
NetScaler / SNMP Monitor
XenServer API RRDs
Service Group
Apache CloudStack code
Configuration Parameters
9. Xapi RRDs
•
Round Robin Databases
–
•
•
•
•
Store performance metrics on a per host and a per VM basis
Can be queried over HTTP or the RRD2CSV tool
XenCenter uses this data to produce system performance graphs
Data granularity
–
–
–
–
•
Consist of Round Robin Archieves (RRAs) in a fixed size database
Every 5s for the duration of 10min
Every min for the pass 2h
Every hour for the pass week
Every day for the pass year
Consolidation Functions
–
–
–
AVERAGE
MIN
MAX
Source:
http://wiki.xen.org/wiki/XAPI_RRDs
http://support.citrix.com/servlet/KbServlet/download/34969-102704897/reference.pdf
http://www.xenserver.org/partners/developing-products-for-xenserver/18-sdkdevelopment/96-xs-dev-rrds.html
10. Steps:
1.
2.
3.
4.
5.
6.
Users submit AutoScale
configuration using CloudStack
API
CS provisions min number of
VMs on hypervisor
CS provisions min number of
VMs on hypervisor
CloudStack binds the new VM
into service group and
loadbalances traffic to VMs
using HAProxy on VirtualRouter
CloudStack monitors service
group by collecting metrics from
the VMs via Xapi RRDs
CloudStack triggers scale-up or
scale-down events based-on
pre-defined policies at step 1.
11. Getting RRDs over HTTP
• Downloading the whole RRD
– Downloading a Host RRD
wget http://<server>/host_rrd?session_id=OpaqueRef:<SESSION HANDLE>
– Downloading a VM RRD
wget http://<server>/vm_rrd?session_id=OpaqueRef:<SESSION HANDLE>&uuid=<VM
UUID>
12. Getting RRDs over HTTP
• Getting update from the RRD
– Downloading RRD update for a Host
wget http://<server>/rrd_updates?session_id=OpaqueRef:<SESSION
HANDLE>&start=10258122541&host=true
– Downloading RRD update for all VMs
wget http://<server>/rrd_updates?session_id=OpaqueRef:<SESSION
HANDLE>&start=10258122541
– Downloading RRD update specifying CF
wget http://<server>/rrd_updates?session_id=OpaqueRef:<SESSION
HANDLE>&start=10258122541&cf=AVERAGE
Step 6: As part of the scale-up trigger, the NetScalerAutoScale engine sends an API request to CloudPlatform to deploy a new VM. After the virtual machine is deployed, the AutoScale engine binds the service representing the VM (IP address and port) to the service group and, after the configured quiet time, starts forwarding load balanced traffic to the new virtual machine. Likewise, as part of the scale-down trigger, the NetScalerAutoScale engine selects a VM, stops forwarding new requests to that instance, and waits for the configured quiet time (to allow for the processing of current requests to complete) before it sends an API request to CloudPlatform to destroy the chosen instance.
rrd_updates will only give you what it considers to be the most appropriate archive for your request. As stated above, there are 4 archives available: one with 5 second updates for a maximum of 10 minutes, 1 minute for 2 hours, 1 hour for 1 week and 1 day for 1 year. When you do the GET, you specify on the URL the 'start' parameter, and it uses this to see which archive to give you. So if you specify a since value that is 9 minutes before 'now', you'll get 108 rows from the 10 minute archive, but if you specify 11 minutes before 'now', you'll get 11 rows from the 2 hour archive. In particular, it's important that you use the same definition of 'now' that the server is using, since the server is likely to be in GMT and your client may be in a different time zone. Each call to rrd_updates will return a value (in the 'end' XML tag) that can be used as the 'start' parameter for the next call.