Questions about creating Server Profiles and Snapshot tags in Satellite
Does anyone know if there is a way to create server profiles for all members of a system group in satellite rather than selecting each server in that group and creating the profile on a server by server basis?
Same question for creating snapshot tags as well
If there isn't a way to do it within Satellite GUI, is there a command line solution where we could script the creation of server profiles and snapshot tags?
Responses
Hello Cary,
Under the Web-ui, I don't see any option to create a server profile (i.e package profile) or tags for all members in the group. But yes there are API's which can help you do it.
Method: createPackageProfile
Description:
Create a new stored Package Profile from a systems installed package list.
Parameters:
string sessionKey
int serverId
string profileLabel
string description
Returns:
int - 1 on success, exception thrown otherwise.
You can use this API to create the package profile for all the system in a group. As this API needs input of systemId and profileLabel you can use systemgroup.listSystems
Also for the snapshot tag, we have :
Method: tagLatestSnapshot
Description:
Tags latest system snapshot
Parameters:
string sessionKey
int serverId
string tagName
Returns:
int - 1 on success, exception thrown otherwise.
Complete set of API's is documented on https://<satellite-fqdn>/rhn/apidoc/index.jsp or on your satellite go to Help -> API section . For details on how to write an API script you can refer API Overview document.
Let us know if this information helps you get started with APIs and serve your purpose.
Paresh
my $usersystems=$client->call(system.listUserSystems', $session);
^ missing single quote mark
Otherwise this script works for me (Satellite Version: 5.4.0 API Version: 10.11). Your XMLRPC fault indicates that you called the "systemgroup" class but line 19 shows you called "system"... Are you sure this is the same script you ran...?
Changing class to "systemgroup" produces your error:
Fault returned from XML RPC Server, fault code -1: redstone.xmlrpc.XmlRpcFault: Could not find method: listUserSystems in class: com.redhat.rhn.frontend.xmlrpc.systemgroup.ServerGroupHandler with params: [java.lang.String]