Python ,vCloud Director REST API Series for Beginners – Just get the list of Org

Hola Everybody, (I’m not Spanish or Catalan but under effect this days)

In my first article about vCloud REST and API , i just tried to describe how to get the token with very bad coding example in WordPress. Its good to find a way to share codes from WordPress, thanks for this article.

In this article I added getting org list from vCloud Director also made error handling and XML parse with ElementTree

I’m expecting in next article start to create something inside vCloud Director with REST API and python and extend the code

# coding=utf-8
def get_vcloud_token(vcd_hostname, password, api_version):
    import urllib2
    import base64

    vcloudsession_url = "https://" + vcd_hostname + "/api/sessions"
    encode_credentials = base64.b64encode(password)

    # Prepare headers we will post
    vcloudapi_version = "application/*+xml;version=" + api_version
    vcloudapi_auth = "Basic %s" % encode_credentials
    data = ""
    authheaders = {'Accept': vcloudapi_version, 'Authorization': vcloudapi_auth}
    request_format = urllib2.Request(vcloudsession_url, data, authheaders)
    make_request = urllib2.urlopen(request_format)
    # We will not need to read whole html out
    # result =
    # Just need to catch key provided by vCloud Director from header response
    token =['x-vcloud-authorization']
    # this function will turn result to get and use it where it called
    return token

def get_vcloud_org_list(exisiting_token):
    import urllib2
    import xml.etree.cElementTree as ET

    vcloudapi_url = "" + "org/"
    api_version = "5.5"
    vcloudapi_version = "application/*+xml;version=" + api_version

    # Now use the requested token before for query the org list
    afterauthheader_org = {'Accept': vcloudapi_version, 'x-vcloud-authorization': exisiting_token}

    # Be careful, there is no PUT request here, we will make a GET because of that second parameter
    # described with headers = afterauthheader_org and if you do not set headers then second parameters
    # will be accepted as a data
    make_org_list_call = urllib2.Request(vcloudapi_url, headers=afterauthheader_org)

    # Also lets improve our code with exception handling
        make_org_list_request = urllib2.urlopen(make_org_list_call)
        # Now we take the response as a file like object
        org_list_response =
        org_list_in_xml = ET.fromstring(org_list_response)
        # Here because of result is file like its a string we are importing it and ET will parse it
        org_list_in_xml = ET.fromstring(org_list_response)

        # Pls print response to understand how is the result
        # You will see that its an XML out and OrgList is will be the root tag or root element, it will have some child(s)
        # it will be Org and Org will have some attributes like Name , Href and type
        # we will take the name attributes of each child(s)

        # Create an empty array
        org_name_array = []

        for child in org_list_in_xml:
            # Add child.attrib['name'] inside the array

        return org_name_array

    except urllib2.URLError,e:
        print 'I guess wrong URL, SORRY ! '

# This is another function defined and name is main, you can see that inside main function we are calling get_vcloud_token function

def main():
    token_result = get_vcloud_token("you_vcloud_url", "Sit_Lord@System:password", "5.5")
    #This lines for tests , you can use it after remove the #
    #print token_result

    org_names = get_vcloud_org_list(token_result)

    #This lines for tests , you can use it after remove the #
    #print type(org_names)
    #for i in org_names:
    #    print i


Python , RESTClient and vCloud Director REST API Series for Beginners – Just login and take token

Today is 16 November 2014 and i m so new to python, RESTClient and vCloud Director API. This article is for beginners , hope help a lot for newbies

Update : in this article i have a bad view about coding , next article have better and if something wrong pls read it too .

First start from RESTClient

Before start we need to learn about little REST ,Methods and Headers . Please read when you are free this and thisquicktips and methods .

I do not have any programming background because of that explaining everything with my way. We have well known protocol which is HTTP/HTTPS and  using it for make some query and execute tasks . Softwares like vCloud Director provide us interface to do it. Methods , actually we are using each day it via web browsers , if you like to see web site actually your are doing HTTP GET and if you would like to fill out some forms you are making HTTP POST. Headers are very important here , actually we mostly know header information like “User-Agent” , “X-Forwarded-For” , list to headers

Okay, ready now . Please download RESTClient plagin for Firefox and execute it

Screen Shot 2014-11-11 at 08.00.08

Now to make something with REST API on vCloud Director , we need to login first and  after provide credentials vCloud Director will provide us a token to use it next calls .

First change the Method to POST and write down you vCloud Director url , example https://your_vclouddirector_url/api/sessions

Second, i told you headers are very important , you will see now , on top pls click Headers and then Custom Header

Screen Shot 2014-11-11 at 08.15.44

then Name part type Accept and Value part application/*+xml;version=5.5

Version part should need to be change for which version vCloud Director you are using , in my example i am using 5.5 , you can use 5.1 then type it like that
Here also i wonder what is accept and related value , accept is client site (means we are) requesting something and accept only xml base content-type, here little special thing for vCloud Director . Check headers explanations

Screen Shot 2014-11-11 at 08.17.11

Now need to add our credentials for authenticate and get token from vCloud Director

Again from the top, select Authentication and choose Basic (you could do that add like custom header what we did before)

Screen Shot 2014-11-11 at 08.26.34

Now its time to provide your credentials , here don’t forget user name should be like user@organization , here if you use System Administrator to do something you have to use admin_name@System , RESTClient will convert it base64 encoding automatically. Base64 is

Screen Shot 2014-11-11 at 08.34.54

and we are ready to go please click SEND and see the response

Screen Shot 2014-11-11 at 08.36.14

important part is x-vcloud-authorization response header , this is very important because for 30 mins it will be our key to query without credential . This article is cover only How to get Token , now do it with python , also not for you if you see any ” its quotas , i don’t know why its appearing like that :(

Token Request Python Code

# Welcome to Python
# Python is very easy to use, no need to use $ to set veriables and use , ; end of the line.

# urllib2 is module, actually its a another code, have some functions inside. Used for web browser like functionality inside code.
# We are importing such modules to use inside our own code(to call , run and get result)

import urllib2

# base64 is module, job is endoing and decoding , we need this when provide password to connect vCloud Director

import base64

# Using import cause need to use functions with module name, means to use urllib2, you need to call module like urllib2.request
# If you import module like ‘from urllib2 import xxx” means you can use xxx function only, no whole code will be loaded. Ex: request
# Setting vCloud Director API URL, use your own one ! https://your_vcloud_url/api/
# This link will be used for make next calls after we have a token
# You can set the stings inside “” or ”
# For numbers no need to set value between “” or ”, just type it a = 5
# u is indicating its a unicode , here its not important but you should need it when using different languages letters like Turkish

vcloudapi_url = u”https://your_vcloud_url/api/”

# Setting vCloud Director Session URL
# This link will be used for only get a token

vcloudsession_url = “https://your_vcloud_url/api/sessions”

# vCloud Pass,  use your own pass !

vcloud_pass = “Sit_lord@System:password”
# Now, remember RESTClient API and vCloud Director API needs. We have to set headers inside the request
# vCloud Director version, mine is 5.5 , if you have different one change it like 5.1

vcloudapi_version = “application/*+xml;version=5.5″

# You know RESTClient automaticly encoded authentication values to base64, now do it with python

convertto_base64 = base64.b64encode(vcloud_pass)

# Encoded value will be used for authenication, set the encoded value to vcloudapi_auth veriable

vcloudapi_auth = “Basic %s” % convertto_base64

# We have a empty veriable, which name is data. actually it used for make POST request

data = “”

# Creating headers for our web request
# Actually we are creating key and value pairs here

authheaders = { ‘Accept’ : vcloudapi_version , ‘Authorization’ : vcloudapi_auth}
# Now using urllib2 module Request function, combining url , method and headers to generate how we will request something from vCloud Director

request_format = urllib2.Request(vcloudsession_url, data, authheaders)

# Send request

make_request = urllib2.urlopen(request_format)

# Read web server answer

result =

# Take the token header from response of web server
# x-vcloud-authorization is header
# This token will be used for next requests , after that no need to send credenitals to vCloud Director for 30 mins , this is default
# info() — return the meta-information of the page, such as headers
# Additional getcode() and geturl() can be used, getcode() return the HTTP status code of the response
# geturl() return the URL of the resource retrieved, commonly used to determine if a redirect was followed

token =[‘x-vcloud-authorization’]

# write out token

print token

Then you should see something like that

Screen Shot 2014-11-16 at 16.11.41

 Now time to understand functions and turn the code with function

# for create a function you need to define it like below, start with def and then function name and give the parameters what you need to have, of course you should not need to get something you can leave it like this ()

# to use this function need to feed it with related parameters, otherwise it will be not work
# Sorry maybe it will not appear correct but the code block within every function starts with a colon (:) and is indented.

def get_vcloud_token (vcd_hostname,username,password,api_version):

import urllib2
import base64

vcloudsession_url = “https://” + vcd_hostname + “/api/sessions”
encode_credentials = base64.b64encode(password)

#Prepare headers we will post
vcloudapi_version = “application/*+xml;version=” + api_version
vcloudapi_auth = “Basic %s” % encode_credentials
data = “”
authheaders = { ‘Accept’ : vcloudapi_version , ‘Authorization’ : vcloudapi_auth}
request_format = urllib2.Request(vcloudsession_url, data, authheaders)
make_request = urllib2.urlopen(request_format)
result =
token =[‘x-vcloud-authorization’]
#this function will turn result to get and use it where it called
return token

# This is another function defined and name is main, you can see that inside main function we are calling get_vcloud_token function

def main():


print token_result

# To execute main function type the name() without or with parameters
# Now main function will be called and inside main another funtion will be called too !

Now, thats it , next articles will be more more easy …
Also i will try to find out another way to share the code to be more clear …



WAP, NVGRE and Hair pinning

Hello All ,

Today we faces connectivity issue between tenant networks behind same NVGRE GW.

Think that you have two tenants , Company A and Company B and two virtual networks and also NAT rule configured for remote access 3389 (RDP) to Company A VM can connect Company B VM but problem is two virtual networks are behind the same NVGRE GW.

Problem is single interface and To and From is behind a single interface , means source vm network coming from NVGRE outside interface and want to get in same interface to access other vm network .

This image could explain , BRIDGE is describing NVGRE , squares are vm networks and VM s behind


Pls check related settings on NVGRE GW node , active or passive , i guess its not important


PS C:\Users\Administrator.DORUKCOSN> Get-NetNatGlobal
InterRoutingDomainHairpinningMode : External


Then set it Local

PS C:\Users\Administrator.DORUKCOSN> Set-NetNatGlobal -InterRoutingDomainHairpinningMode Local
PS C:\Users\Administrator.DORUKCOSN>

Then go go go , try it now

External comes default , be care about it


About FC SAN – Collection

After made some modification in our SAN network i need to describe all

First  about the design(Architectural) point of view very clear explanation from brocade. Actually my design is between mesh and core-edge

About the limitations need to read each FOS version scalability guidelines , this is for version 7.x  (FOS is Fabric OS , Firmware or Operating System of brocade switch) its important because how many switch(domain id) supported per fabric, how many access gateway per fabric, how many node per fabric, number of zone

if you dont know what is Domin, Domain ID, E Port, N Port pls read IBM Redbooks (Chapter 2 and for Domain ID page 405 Principal Switch Selection)

About Brocade Access Gateway read this (1.1.1 Basic Concept, 1.1.2 Port Mapping, 1.2 NPIV_ID Virtualization, 1.3 Benefits, 1.3.4 Cost Reduction , 1.5 Limitations)

Most important question mark in my mind was multiple connection between Brocade Access Gateway to Fabric SWITCH for availability , read section 2.4.1 in same document , i tested and F port to N port mapping are switched and communication is continue without any issue at the fail-over time

About Brocade Access Gateway port mapping use same document or fallow related link

For ag commend reference

For change FC switch to Access Gateway execute commands bellow

First you have to disable switch (this is also needed if you update the licenses on switch too)

Jango-Fett:admin> switchdisable

Disable auth policy

Jango-Fett:admin> authutil –policy -sw off    Warning: Activating the authentication policy requires either DH-CHAP secrets or PKI certificates depending on the protocol selected. Otherwise, ISLs will be segmented during next E-port bring-up. ARE YOU SURE  (yes, y, no, n): [no] y
Auth Policy is set to OFF

Use such commend if you want to sure that you really disabled

Jango-Fett:admin> authutil –show
AUTH TYPE     HASH TYPE     GROUP TYPE ————————————–
fcap,dhchap     sha1,md5     0,1,2,3,4 Switch Authentication Policy: OFF Device Authentication Policy: OFF
Then switch to access gateway mode, switch configs will be deleted and rebooted

Jango-Fett:admin> ag –modeenable
WARNING: Access Gateway mode changes the standard behavior of the switch. Please check Access Gateway Administrator’s Guide before proceeding. Enabling agmode will remove all the configuration data on the switch including zoning configuration, FAWWN configuration and security database. Please backup your configuration using configupload. This operation will reboot the switch.
Do you want to continue? (yes, y, no, n): [no] y
Access Gateway mode was enabled successfully Switch is being rebooted…

Additionally need to know about licensing  because from community i can see many question about ISL , people says ISL need license but actually ISL Trunking need optional license


vCloud Director 5.5 ValidationException INVALID_VRP_CPU_MHZ too

Hello All 

After upgrade we faced problem create vDC or update vDC resources with allocation model. Actually my subject is INVALID_VRP_CPU_MHZ too because another article help me to solve the issue 50 percent,  explain the solution about it (Thanks to him)

*Generally what we faced vCloud Director always have a problem about upgrades, before we faced wrong type temporary table column issue and this time INVALID_VRP_CPU_MHZ, also index rebuilds are can be failed too, waiting 5.6 for see the this time we will faced upgrade issue or not :D

But problem is related two vDC which cause an issue (their cpu resource is setter Infinity 4294967295000 ) i can not change the value what i wetted with sql commands via vCloud Director GUI

After VMware investigation not just only table vrp also org_prov_vdc table related column should be fixed too ! 

Then everything start to work perfect again
Hope this help when people face with same situation 

SSL fingerprint mismatch

Actually i do not have something more then what you find from google but have some correction or if you have some misunderstanding maybe i can help

We have two vCloud Director cells , mostly configurations are single cell

We fallowed this article
if you have pfx pls start from step 2

in article alias numer shown like one but i saw that its like a GUID number, very long id

Also if you create a new key store, mostly no need to add root and intermediate certificates but if you want you can import too ! I have some links for keytool which can be helpful

Included root certificates in java
How to import root and intermediate certificates to keystore and

What is not described if you have multiple cells you have to apply “To update the vCloud Director cell service:” section for all , when you start to activate its saying DB updated bla bla and you fill like no need to touch other cells , but you have too …

Actually load balancer persistence  option do not solve any problem

Also this problem is not available in older versions

SSL Offload, many word on google actually no way to do SSL Offload because cell do not accept connection from port 80 BUT on load balancer you can configure port 443 and access backend via 443 too !

Need to know something about pfx , pkcs


How SCVMM balance between NVGRE GWs

Today, we focused how SCVMM balance virtual networks(VN) and services between NVGRE GWs or Network Services(NS) with my team mate Gokhan Acar.

We have two NS configured in SCVMM

Screen Shot 2014-06-19 at 13.30.05

First what we faced, second or last added gateway (sorry no time to add 3th one) become first responsible unit to manage and provide NAT, VPN services to related VNs. We deployed “internetgwservice1″ first and create some VN on it then deploy “internetgwservice2″ and SCVMM start to create a new requests on it.

Then we try to understand how SCVMM really try to balance between two NS. Old one already have seven VN then we start to create additional VNs. its start to deploy every VN on newly added gw. I expect that after eight it will start to load balance but not !

To shorten the time, try to change the limit 50 to lower value to make easy test, but discover that its not possible to do :(

Screen Shot 2014-06-19 at 13.41.50

You should be faced with such error below

Error (21426)

Execution of Microsoft.SystemCenter.NetworkService::RegisterGatewayVMNetwork on the configuration provider 4ee559f1-f479-480c-9458-d14b8b1c1779 failed. Detailed exception: Microsoft.VirtualManager.Utils.CarmineException: Unable to add routing domain information to the Remote Access server. (A Hardware Management error has occurred trying to contact server :n:CannotProcessFilter :HRESULT 0x8033801a:No instance found with given property values. .
WinRM: URL: [], Verb: [ENUMERATE], Resource: [*], Filter: [associators of {Msvm_EthernetPortAllocationSettingData.InstanceID=”Microsoft:A449D45C-53B9-4B0A-9E98-C0E3BFB9ECBD\\BB614953-7878-4C15-A915-A587B429D7B1\\C”}where AssocClass=Msvm_EthernetPortSettingDataComponent ResultClass=Msvm_EthernetSwitchPortRoutingDomainSettingData]
Check that WinRM is installed and running on server For more information use the command “winrm helpmsg hresult” and .)
Fix the issue in Remote Access server and retry the operation.
Recommended Action
Check the documentation for the configuration provider or contact the publisher support.
Then we back and try to create more VN with NAT services enabled
Until reach 50th VN everything created on last added NVGRE GW but when we try to create 51th VN we faced same error like above. We are very sure that some cache things happen because the next GW is not run on related host
I guess need to wait little but we try to restart SCVMM services :D and push to create 51th VN again , its worked ! :)
Continue creating 52,53,54 and its working
Looks like SCVMM do not make round robin based balance, first over the related NVGRE GW then switch to next ….


No-Look VPN Configuration with Azure Pack :D

Hello All

After very long search on Google find only the Azure VPN configuration but there is no example and good explanation about how you can do it with Azure Pack.
DorukNET is COSN provider and we are preparing to offer Azure Pack in Turkey and want to clarify VPN configuration with our Fortigate expert Salih :P

Before start let me explain ISP point of view VPN properties ;

  • First you ask peer ip address
  • Second you ask phase 1 config properties like IKE version , encryption , key life time and key
  • Third you ask phase 2 config properties , encryption , key life time , network remote and local one which you will encrypt
  • Also talk about other things dead peer detection  (DPD)
  • Policy service consideration also important , mostly we do not allow any to any communication

When you login as a customer to WAP Service Management Portal, you couldn’t see every properties you need to establish VPN , mostly things are preconfigured and customer point of view there is no way to see it. Also its little hard to discover by administrator point of view but at the end we succeeded .

This article is about establish VPN between Fortinet and Microsoft NVGRE GW

Fortigate FW Version : 5.0.patch5
DorukNET WAP Customer Site Network
Provider-SiteAzure :
NVGRE GW Peer IP Address : xxx.yyy.zzz.50
Customer OnPremise Site Network
LocalSite-OnPremise: xxx.102.yyy.240/28
Customer Peer IP Address :Note that WAP site NVGRE GW Peer ip is not available before you create a new site-to-site setup

Lets create it
Login to WAP Service Management Portal and go to Networks and double click your already created network and click Create VPN

Screen Shot 2014-06-09 at 15.20.10
Set your remote site VPN Device ip address, here we set our Fortigate FW outsite ip address and pre-shared key
Screen Shot 2014-06-09 at 15.23.49a
As a address space you have to set remote site ip address block which you would like to communicate encrypted
Important note, WAP GUI do not allow enter single ip address as a remote
Screen Shot 2014-06-09 at 15.41.14
Next two screen WAP allow you to set limitation about VPN configuration if you needed please enter , we did not test its working or not :)Then action time , WAP send the request to VMM to create VPN configuration on NVGRE GW

Screen Shot 2014-06-09 at 15.26.39 


Screen Shot 2014-06-09 at 15.27.38
Check VMM site if you are provider to confirm

Screen Shot 2014-06-09 at 15.27.49
Now you will start to understand why we described article subject as a No-Look !
Now customer can not see anything more than VPN configuration is Enabled  !  No any knowledge about Phase 1 , Phase 2 configuration . Here what provider need to do, well document everything and somehow if provider have some boundaries need to automate the configuration
For example after VPN configuration enabled we can see such properties for VPN

You can see that Microsoft configure each pre-shared key as an Run-As-Account

From WAP GUI there is no way to set certificate as a auth method , actually i do not need it , no need to push Microsoft here :D

Screen Shot 2014-06-09 at 15.29.22
Routes section is easy, its remote network
Click the Advanced section , you will see the configuration of VPN but you have to understand which one is Phase1 and Phase 2 , very good , lovely
Screen Shot 2014-06-09 at 15.29.52
We find a pptx file after almost 50-100 search on Google , i know you thing maybe i m searching wrong key words , i m accepting :D
This slide actually do not equal defaults but it help us a lot but funny thing you can see that there is no timeout for key life values for Phase 2 also we discover the Phase 1 key life from this slide too also you can find it from powershell “Get-VpnS2SInterface” command

Screen Shot 2014-06-09 at 17.43.48

We used related configuration for us

Screen Shot 2014-06-09 at 15.30.34

Easy part , go to Forti , which traditionally we know everything how to configure :D

Screen Shot 2014-06-09 at 15.14.38
Phase 2
Screen Shot 2014-06-09 at 15.22.58
Rule for Forti
Screen Shot 2014-06-09 at 15.45.50
Monitor VPN Connectivity

Screen Shot 2014-06-09 at 15.33.10

Ping it or Remote it
Screen Shot 2014-06-09 at 15.59.57
Hope this article help for everyone

Parallels Automation use XML-RPC via PHP to get data from system

Parallels Automation is shortly OSS/BSS system which you can integrate , automate everything how you want via APS packages , you can find out more from this link.

I’m so new programming and want to start understand how to communicate/manage with 3th party system with REST API , XML-RPC.  Parallels have a XML-RPC to communicate with it externally alsso i expect to learn PHP with this integration.

Lets start ;

You can find out all Parallels Automation documentation from this link.

At the startup please read what is XML-RPC and how is looks like.

I do not have enough experience about PHP but to find out good explanations about PHP Tools please check the book ” Essential PHP Tools: Modules,Extensions and Acceleratiors”

tcpdump , yes, tcpdump its very very important because after long time i discover that sending wrong things and because of this i couldn’t query the Parallels Automation.  My environment is ; code uploaded to linux server which cpanel run on it , use pear and on the console executed command bellow to understand what XML-RPC request i am sending to RPC Server.

tcpdump -nl -s 0 -A -i eth1 -c 500 port 80
You can see that , your request will appear like below, its important because you will see many many XML-RPC request examples with PHP and every example do not work how you expected because of it i wasted almost a day until think to use debug somehow to see what i am sending (very clever yeah :))) )

Screen Shot 2014-05-30 at 14.39.51
Also i learn a lot about PHP , of course its nothing but its good start for me
First before start need to understand what kind of XML-RPC request i will send to Parallels Automation . Open the API pdf from link i already described above and choose one of method , i choose the method below
First need to read example to what kind of request need to send  what response you will get , use curl from cli with such xml file and memory the request and response.
This is the file ;

vahric:Apicall vahricmuhtaryan$ cat accountdetail.xml

<?xml version=”1.0″ encoding=”UTF-8″ ?>
































this is the curl command from cli

curl –connect-timeout 10 -d @accountdetail.xml -H ‘Content-type:text/xml’

and this is the result

<?xml version=”1.0″ encoding=”UTF-8″?>

<methodResponse><params><param><value><struct><member><name>Result</name><value><array><data><value><array><data><value><i4>1000019</i4></value><value><i4>1</i4></value><value><string>Son Mohican</string></value><value><string>Son Mohican address 1 </string></value><value><string></string></value><value><string>istanbul</string></value><value><string></string></value><value><string>34349</string></value><value><string>tr</string></value><value><string></string></value><value><string>Vahric</string></value><value><string></string></value><value><string>Muhtaryan</string></value><value><string></string></value><value><string>90</string></value><value><string>212</string></value><value><string>3269200</string></value><value><string></string></value><value><string></string></value><value><string></string></value><value><string></string></value><value><string></string></value><value><i4>1401023839</i4></value><value><i4>2</i4></value><value><i4>0</i4></value><value><i4>1</i4></value></data></array></value></data></array></value></member></struct></value></param></params></methodResponse>


Now we have to prepare same request via PHP to query and get same result  , i explained the command inside the code with //
// All usable XML-RPC functions are inside RPC.php , please include it in your code
require_once ‘XML/RPC.php’ ;
// its good to activate/increase the level of error reporting
ini_set(‘display_errors’, true);

//We have to describe RPC server access informations , in this example my RPC Server is and listening 5224, because of related server also work

//for different things generally its url is described RPC2, if you want to know what is RPC2.
$xmlrpc = new XML_RPC_Client( ‘/RPC2′, ‘’, 5224 );

//Need to construct XML-RPC request, you know some Name and Values we have to set

// <struct><member><name>Server</name><value>BM</value></member>
//struct is kind of value type , you can see the its have something inside <member> tags
//new XML_RPC_Value create values
//”Server” => new XML_RPC_Value(“BM”, “string”) is key and value pair and we are using => because of our value type is struct, means Server is key
// BM is value and its type string
// Important part is Params section  , you will see another array is created because get many value inside and all are under <data> tag but you can see that
//There is no <data> tag described like inside accountdetail.xml because its automatically added to request , read

params = array(new XML_RPC_Value(array(

“Server” => new XML_RPC_Value(“BM”, “string”),

“Method” => new XML_RPC_Value(“AccountDetailsGet_API”, “string”),

“Params” => new XML_RPC_Value(


new XML_RPC_Value(1000019, “int”)

), “array”)

),  ‘struct’ ) );

//We almost have same view of accountdetail.xml
//With XML_RPC_Message we %100 construct the accountdetail.xml  file means request , first value Execute is XML-RPC Method, you can see many example

//like XML_RPC_Message(‘system.load’);
$msg = new XML_RPC_Message(‘Execute’,$params);
//Now need to send request to XML-RPC server
$resp = $xmlrpc->send($msg);

//Get the response and out it inside veritable (here i used value as veritable )

$value = $resp->value();

//When you execute the php file you will get response as a object
//object(XML_RPC_Value)#34 (2) {
//                   [“me”]=>
//               array(1) {
//                 [“i4″]=>
//                 string(10) “1401023839”
//               }
//Need to convert object to array to use it
//XML_RPC_decode do it for you
$m = XML_RPC_decode($value);

//You can print it to see

//I told you I’m so new to programming , try to understand key(s) to access array
//you will see that some subarray will be in the result

I learned that array key is Result and all values are under the subarray which key is 0 and i tried to access second element which is the name of the account
echo $m[‘Result’][0][2];

Hope this help to who use PA and need to make XML-RPC query and new programers to discover how to make XML-RPC request(s) with PHP

Sometimes storage IOPS , latency and cpu usage can not say something about the reason of performance issue on MSSQL

We faced very interesting customer complaints about MSSQL server performance

Problem is related sp run very slow and the source should be the virtualization :(

At the startup its looks like very common complaints and how storage and system admins do check the storage side like global read and write latency on storage , related sql server LUN based latencies , cache configurations , frontend (host latency) and backend (disk subsystem latency )  also on server site via Resource Manager check the cpu , ram usages and also disk latencies too ! Nothing wrong …

As a system guy , usually focused on sp and check the whats going on , how to tune the sp bla bla . By SQL admin some tunings done and its effect the overall process but its was not enough. Asked so much guys about how to deeply understand the issue , mostly the answer is use profile manager or check the execution plan, find the cost and try to do it better

Then we discover the how to see the Process and Resource Waits , problem is mostly described is about not often but problem could be indexes but mostly disk bottleneck which is looks like impossible storage point of view because we do not try only on the SAN, DAS with different level of raid levels and number of the disk almost have same results also MSSQL run on physical server too !

Screen Shot 2014-05-08 at 01.28.20


Screen Shot 2014-05-08 at 01.30.06


The last thing is move everything %100 SSD Volumes , wait times are decrease incredible and SUSPENDED things are start to happen less then before

Now you can say to me that really the problem is disk , san  , raid , rpms or similar things but still i do not believe that the problem is non-SSD disks or arrays because there is no so much io , write latency any cache latency or SAN Network latency but single SSD solution somehow solve all things.

What i learned, its not enough to check MSSQL performance via only some very usual values like latency, cache and IOPS



Get every new post delivered to your Inbox.

Join 86 other followers