Sun N1 Service Provisioning System 5.1 Command-Line Interface Reference Manual

Chapter 7 hdb: CLI Commands for Managing Hosts

This chapter describes the commands that you need to manage hosts.

Introduction

The CLI includes the following sets of commands for managing hosts.

Table 7–1 Sets of Commands for Managing Hosts

CLI Prefix 

Description of Command Set 

hdb.a 

Commands for managing application instances (Applications are the individual Remote Agents, and Local Distributors). 

hdb.h 

Commands for managing target hosts. 

hdb.hr 

Commands for managing host searches. 

hdb.hs 

Commands for managing host sets. 

hdb.ht 

Commands for managing host types. 

This chapter describes all the commands in each of these sets.

hdb.a: Managing Application Instances

The hdb.a family of commands controls instances of the provisioning software's applications, such as the Remote Agents and Local Distributors.

Table 7–2 Summary of hdb.a Commands

Command Name 

Description 

hdb.a.add 

Adds a new application instance 

hdb.a.del 

Deletes an application instance 

hdb.a.la 

Lists all application instances 

hdb.a.lo 

Retrieves information about a specific application instance 

hdb.a.mod 

Modifies an existing application instance 

hdb.a.clear 

Clears the resource cache of an application instance 

hdb.a.add

This command adds a new application instance; it registers a specific configuration of a specific Sun N1 Service Provisioning System software application with the Master Server.

Table 7–3 Arguments and Result for the hdb.a.add Command

Argument/Result 

Syntax 

Description 

hID 

[R] 

HostID  

The ID of the host to contain the new instance  

type 

[R] 

AppType  

The application type (RA|LD)  

pID 

[R] 

AppInstanceID  

The parent application ID  

ip 

[R] 

String  

The application IP address (x.y.z.w)  

port 

[O] 

Integer  

The application port (not required for ssh)  

conn 

[R] 

ConnectionType 

The connection type (raw|ssh|ssl)  

param 

[O] 

String  

The parameters  

result 

UIAppInstanceUpdate  

The new application instance and associated warnings 


Note –

Omitting the -port argument or setting the port to 0 on an application instance with connection type ssh will cause the default ssh port to be used.


hdb.a.del

This command deletes an application instance from the Master Server's internal files. Once deleted, the application instance is no longer recognized by the Master Server.


Note –

Deleting an application instance does not delete Sun N1 Service Provisioning System software files on the machine where the application instance was installed.


Table 7–4 Argument for the hdb.a.del Command

Argument 

Syntax 

Description 

ID 

[R] 

AppInstanceID  

The application instance ID  


Example 7–1 Example of Deleting an Application Instance

This example demonstrates deleting a Remote Agent and Local Distributor from a host named NewYork-v240.

Host name

NewYork-v240


[Deleting the Remote Agent]
% ./cr_cli -cmd hdb.a.del -ID NM:NewYork-v240:RA -u admin -p admin

[Deleting the Local Distributor]
% ./cr_cli -cmd hdb.a.del -ID NM:NewYork-v240:LD -u admin -p admin

hdb.a.la

This command lists all the application instances known to the Master Server.

This command does not accept any arguments.

Table 7–5 Result Returned by the hdb.a.la command

Result 

Result Syntax 

Description 

result 

AppInstanceArray  

The application instances  

hdb.a.lo

This command retrieves information about a specified application instance.

Table 7–6 Argument and Results of the hdb.a.lo Command

Argument/Result 

Syntax 

Description 

ID 

[R] 

AppInstanceID  

The application instance ID  

result 

AppInstance  

The application instance  

hdb.a.mod

This command modifies the specified attributes of an existing application instance. Omitted arguments preserve current values.

Table 7–7 Arguments and Result for the hdb.a.mod Command

Argument/Result 

Syntax 

Description 

ID 

[R] 

AppInstanceID  

The application instance ID  

pID 

[O] 

AppInstanceID  

The new parent application ID  

ip 

[O] 

String  

The new application IP address (x.y.z.w)  

port 

[O] 

Integer  

The new application port  

conn 

[O] 

ConnectionType 

The new connection type (raw|ssh|ssl)  

param 

[O] 

String  

The new parameters  

result 

UIAppInstanceUpdate  

The modified application instance and associated warnings 


Note –

Omitting the -port argument or setting the port to 0 on an application instance with connection type ssh will cause the default ssh port to be used.


hdb.a.clear

This command clears the resource cache of an application instance.

Table 7–8 Arguments and Result for the hdb.a.clear Command

Argument/Result 

Syntax 

Description 

ID 

[R] 

AppInstanceID  

The application instance ID  

hdb.h: Managing Hosts

The hdb.h commands manage target hosts: physical and virtual hosts whose applications you are managing with the Sun N1 Service Provisioning System software.

Table 7–9 Summary of hdb.h Commands

Command 

Description 

hdb.h.add 

Adds a new host. 

hdb.h.del 

Deletes a host 

hdb.h.la 

Lists all hosts. 

hdb.h.lo 

Retrieves information about a host. 

hdb.h.lq 

Queries for matching hosts.  

hdb.h.mod 

Modifies an existing host. 

hdb.h.add

This command adds a new host to the host repository.

Table 7–10 Arguments and Results for the hdb.h.add Command

Argument/Result 

Syntax 

Description 

name 

[R] 

String  

The host name  

desc 

[O] 

String  

The host description  

tID 

[R] 

HostTypeID  

The ID of the host type  

attr 

[O] 

Hashtable  

The host attributes  

hide 

[O] 

Boolean 

Whether the host is hidden, default false 

pID 

[O] 

HostID 

The ID of the parent host if virtual, or empty if physical  

result 

Host  

The new host  


Note –

The -attr argument only sets the overrides. Attributes not explicitly included retain their default value.



Example 7–2 Example of Adding a Host

This example demonstrates adding a basic host to the provisioning software.

Host name

NewYork-v240

Host type

system#crhost


% ./cr_cli -cmd hdb.h.add -name NewYork-v240  \
-tID NM:system#crhost -u admin -p admin


Example 7–3 Example of Adding a Virtual Host

This example demonstrates adding a virtual host that is located on a server named NewYork-v240.

Virtual host name

MyAppServer-vhost

Host type

system#crhost

Parent host name

NewYork-v240


% ./cr_cli -cmd hdb.h.add -name MyAppServer-vhost  \ 
-tID NM:system#crhost -pID NM:NewYork-v240 -u admin -p admin

hdb.h.del

This command deletes a host and all application instances and components that were installed on the host. For more information, see Deleting a Host in Sun N1 Service Provisioning System 5.1 System Administration Guide.

Table 7–11 Arguments and Results for the hdb.h.del Command

Argument/Result 

Syntax 

Description 

ID 

[R] 

HostID  

The host ID  


Example 7–4 Example of Deleting a Host Record

This example demonstrates deleting a host.

Host name

NewYork-v240


% ./cr_cli -cmd hdb.h.del -ID NM:NewYork-v240 -u admin -p admin

hdb.h.la

This command lists all hosts in the repository.

Table 7–12 Argument and Result for the hdb.h.la Command

Argument/Result 

Syntax 

Description 

sh 

[O] 

Boolean 

Whether hidden hosts are shown, default false 

result 

HostArray  

The hosts  

hdb.h.lo

This command retrieves information about a host from the repository.

Table 7–13 Argument and Result for the hdb.h.lo Command

Argument/Result 

Syntax 

Description 

ID 

[R] 

HostID  

The host ID  

result 

Host  

The host  

hdb.h.lq

This command queries for hosts that match either specified criteria or a specified filter.


Note –

You must call this command with either a query (with -query) or a filter (with -filt or -phys).


Table 7–14 Arguments and Result for the hdb.h.lq Command

Argument/Result 

Syntax 

Description 

query 

[O] 

AttributeCriteriaList  

The query criteria 

filt 

[O] 

AppTypeCriteria 

The application type filter 

phys 

[O] 

PhysicalCriteria 

A filter to restrict to physical or virtual hosts 

sh 

[O] 

Boolean 

Whether hidden hosts are shown, default false 

result 

HostArray  

The hosts  

hdb.h.mod

This command modifies the specified attributes of an existing host. Omitted arguments preserve current values.

Table 7–15 Arguments and Result of the hdb.h.mod Command

Argument/Result 

Syntax 

Description 

ID 

[R] 

HostID  

The host ID  

name 

[O] 

String  

The host name  

desc 

[O] 

String  

The host description  

tID 

[O] 

HostTypeID  

The ID of the host type  

attr 

[O] 

Hashtable  

The host attributes  

hide 

[O] 

Boolean 

Whether the host is hidden 

pID 

[O] 

HostID 

The ID of the parent host if virtual, or “<null>” if physical 

result 

Host  

The modified host  


Note –

Use the -attr argument to specify the attributes whose values you want to modify. Attributes not explicitly specified retain (or are reset to) their default values.


hdb.hr: Managing Host Searches

Overview

The hdb.hr commands manage host searches.

Table 7–16 Summary of hdb.hr Commands

Command 

Description 

hdb.hr.add 

Adds a new host search. 

hdb.hr.del 

Deletes a host search. 

hdb.hr.la 

Lists all host searches. 

hdb.hr.le 

Lists all the hosts returned by a host search. 

hdb.hr.lo 

Retrieves information about a host search. 

hdb.hr.mod 

Modifies an existing host search. 

hdb.hr.add

This command adds a new host search. It enters the host search's name and search criteria in the repository.

Table 7–17 Arguments and Result for the hdb.hr.add Command

Argument/Result 

Syntax 

Description 

name 

[R] 

String  

The host search name  

desc 

[O] 

String  

The host search description  

[R/O] 

AttributeCriteriaList  

The dynamic query; must be specified if filt and phys are not 

filt 

[R/O] 

AppTypeCriteria 

A filter to restrict the search to certain types of hosts; must be specified if q and phys are not 

phys 

[R/O] 

PhysicalCriteria 

A filter to restrict to physical or virtual hosts; must be specified if q and filt are not 

hide 

[O] 

Boolean 

Whether the search is hidden, default false  

result 

HostSearch  

The new host search  

hdb.hr.del

This command deletes a host search.

Table 7–18 Arguments and Result for the hdb.hr.del Command

Argument 

Syntax 

Description 

ID 

[R] 

HostSearchID 

The host search ID 

hdb.hr.la

This command lists all host searches defined in the repository.

Table 7–19 Argument and Result for the hdb.hr.la Command

Argument/Result 

Syntax 

Description 

sh 

[O] 

Boolean 

Whether hidden searches are shown, default false 

result 

HostSearchArray  

The host searches  

hdb.hr.le

This command lists all hosts that match the criteria of the specified host search. The lists represents hosts that match these criteria when hdb.hr.le is run.

Table 7–20 Arguments and Result for the hdb.hr.le Command

Argument/Result 

Syntax 

Description 

ID 

[R] 

HostSearchID  

The host search ID  

sh 

[O] 

Boolean 

Whether hidden searches are shown, default false 

result 

HostArray  

The hosts  

hdb.hr.lo

This command retrieves information about a specified host search.

Table 7–21 Argument and Result for the hr.hr.lo

Argument/Result 

Syntax 

Description 

ID 

[R] 

HostSearchID  

The host search ID  

result 

HostSearch  

The host search  

hdb.hr.mod

This command modifies an existing host search. Omitted arguments preserve current values

Table 7–22 Arguments and Results for the hdb.hr.mod Command

Argument/Result 

Syntax 

Description 

ID 

[R] 

HostSearchID  

The host search ID  

name 

[O] 

String  

The host search name  

desc 

[O] 

String  

The host search description  

[O] 

AttributeCriteriaList 

The dynamic query  

filt 

[O] 

VarValueCriteria 

An optional filter to restrict the search to certain types of hosts 

phys 

[O] 

PhysicalCriteria 

A filter to restrict to physical or virtual hosts 

hide 

[O] 

Boolean 

Whether the search is hidden 

result 

HostSearch  

The modified host search  

hdb.hs: Managing Host Sets

The hdb.hs commands manage host sets.

Table 7–23 Summary of hdb.hs Commands

Command 

Description 

hdb.hs.add 

Adds a new host set. 

hdb.hs.del 

Deletes a host set. 

hdb.hs.la 

Lists all host sets. 

hdb.hs.le 

Lists all the hosts contained in a host set. 

hdb.hs.lo 

Retrieves information about a host set. 

hdb.hs.mod 

Modifies an existing host set. 

hdb.hs.add

This command adds a new host set to the repository.

Table 7–24 Arguments and Result for the hdb.hs.add Command

Argument/Result 

Syntax 

Description 

name 

[R] 

String  

The host set name  

desc 

[O] 

String  

The host set description  

hIDs 

[O] 

HostIDSet  

The IDs of the static member hosts  

sIDs 

[O] 

HostSetIDSet 

The IDs of the host subsets  

rIDs 

[O] 

HostSearchIDSet  

The IDs of the host searches  

hide 

[O] 

Boolean 

Whether the host set is hidden, default false 

result 

HostSet  

The new host set  

hdb.hs.del

This command deletes a host set.

Table 7–25 Arguments and Result for the hdb.hs.del Command

Argument 

Syntax 

Description 

ID 

[R] 

HostSetID  

The host ID  

hdb.hs.la

This command lists all host sets defined in the Sun N1 Service Provisioning System software.

Table 7–26 Argument and Result for the hdb.hs.la Command

Argument/Result 

Syntax 

Description 

hide 

[O] 

Boolean 

Whether hidden host sets are shown, default false 

result 

HostSetArray  

The host sets  

hdb.hs.le

This command lists all the hosts contained in the specified host set.

Table 7–27 Arguments and Results for the hdb.hs.le Command

Argument 

Syntax 

Description 

ID 

[R] 

HostSetID  

The host set ID  

hide 

[O] 

Boolean  

Whether hidden host sets are shown, default false 

result 

HostArray  

The hosts  

hdb.hs.lo

This command retrieves the specified host set.

Table 7–28 Argument and Result for the hdb.hs.lo Command

Argument/Result 

Syntax 

Description 

ID 

[R] 

HostSetID  

The host set ID  

result 

HostSet  

The host set  

hdb.hs.mod

This command modifies an existing host set; omitted arguments preserve current values.

Table 7–29 Arguments and Result for the hdb.hs.mod Command

Argument/Result 

Syntax 

Description 

ID 

[R] 

HostSetID  

The host set ID  

name 

[O] 

String  

The host set name  

desc 

[O] 

String  

The host set description  

hIDs 

[O] 

HostIDSet  

The IDs of the static member hosts  

sIDs 

[O] 

HostSetIDSet 

The IDs of the host subsets  

rIDs 

[O] 

HostSearchIDSet 

The IDs of the host searches  

hide 

[O] 

Boolean 

Whether the host set is hidden 

result 

HostSet  

The modified host set  

hdb.ht: Managing Host Types

Overview

The hdb.ht commands manage host types.

Table 7–30 Summary of hdb.ht Commands

Command 

Description 

hdb.ht.add 

Adds a new host type. 

hdb.ht.del 

Deletes a host type. 

hdb.ht.la 

Lists all host types. 

hdb.ht.lo 

Retrieves information about a host type. 

hdb.ht.mod 

Modifies an existing host type. 

hdb.ht.add

This command adds a new host type. It assigns the host type a name and defines the host type's attributes.

Table 7–31 Arguments and Result for the hdb.ht.add Command

Argument/Result 

Syntax 

Description 

name 

[R] 

String  

The host type name  

desc 

[O] 

String  

The host type description  

attr 

[R] 

HostTypeVarList 

The host type attributes  

hide 

[O] 

Boolean 

Whether the host type is hidden, default false 

result 

HostType  

The new host type  

hdb.ht.del

This command deletes a host type.

Table 7–32 Arguments and Result for the hdb.ht.del Command

Argument 

Syntax 

Description 

ID 

[R] 

HostTypeID 

The host type ID 

hdb.ht.la

This commands lists all the host types defined, including the default host type, crhost.

Table 7–33 Argument and Result for the hdb.ht.la Command

Argument/Result 

Syntax 

Description 

sh 

[O] 

Boolean 

Whether hidden host types are shown, default false 

result 

HostTypeArray  

The host types  

hdb.ht.lo

This command retrieves a host type.

Table 7–34 Argument and Result for the hdb.ht.lo Command

Argument/Result 

Syntax 

Description 

ID 

[R] 

HostTypeID  

The host type ID  

result 

HostType  

The host type  

hdb.ht.mod

This command modifies an existing host type. Omitted arguments preserve current values.

Table 7–35 Arguments and Result for the hdb.ht.mod Command

Argument/Result 

Syntax 

Description 

ID 

[R] 

HostTypeID  

The host type ID  

name 

[O] 

String  

The host type name  

desc 

[O] 

String  

The host type description  

attr 

[O] 

HostTypeVarList  

The host type attributes  

hide 

[O] 

Boolean 

Whether the host type is hidden 

result 

HostType  

The modified host type