Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..
433 views

Command (or) API to add a vCenter datasource in CO 3.x

Jump to solution

Hi Experts,

Is there any command line (or) API available in CO to perform the addition of vSphere data source ?

As per the Cloud Optimizer API documentation, i can see REST API's for other tasks like placements, view powered off VM's, etc but not for data source addition. Please let me know if there is an option.

Thanks,

Ram.

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Command (or) API to add a vCenter datasource in CO 3.x

Jump to solution

Hello Ram,

To answer your question.  Yes, there is a command-line command that can be used to add a data source/target to CO.

The command that you are looking for is the 'pvconfig' command.

# /opt/OV/bin/pvconfig -help
Usage:
         -addtarget|-at -type|-ty <Type> -target|-t <Target>
            -user|-u <UserName> [-password|-p <Password>]
            [-tr <Transport>] [-port <PortNumber>] [-opts|-o <Options>]
         -testtarget|-tt -type|-ty <Type> -target|-t <Target>
            -user|-u <UserName> [-password|-p <Password>]
            [-tr <Transport>] [-port <PortNumber>] [-opts|-o <Options>]
         -setinterval|-si <Value>
         -start|-st
         -start|-st -type|-ty <Type> -target|-t <Target>
         -stop|-sp
         -stop|-sp -type|-ty <Type> -target|-t <Target>
         -deltarget|-dt -type|-ty <Type> -target|-t <Target>
         -restart|-rt -type|-ty <Type> -target|-t <Target>
         -listtargets|-lt
         -listtargets|-lt -type|-ty <Type>
         -uploaddata|-ud <FilePath> <FileType>
         -storeencrypted|-se -namespace|-ns <namespace> -set <attr> <value>
         -encrypt|-en <value>
         -purgelog|-pl <purgeTill>
          Where
             purgeTill is in complete date plus hours, minutes,
                seconds and a decimal fraction of a second format
                YYYY-MM-DDThh:mm:ss (eg 1997-07-16T19:20:30.45)
                YYYY = four-digit year
                MM   = two-digit month (01=January, etc.)
                DD   = two-digit day of month (01 through 31)
                hh   = two-digit hour (00 through 23) (am/pm NOT allowed)
                mm   = two-digit minute (00 through 59)
                ss   = two-digit second (00 through 59)
                   http://www.w3.org/TR/NOTE-datetime

             Type - supported types are :
                    AWS (LOCAL) , COAdapterForOBR (LOCAL) , HYPERV (REMOTE) , KVM (LOCAL) , ONEVIEW (LOCAL) , OPENSTACK (LOCAL) , PHYSICAL (LOCAL) , VCENTER (LOCAL) , VMWAREFIVE (LOCAL) , XEN (LOCAL) , vPVOBRcollector (LOCAL) .
                    Also addtarget, restart commands are supported only for DataSources with LOCAL Collection Types.
             FileType - Supported FileType: Json

Here is an example to add a new vCenter server to CO 3.0x.

# /opt/OV/bin/pvconfig -at -ty VCENTER -t <vCenter FQDN> -u <user> -p <passwd>

Here is an example to delete a vCenter server from CO 3.0x.

# /opt/OV/bin/pvconfig -dt -ty VCENTER -t <vCenter FQDN>

I hope that this helps answer your question.

Regards,

Mark

---
Mark Butler
Micro Focus SW Support Engineer
https://softwaresupport.softwaregrp.com/

View solution in original post

2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Command (or) API to add a vCenter datasource in CO 3.x

Jump to solution

Hello Ram,

To answer your question.  Yes, there is a command-line command that can be used to add a data source/target to CO.

The command that you are looking for is the 'pvconfig' command.

# /opt/OV/bin/pvconfig -help
Usage:
         -addtarget|-at -type|-ty <Type> -target|-t <Target>
            -user|-u <UserName> [-password|-p <Password>]
            [-tr <Transport>] [-port <PortNumber>] [-opts|-o <Options>]
         -testtarget|-tt -type|-ty <Type> -target|-t <Target>
            -user|-u <UserName> [-password|-p <Password>]
            [-tr <Transport>] [-port <PortNumber>] [-opts|-o <Options>]
         -setinterval|-si <Value>
         -start|-st
         -start|-st -type|-ty <Type> -target|-t <Target>
         -stop|-sp
         -stop|-sp -type|-ty <Type> -target|-t <Target>
         -deltarget|-dt -type|-ty <Type> -target|-t <Target>
         -restart|-rt -type|-ty <Type> -target|-t <Target>
         -listtargets|-lt
         -listtargets|-lt -type|-ty <Type>
         -uploaddata|-ud <FilePath> <FileType>
         -storeencrypted|-se -namespace|-ns <namespace> -set <attr> <value>
         -encrypt|-en <value>
         -purgelog|-pl <purgeTill>
          Where
             purgeTill is in complete date plus hours, minutes,
                seconds and a decimal fraction of a second format
                YYYY-MM-DDThh:mm:ss (eg 1997-07-16T19:20:30.45)
                YYYY = four-digit year
                MM   = two-digit month (01=January, etc.)
                DD   = two-digit day of month (01 through 31)
                hh   = two-digit hour (00 through 23) (am/pm NOT allowed)
                mm   = two-digit minute (00 through 59)
                ss   = two-digit second (00 through 59)
                   http://www.w3.org/TR/NOTE-datetime

             Type - supported types are :
                    AWS (LOCAL) , COAdapterForOBR (LOCAL) , HYPERV (REMOTE) , KVM (LOCAL) , ONEVIEW (LOCAL) , OPENSTACK (LOCAL) , PHYSICAL (LOCAL) , VCENTER (LOCAL) , VMWAREFIVE (LOCAL) , XEN (LOCAL) , vPVOBRcollector (LOCAL) .
                    Also addtarget, restart commands are supported only for DataSources with LOCAL Collection Types.
             FileType - Supported FileType: Json

Here is an example to add a new vCenter server to CO 3.0x.

# /opt/OV/bin/pvconfig -at -ty VCENTER -t <vCenter FQDN> -u <user> -p <passwd>

Here is an example to delete a vCenter server from CO 3.0x.

# /opt/OV/bin/pvconfig -dt -ty VCENTER -t <vCenter FQDN>

I hope that this helps answer your question.

Regards,

Mark

---
Mark Butler
Micro Focus SW Support Engineer
https://softwaresupport.softwaregrp.com/

View solution in original post

Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..

Re: Command (or) API to add a vCenter datasource in CO 3.x

Jump to solution

Hi Mark,

Perfect, This is what exactly i was looking for. Thanks!

Thanks,

Ram.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.