VMware Cloud Community
bogdanigm
Enthusiast
Enthusiast

vrops 6.2 - Use API to configure datanode

test
Reply
0 Kudos
3 Replies
bogdanigm
Enthusiast
Enthusiast

I have deployed 3 vROPS 6.2 OVA.

For the master I have configured running

curl -s -v -w %{http_code} -i -k -H Content-Type:application/json -d@/tmp/vrops-config-2449/role-body -u admin:VMware123* -b /tmp/vrops-config-2449/cookie -X POST https://10.1.1.64/casa/deployment/slice/role

With this autogenerated role-body json file,

[
  {
     "slice_address": "10.1.1.64",
    "admin_slice": "10.1.1.64",
    "user_id": "admin",
    "password":"VMware123*",
    "slice_roles": ["ADMIN","DATA","UI"]

  }

]

And it worked fine.

 

My problems appeared when I tried to configure the datanode and the remote collector. I used the same

curl -s -v -w %{http_code} -i -k -H Content-Type:application/json -d@/tmp/vrops-config-2449/role-body -u admin:VMware123* -b /tmp/vrops-config-2449/cookie -X POST https://10.1.1.64/casa/deployment/slice/role

With this role-body json file, for Remote collector ,

[
  {
     "slice_address": "10.1.1.226",
    "admin_slice": "10.1.1.64",
    "user_id": "admin",
    "password":"VMware123*",
    "slice_roles": ["REMOTE_COLLECTOR"]

  }

]

and  this role-body json file-for datanode,

[
  {
     "slice_address": "10.1.1.64",
    "admin_slice": "10.1.1.64",
    "user_id": "admin",
    "password":"VMware123*",
    "slice_roles": ["DATA","UI"]

  }

]

this is the output:


Configuring vROps DataNode Role ...
curl -s -v -w %{http_code} -i -k -H Content-Type:application/json -d@/tmp/vrops-config-2449/role-body -u admin:VMware123* -b /tmp/vrops-config-2449/cookie -X POST https://10.1.1.64/casa/deployment/slice/role
* About to connect() to 10.1.1.64 port 443 (#0)
*   Trying 10.1.1.64... connected
* Connected to 10.1.1.64 (10.1.1.64) port 443 (#0)
* Initializing NSS with certpath: /etc/pki/nssdb
* warning: ignoring value of ssl.verifyhost
* skipping SSL peer certificate verification
* SSL connection using TLS_RSA_WITH_AES_256_CBC_SHA
* Server certificate:………
* Server auth using Basic with user 'admin'
> POST /casa/deployment/slice/role HTTP/1.1
> Authorization: Basic YWRtaW46Vk13YXJlMTIzKg==
> User-Agent: curl/7.19.7 (x86_64-unknown-linux-gnu) libcurl/7.19.7 NSS/3.12.7.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2
> Host: 10.1.1.64
> Accept: */*
> Content-Type:application/json
> Content-Length: 181
>
< HTTP/1.1 500 Internal Server Error
< Connection: close
< Content-Type: application/json;charset=ISO-8859-1
{"error_message_key":"general.failure","error_arguments":["com.vmware.vcops.casa.exception.CasaException: Error validating credentials"]}500

 

NOTE: The credentials for the vROPs Cluster/Master were correct introduced in cURL and json.

After seeing the error message ,I have decided to modify the json file, for testing purpose and the error message was something I expecting.  

Next I decided to modify the json file and run again the same link:

With this autogenerated role-body json file:


[
  {
    "slice_address": "10.1.1.226",
    "admin_slice": "10.1.1.64",
    "slice_roles": ["REMOTE_COLLECTOR"]
  }
]

Configuring vROps DataNode Role ...
curl -s -v -w %{http_code} -i -k -H Content-Type:application/json -d@/tmp/vrops-config-2521/role-body -u admin:VMware123* -b /tmp/vrops-config-2521/cookie -X POST https://10.1.1.64/casa/deployment/slice/role
 

< HTTP/1.1 500 Internal Server Error>
{"error_message_key":"general.failure","error_arguments":["java.lang.IllegalArgumentException: Either username/password, or shared passphrase must be provided."]}500



My two cents on my tests with vROPS 6.2:

1- First of all, if I add a datanode using the Webinterface Wizzard, I can expand successfully the Cluster with the datanode.

Here comes the weird thing: if I want to change the role configuration (from datanode to remote collector), for testing only, of the datanode mentioned  above, using the same CURL: curl -s -v -w %{http_code} -i -k -H Content-Type:application/json -d@/tmp/vrops-config-2521/role-body -u admin:VMware123* -b /tmp/vrops-config-2521/cookie -X POST https://10.1.1.64/casa/deployment/slice/role , I can successfully do it.

NO "Error validating credentials" is returned.  It just  switches the datanote into a remote collector and vice-versa. The confirmation of this role change is in the webinterface/admin as well as when I run service vmware-vcops status. 

2-After debugging and testing I have a couple of questions:

    A- VMware might have changed the json structure, the json (role_body) expected by the master? Eg: "user_id" could might have been changed to
"userName" or anything else?

    B- although I am using curl -k for skipping SSL peer certificate verification, is  master actually trusts the new Slice(datanode or remote collector)?

 

Can some one explain this behaviour?

Thanks.

Reply
0 Kudos
WillisWu
Contributor
Contributor

After add master_thumbprint, it works for me. You can try that.

[
  {
     "slice_address": "10.1.1.226",
    "admin_slice": "10.1.1.64",
    "user_id": "admin",
    "password":"VMware123*",

     "master_thumbprint":"71:02:59:E1:34:44:98:7D:40:28:49:02:4A:45:6B:4C:DF:CA:15:60",
    "slice_roles": ["REMOTE_COLLECTOR"]

  }

]

Reply
0 Kudos
GeeWBee
Contributor
Contributor

Hi,

I am trying to use this to configure the master node of my cluster after the initial deployment of the ova but the api call answers that the request requires authentication. At this stage of the deployment the admin password is not set yet. Should I do the first part of the configuration using the Gui or am I doing something wrong?

Reply
0 Kudos