netscalerautomaon - virtues.it · puppet expert! blog: about)hendricus your ... introduction >...

38
NetScaler Automa.on USING PUPPET TO TALK NITRO

Upload: trinhkien

Post on 28-Jul-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

NetScaler  Automa.on USING  PUPPET  TO  TALK  NITRO

Page 2: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   2  

§  15+ years of Technical Consulting

§  Senior Consultant at PepperByte §  MSc Computer Science §  Design | Implement | Troubleshooting §  Small <-> Large infrastructures §  Government | Industry | Commerce

§  Citrix Technology Professional (Class of 2015)

§  Author of: §  Citrix XenApp 6.5 Expert Cookbook

Your  Presenter:      Esther  Barthel          Senior  Technical  Consultant    

                   @virtues_IT                                                  hBp://nl.linkedin.com/in/ebarthel                      hBp://www.virtues.it  

 

                               

 

About  Esther

Page 3: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   3  

§  10+ years of Technical Consulting §  Consultant at PepperByte §  Design | Implement | Troubleshooting §  Small <-> Large infrastructures §  Government | Industry | Commerce

§  Puppet expert §  Blog: http://www.puppetblog.nl/

About  Hendricus

Your  Presenter:      Hendricus  Kramer          Technical  Consultant    

                   @HendricusK                                                hBp://  www.linkedin.com/in/hendricus                          hBp://www.hendric.us  

 

                               

 

Page 4: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Agenda    

q   Introduc*on  q   RESTful  APIs  &  NITRO  q   Puppet  NetScaler  Module  

q   Automa*ng  NetScaler  Configura*ons  q   NetScaler  System  se@ngs  q   NetScaler  Load  Balancing  

q   Demo  

q   Bonus  q   Deploy  NetScaler  VPX  with  fixed  IP-­‐address  q   Upload  files  to  the  NetScaler  

Page 5: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   5  

RESTful  APIs   REpresentaNonal  State  Transfer  (REST):  ◦  Client-­‐Server  ◦  Stateless  ◦  PlaNorm  &  language-­‐independent  ◦  Standards-­‐based  (runs  on  top  of  HTTP)  ◦  Can  easily  be  used  in  presence  of  firewalls    

  NITRO  (RESTful  service  on  NetScaler):  ◦  Communicate  with  NetScaler  programma*cally  ◦  Human  readable  HTTP-­‐based  interac*on  ◦  NITRO  SDKs  available  for  mul*ple  languages    (Java,  Python,  .NET,  REST)  

 

Introduction > Automation > Bonus

Page 6: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   6  

RESTful  APIs   A  way  to  interact  with  an  API  via  series  on  HTTP  calls  

◦  VERB:  HTTP  Method  (GET,  PUT,  POST,  DELETE,  OPTIONS)  ◦  URI:  the  URI  of  the  resource  on  which  the  opera*on  is  performed  ◦  HTTP  Version:  usually  "HTTP  v1.1"  ◦  Request  Header:  contains  metadata  (forma@ng,  etc.)  ◦  Request  Body:  actual  message  content  

Introduction > Automation > Bonus

Page 7: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   7  

NITRO   A  way  to  interact  with  an  API  via  series  on  HTTP  calls  

◦  HTTP  Method  (GET,  PUT,  POST,  DELETE,  OPTIONS)    

◦  There  are  two  basic  URL  stems  to  use  with  Nitro:    ◦  h[p://<NSIP>/nitro/v1/stat/        –>  en*ty  and  system  sta*s*cs    ◦  h[p://<NSIP>/nitro/v1/config/        –>  configura*on  opera*ons    

◦  Add  the  resource  type  (and  in  some  cases  also  the  resource  name)  to  the  URL:  ◦  h[p://<NSIP>/nitro/v1/config/nsfeature/feature  

◦  Specify  an  acNon  (bind,  add,  enable,  ...)  for  the  URL:  ◦  h[p://<NSIP>/nitro/v1/config/nsfeature?acNon=enable  

Introduction > Automation > Bonus

Page 8: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   8  

NITRO   A  way  to  interact  with  an  API  via  series  on  HTTP  calls  

◦  Specify  the  Content-­‐Type  in  the  Request  Header:  ◦  Content-­‐Type:applica*on/vnd.com.citrix.netscaler.nsfeature+json  

◦  Add  the  JSON  payload  to  the  Request  Body:  

Introduction > Automation > Bonus

Page 9: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   9  

NITRO   A  way  to  interact  with  an  API  via  series  on  HTTP  calls  

Introduction > Automation > Bonus

Page 10: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   10  

NITRO Why  use  NITRO?    ◦  Simple  HTTP  calls  for  data  exchange  between  systems  ◦  Programs  or  scripts  can  include  NetScaler  sta*s*cs  

◦  If  server  load  =  max,  then  automa*cally  enable  more  services  on  the  NetScaler  ◦  Build  your  own  automated  NetScaler  deployments  

◦  Essen*al  for  datacenter  automa*on/SDN  

NITRO  Enhancements  in  10.5  ◦  Python  SDK  ◦  File  Opera*ons  (automa*cally  upload  license  and  cer*ficate  files)  ◦  New  APIs  (techsupport,  batch,  nstrace)  ◦  SSH  Commands  (ping,  traceroute)  

Introduction > Automation > Bonus

Page 11: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   11  

NITRO  requirements   NetScaler  9.2  or  later  ◦  Authen*cate  with  an  account  with  execute  permissions  ◦  Access  to  the  NetScaler  NSIP  (or  SNIP)  with  Management  Access  enabled  

  REST  Client  or  programming  language  ◦  Use  a  client  like  cURL  &  POSTMAN,  or  ◦  Download  and  install  the  NITRO  SDK  for  your  programming  language      

Introduction > Automation > Bonus

Page 12: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   12  

NITRO  Documenta.on

Introduction > Automation > Bonus

Page 13: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   13  

Citrix  Blog

Introduction > Automation > Bonus

source:  h[ps://www.citrix.com/blogs/2014/10/08/scrip*ng-­‐automa*ng-­‐netscaler-­‐configura*ons-­‐using-­‐nitro-­‐rest-­‐api-­‐and-­‐powershell-­‐part-­‐5/  

Page 14: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   14  

NITRO  &  PowerShell

Introduction > Automation > Bonus

Page 15: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   15  

Puppet  NetScaler  Module

source:  h[ps://forge.puppetlabs.com/puppetlabs/netscaler        

Introduction > Automation > Bonus

   

Page 16: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   16  

Puppet  NetScaler  Module

Introduction > Automation > Bonus

   

Page 17: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   17  

Puppet  NetScaler  Module

Introduction > Automation > Bonus

Page 18: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   18  

Puppet  NetScaler  Module

Introduction > Automation > Bonus

Page 19: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   19  

NetScaler  Automa.on  w/  puppet   What  can  we  automate  with  the  NetScaler  Puppet  Module?    

Introduction > Automation > Bonus

Global  NetScaler  Features   Load  Balancing  

File  (.cert,  .key,  .txt)   Content  Switching  

User  &  Groups   SSL  

Hostname   Server  &  Service  defini*ons  

NetScaler  IP  Addresses   Monitors  

NTP  Server  Configura*on   Responder  

Routes   Rewrite  

SNMP  Configura*ons   VLANs  

Page 20: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   20  

NetScaler  Automa.on  Sample NetScaler  Features  

Introduction > Automation > Bonus

Page 21: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   21  

NetScaler  Automa.on  w/  CLI NetScaler  Features  

  NetScaler  CLI:    

Introduction > Automation > Bonus

Page 22: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   22  

NetScaler  Automa.on  w/  NITRO NetScaler  Features  

  NITRO  (REST):    

Introduction > Automation > Bonus

Page 23: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   23  

NetScaler  Automa.on  w/  Puppet NetScaler  Features  

  Puppet:    

Introduction > Automation > Bonus

Page 24: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   24  

NetScaler  Automa.on  w/  PowerShell NetScaler  Features  

  PowerShell:    

Introduction > Automation > Bonus

   

Page 25: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   25  

NetScaler  Automa.on  w/  PowerShell  &  REST

Introduction > Automation > Bonus

Page 26: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   26  

NetScaler  Automa.on  w/  Puppet Basic  System  Segngs  

Introduction > Automation > Bonus

Page 27: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   27  

NetScaler  Automa.on  w/  Puppet Basic  System  Segngs  

Introduction > Automation > Bonus

Page 28: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   28  

NetScaler  Automa.on  w/  Puppet NetScaler  Load  Balancing  

 

 

 

Introduction > Automation > Bonus

Page 29: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   29  

NetScaler  Automa.on  w/  Puppet NetScaler  Load  Balancing  

 

Introduction > Automation > Bonus

Page 30: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   30  

NetScaler  Automa.on  w/  Puppet NetScaler  Load  Balancing  

 

Introduction > Automation > Bonus

Page 31: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   31  

Puppet  in  Ac.on

Introduction > Automation > Bonus

Page 32: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   32  

Puppet  in  Ac.on

Introduction > Automation > Bonus

Page 33: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   33  

Bonus:  NetScaler  VPX  with  fixed  IP CTX128236:  How  To  Auto-­‐Provision  NetScaler  VPX  on  XenServer  

 

 

Introduction > Automation > Bonus

Read  all  the  details  in  the  blogpost  at:    h[p://www.virtues.it/2015/11/ps-­‐import-­‐ns-­‐vpx-­‐fixed-­‐ip-­‐on-­‐xs    

Page 34: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   34  

Script  in  Ac.on

Introduction > Automation > Bonus

Page 35: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   35  

Bonus:  Upload  files  to  the  NetScaler NITRO  can  perform  file  uploads  up  to  2  MB  

Introduction > Automation > Bonus

Page 36: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   36  

Bonus:  Upload  files  to  the  NetScaler   PowerShell  File  Upload  w/  WinSCP  Wrapper    

source:  h[p://dotps1.github.io/WinSCP/      

Introduction > Automation > Bonus

Read  all  the  details  in  the  blogpost  at:    h[p://www.virtues.it/2015/11/ps-­‐upload-­‐file-­‐with-­‐winscp-­‐wrapper    

Page 37: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

       Hendricus  Kramer        Technical  Consultant    

             @Hendricusk                                hBp://www.linkedin.com/en/hendricus    hBp://www.hendric.us  

 

                               

 

Presented  by:        Esther  Barthel            Senior  Technical  Consultant    

             @virtues_IT                                hBp://nl.linkedin.com/in/ebarthel                      hBp://www.virtues.it  

 

       

Page 38: NetScalerAutomaon - virtues.it · Puppet expert! Blog:  About)Hendricus Your ... Introduction > Automation > Bonus. Lisbon2015’ ’#E2EVC’ 11

Lisbon  2015    #E2EVC   38  

Resources   Citrix  blogs:  ◦  h[ps://www.citrix.com/blogs/2014/09/19/scrip*ng-­‐automa*ng-­‐netscaler-­‐configura*ons-­‐using-­‐nitro-­‐rest-­‐api-­‐and-­‐powershell-­‐part-­‐1/  

◦  h[ps://www.citrix.com/blogs/2014/02/04/using-­‐curl-­‐with-­‐the-­‐netscaler-­‐nitro-­‐rest-­‐api/  ◦  h[p://support.citrix.com/ar*cle/CTX128236    

  NetScaler  Masterclasses:  ◦  h[ps://www.citrix.com/events/netscaler-­‐master-­‐class.html  

  WinSCP  Wrapper:  ◦  h[p://dotps1.github.io/WinSCP/    

  Puppet  NetScaler  Module:  ◦  h[ps://forge.puppetlabs.com/puppetlabs/netscaler/readme