C H A P T E R   5

Using Traps and Starting and Stopping Logical Domains

This chapter contains the following sections:

The first section describes how to set up your system to send and receive traps, the traps you can use to receive change notification for logical domains, and descriptions of the output.

The second section describes active management operations, which are controlled by using the ldomAdminState property of the Logical Domains Table (ldomTable). For more information about this property and this table, see TABLE 4-1.


Using LDoms MIB Module Traps

This section describes:

Setting Up to Send and Receive Traps

The following procedures provide examples of how you can set up to send and receive traps.

procedure icon  To Send Traps

  • single-step bullet  Edit the /etc/sma/snmp/snmpd.conf file to add the directives to define the trap and inform version and destination.


    trapcommunity string --> define community string to be used when sending traps
    trapsink host[community [port]] --> to send v1 traps
    trap2sink host[community [port]] --> to send v2c traps
    informsink host[community [port]] --> to send informs
    

    For more details, refer to the Solaris 10 OS snmpd.conf(1M) man page.

    For example, to send both v1 and v2c traps to the SNMP trap daemon running on the same host, add the following directives to the /etc/sma/snmp/snmpd.conf file:


    trapcommunity public
    trapsink localhost
    trap2sink localhost
    

procedure icon  To Receive Traps

  • single-step bullet  Start the SNMP trap daemon utility, snmptrapd(1M).

    Refer to the Solaris 10 OS snmptrapd(1M) man page for options to specify the format of the output.

    For example, the following input:


    # /usr/sfw/sbin/snmptrapd -P -F “TRAP from %B on %m/%l/%y at %h:%j:%k Enterprise=%N Type=%w SubType=%q \nwith Varbinds: %v \nSecurity info:%P\n\n" localhost:162
    

    displays the trap as follows:


    TRAP from localhost on 5/18/2007 at 16:30:10 Enterprise=. Type=0 SubType=0with Varbinds:  DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (47105) 0:07:51.05     SNMPv2-MIB::snmpTrapOID.0 = OID: SUN-LDOM-MIB::ldomCreate       SUN-LDOM-MIB::ldomIndexNotif = INTEGER: 3 SUN-LDOM-MIB::ldomName = STRING: ldg2   SUN-LDOM-MIB::ldomTrapDesc = STRING: Ldom CreatedSecurity info:TRAP2, SNMP v2c, community public
    

Descriptions of LDoms MIB Traps

This section describes the following LDoms MIB traps you can use:



Note - Be sure that you have added the ldom prefix to trap names when setting traps.



Logical Domain Creation (ldomCreate)

Setting this trap notifies you of any logical domains that are created.


TABLE 5-1   Logical Domain Creation (ldomCreate) Trap
Name Data Type Description
ldomIndexNotif Integer Index into the ldomTable
ldomName Display string Name of the logical domain
ldomTrapDesc Display string Description of the trap

Logical Domain Destroy (ldomDestroy)

Setting this trap notifies you of any logical domains that are destroyed.


TABLE 5-2   Logical Domain Destroy (ldomDestroy) Trap
Name Data Type Description
ldomIndexNotif Integer Index into the ldomTable
ldomName Display string Name of the logical domain
ldomTrapDesc Display string Description of the trap

Logical Domain State Change (ldomStateChange)

Setting this trap notifies you of any operating state changes in a logical domain.


TABLE 5-3   Logical Domain State Change (ldomStateChange) Trap
Name Data Type Description
ldomIndexNotif Integer Index into the ldomTable
ldomName Display string Name of the logical domain
ldomOperState Integer New state of the logical domain
ldomStatePrev Integer Previous state of the logical domain
ldomTrapDesc Display string Description of the trap

Virtual CPU Change (ldomVCpuChange)

Setting this trap notifies you of any changes in the number of virtual CPUs for a logical domain.


TABLE 5-4   Logical Domain Virtual CPU Change (ldomVCpuChange) Trap
Name Data Type Description
ldomIndexNotif Integer Index into the ldomTable
ldomName Display string Name of the logical domain containing the virtual CPU
ldomNumVCPU Integer New number of virtual CPUs for the logical domain
ldomNumVCPUPrev Integer Previous number of virtual CPUs for this logical domain
ldomTrapDesc Display string Description of the trap

Virtual Memory Change (ldomVMemChange)

Setting this trap notifies you of any changes in the amount of virtual memory for a logical domain.


TABLE 5-5   Logical Domain Virtual Memory Change (ldomVMemChange) Trap
Name Data Type Description
ldomIndexNotif Integer Index into the ldomTable
ldomName Display string Name of the logical domain containing the virtual memory
ldomMemSize Integer Amount of virtual memory for the logical domain
ldomMemSizePrev Integer Previous amount of virtual memory for this logical domain
ldomMemUnit Integer Memory unit for virtual memory
ldomMemUnitPrev Integer Memory unit for previous virtual memory
ldomTrapDesc Display string Description of the trap

Virtual Disk Service Change (ldomVdsChange)

Setting this trap notifies you of any changes to a virtual disk service for a logical domain.


TABLE 5-6   Logical Domain Virtual Disk Service Change (ldomVdsChange) Trap
Name Data Type Description
ldomIndexNotif Integer Index into the ldomTable
ldomName Display string Name of the logical domain containing the virtual disk service
ldomVdsServiceName Display string Name of the virtual disk service that has changed
ldomChangeFlag Integer Indicates the change that occurred to this virtual disk service:

1=Added

2=Modified

3=Removed

ldomTrapDesc Display string Description of the trap

Virtual Disk Change (ldomVdiskChange)

Setting this trap notifies you of any changes to a virtual disk for a logical domain.


TABLE 5-7   Virtual Disk Change (ldomVdiskChange) Trap
Name Data Type Description
ldomIndexNotif Integer Index into the ldomTable
ldomName Display string Name of the logical domain containing the virtual disk
ldomVdiskName Display string Name of the virtual disk that has changed
ldomChangeFlag Integer Indicates the change that occurred to this virtual disk service:

1=Added

2=Modified

3=Removed

ldomTrapDesc Display string Description of the trap

Virtual Switch Change (ldomVswChange)

Setting this trap notifies you of any changes to a virtual switch for a logical domain.


TABLE 5-8   Virtual Switch Change (ldomVswChange) Trap
Name Data Type Description
ldomIndexNotif Integer Index into the ldomTable
ldomName Display string Name of the logical domain containing the virtual switch service
ldomVswServiceName Display string Name of the virtual switch services that has changes
ldomChangeFlag Integer Indicates the change that occurred to this virtual switch service:

1=Added

2=Modified

3=Removed

ldomTrapDesc Display string Description of the trap

Virtual Network Change (ldomVnetChange)

Setting this trap notifies you of any changes to a virtual network for a logical domain.


TABLE 5-9   Virtual Network Change (ldomVnetChange) Trap
Name Data Type Description
ldomIndexNotif Integer Index into the ldomTable
ldomName Display string Name of the logical domain containing the virtual network
ldomVnetDevName Display string Name of the virtual network for the logical domain
ldomChangeFlag Integer Indicates the change that occurred to this virtual network:

1=Added

2=Modified

3=Removed

ldomTrapDesc Display string Description of the trap

Virtual Console Concentrator Change (ldomVccChange)

Setting this trap notifies you of any changes to a virtual console concentrator for a logical domain.


TABLE 5-10   Virtual Console Concentrator Change (ldomVccChange) Trap
Name Data Type Description
ldomIndexNotif Integer Index into the ldomTable
ldomName Display string Name of the logical domain containing the virtual memory
ldomVccName Display string Name of the virtual console concentrator service that has changes
ldomChangeFlag Integer Indicates the change that occurred to this virtual console concentrator:

1=Added

2=Modified

3=Removed

ldomTrapDesc Display string Description of the trap

Virtual Console Group Change (ldomVconsChange)

Setting this trap notifies you of any changes to a virtual console group for a logical domain.


TABLE 5-11   Virtual Console Group Change (ldomVconsChange) Trap
Name Data Type Description
ldomIndexNotif Integer Index into the ldomTable
ldomName Display string Name of the logical domain containing the virtual memory
ldomVconsGroupName Display string Name of the virtual console group that has changes
ldomChangeFlag Integer Indicates the change that occurred to this virtual console group:

1=Added

2=Modified

3=Removed

ldomTrapDesc Display string Description of the trap


Starting and Stopping a Logical Domain

You can use the snmpset(1M) command to start or stop any logical domain:

procedure icon  To Start a Logical Domain

The start logical domain operation starts an existing bound logical domain. If a logical domain with the given domain name does not exist or is not already bound, then this operation fails.

  1. Check to see that the control (primary) domain exists and is bound.


    # ldm list primary
    Name          State     Flags   Cons     VCPU  Memory   Util   Uptime
    primary       bound     ---cv            4     1G
    

  2. Start the primary domain.


    % snmpset -v1 -c private localhost SUN-LDOM-MIB::ldomTable.1.ldomAdminState.1 = 1
    

  3. Check to see that the primary domain is now active using the ldm list command from the Logical Domains Manager.


    # ldm list primary
    Name          State     Flags   Cons     VCPU  Memory   Util   Uptime
    primary       active    -t-cv            4     1G       0.0%   0s
    

  4. You can also retrieve the logical domain state using the SNMP tools.


    % snmpget -v 1 -c public localhost SUN-LDOM-MIB::ldomOperState.1
    SUN-LDOM-MIB::ldomOperState.1 = INTEGER: active(1)
    

procedure icon  To Stop a Logical Domain

The stop operation stops a started logical domain. Any instances of an operating system that are hosted by the domain are stopped.

  1. Stop the primary domain.


    % snmpset -v1 -c private localhost SUN-LDOM-MIB::ldomTable.1.ldomAdminState.1 = 2
    

  2. Check to see that the primary domain is now bound (stopped) using the ldm list command from the Logical Domains Manager.


    # ldm list primary
    Name          State     Flags   Cons     VCPU  Memory   Util   Uptime
    primary       bound     ---cv            4     1G
    

  3. You can also retrieve the logical domain state using the SNMP tools.


    % snmpget -v 1 -c public localhost SUN-LDOM-MIB::ldomOperState.1
    SUN-LDOM-MIB::ldomOperState.1 = INTEGER: bound(6)