- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
10-Process placement commands | 94.6 KB |
affinity location-set
Use affinity location-set to set the affinity of a process to a set of CPUs.
Use undo affinity location-set to remove the configuration.
Syntax
affinity location-set { slot slot-number [ cpu cpu-number ] }&<1-5> { attract strength | default | none | repulse strength }
undo affinity location-set { slot slot-number [ cpu cpu-number ] }&<1-5>
Default
No location affinity is configured for any process.
Views
Placement process view
Predefined user roles
network-admin
Parameters
{ slot slot-number [ cpu cpu-number ] }&<1-5>: Specifies the affinity.
· slot slot-number: Specifies an IRF member device by its ID.
· cpu cpu-number: Specifies a CPU by its number. The number can only be 0.
attract strength: Sets a positive affinity in the range of 1 to 100000. The higher the value, the stronger the preference for the process to run in the specified CPU.
default: Sets the affinity to the default, a positive affinity of 200.
none: Sets the affinity to 0, which means the active process has no preference for any location and the system determines its location.
repulse strength: Sets a negative affinity in the range of 1 to 100000. The higher the value, the weaker the preference for the process to run in the specified CPU.
Usage guidelines
This command sets the preference for a process to run on a specific CPU. You can specify up to five CPUs in this command.
Examples
# Configure a positive affinity of 500 to IRF member device 3 for BGP.
<Sysname> system-view
[Sysname] placement program bgp
[Sysname-program-bgp] affinity location-set slot 3 attract 500
affinity location-type
Use affinity location-type to set the affinity of a process to a location type.
Use undo affinity location-type to restore the default.
Syntax
affinity location-type { current | paired | primary } { attract strength | default | none | repulse strength }
undo affinity location-type { current | paired | primary }
Default
No location type affinity is configured for any process.
Views
Placement process view
Predefined user roles
network-admin
Parameters
current: Specifies the affinity to the current location. You can use the display placement program command to view the current location of a process.
paired: Specifies the affinity to the location of a standby process.
primary: Specifies the affinity to the master device.
attract strength: Sets a positive affinity in the range of 1 to 100000. The higher the value, the stronger the preference of the process to run on the specified location type.
default: Sets the affinity to the default, a positive affinity of 200.
none: Sets the affinity to 0.
repulse strength: Sets a negative affinity in the range of 1 to 100000. The higher the value, the weaker the preference for the process to run on the specified location type.
Examples
# Specify a positive affinity of 500 to the current location for BGP.
<Sysname> system-view
[Sysname] placement program bgp
[Sysname-program-bgp] affinity location-type current attract 500
Related commands
· affinity location-set
· affinity program
affinity program
Use affinity program to set the affinity of one process to another process.
Use undo affinity program to remove the configuration.
Syntax
affinity program program-name { attract strength | default | none | repulse strength }
undo affinity program program-name
Default
No process affinity is configured for any process.
Views
Placement process view
Predefined user roles
network-admin
Parameters
program-name: Specifies the name of a process, a case-insensitive string of 1 to 15 characters. You can use the display placement program all command to view information about placeable processes.
attract strength: Sets a positive affinity in the range of 1 to 100000. The higher the value, the stronger the preference for the current process to run on the same location as the specified process.
default: Sets the affinity to the default, a positive affinity of 200.
none: Sets the affinity to 0, which means the active process has no preference for any other process and the system determines its location.
repulse strength: Sets a negative affinity in the range of 1 to 100000. The higher the value, the weaker the preference for the current process to run on the same location as the specified process.
Usage guidelines
Use this command to have processes run on the same location or different locations.
Examples
# Configure a negative affinity of 200 for OSPF to run on the same location as BGP.
<Sysname> system-view
[Sysname] placement program ospf
[Sysname-program-ospf] affinity program bgp repulse 200
Related commands
· affinity location-set
· affinity location-type
affinity self
Use affinity self to set the affinity of one instance of a process to any other instance of the same process.
Use undo affinity self to remove the configuration.
Syntax
affinity self { attract strength | default | none | repulse strength }
undo affinity self
Default
No self affinity is configured for any process.
Views
Placement process view
Predefined user roles
network-admin
Parameters
attract strength: Specifies a positive affinity in the range of 1 to 100000. The higher the value, the stronger the preference for all the instances of the current process to run on the same location.
default: Sets the affinity to the default, a positive affinity of 200.
none: Sets the affinity to 0, which means the instances of the process have no preference to run on the same location and the system determines their locations.
repulse strength: Sets a negative affinity in the range of 1 to 100000. The higher the value, the weaker the preference for all the instances of the current process to run on the same location.
Usage guidelines
This command sets the preference for a process to run all its instances on the same location or different locations. If the process has only one instance, the command does not take effect.
The self affinity in the placement process view of a process and any of its instances overwrite each other, and whichever is configured the last takes effect on all the instances of the process.
To view the instances of a process, use the display placement program all command.
Examples
# Configure a negative self affinity of 200 for BGP.
<Sysname> system-view
[Sysname] placement program bgp
[Sysname-program-bgp] affinity self repulse 200
Related commands
· affinity location-set
· affinity location-type
display ha service-group
Use display ha service-group to display the location and status of a service group.
Syntax
display ha service-group { program-name [ instance instance-name ] | all }
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
program-name: Specifies a service group by its name, a case-insensitive string of 1 to 15 characters.
all: Specifies all service groups running on the device.
instance instance-name: Specifies an instance by its name, a case-insensitive string of 1 to 15 characters. Whether or not a service group has multiple instances depends on the system software.
Examples
# Display the location and status of all service groups.
<Sysname> display ha service-group all
Service Group Current Location State
-------------------------------------------------------------------------------
ospf 1/0 Realtime Backup
bgp 1/0 Batch Backup
isis 1/0 Stopping
rip 1/0 Realtime Backup
ripng 1/0 Upgrading
staticroute 1/0 Batch Backup
# Display the location and status of the specified service group.
<Sysname> display ha service-group staticroute
Service Group Current Location State
------------------------------------------------------------------------------
staticroute 1/0 (Active) Batch Backup
Detailed information about services of the program:
Service PID Type Location State
-------------------------------------------------------------
ifm 200 Active 1/0 Realtime Backup
staticroute 200 Active 1/0 Batch Backup
ifm 200 Standby 2/0 Realtime Backup
staticroute 200 Standby 2/0 Batch Backup
The output shows the following:
· The active process of the service group staticroute is running on CPU 0 of IRF member device 1, and is in batch backup state.
· The standby process is running on CPU 0 of IRF member device 0.
· The service group has two services ifm and staticroute with PID 200. ifm is in real-time backup state, and staticroute is in batch backup state.
Table 1 Command output
Field |
Description |
Service Group |
Service group name. |
Type |
Process type: active or standby. |
Service |
Service name. |
State |
Process status: · Realtime Backup · Batch Backup · Stopping · Degrading · Upgrading |
display placement location
Use display placement location to display the processes running on a specific location.
Syntax
display placement location { all | slot slot-number [ cpu cpu-number ] }
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
all: Displays all processes running on the device.
slot slot-number: Displays the processes running on an IRF member device. The slot-number argument specifies the ID of the IRF member device.
cpu cpu-number: Specifies a CPU by its number. The number can only be 0.
Examples
# Display the processes running on the IRF member device 1.
<Sysname> display placement location slot 1
Program(s) placed at location: 1/0
l3vpn
lsm
aaa
lauth
track
bfd
rm6
rm
rpm
usr6
ipaddr
ip6addr
slsp
usr
ethbase
ip6base
ipbase
eth
display placement policy
Use display placement policy to display process placement policy information.
Syntax
display placement policy program { program-name | all | default }
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
program-name: Displays the placement policy for a process. The process name is a case-insensitive string of 1 to 15 characters.
all: Displays all process placement policies.
default: Displays the default process placement policy. It is not displayed if no default process placement policy is configured with the placement program default command.
Usage guidelines
The information about a placement policy is displayed only when the placement policy is configured for the specified process.
Examples
# Display the default process placement policy.
<Sysname> display placement policy program default
Program: [default] : source
----------------------------------------------------------
affinity location-set slot 0 cpu 0 attract : system [default]
# Display the placement policy for AAA.
<Sysname> display placement policy program aaa
Program: aaa : source
----------------------------------------------------------
affinity location-set slot 0 cpu 0 attract : system [default]
100
Table 2 Command output
Field |
Description |
Program |
Process name. |
source |
Source of the setting. The text system [default] identifies a default placement setting configured in the view you enter with the placement program default command. The text system aaa identifies a placement setting for the process aaa configured in the view you enter with the placement program program-name command. |
display placement program
Use display placement program to display the location of an active process.
Syntax
display placement program { program-name | all }
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
program-name: Specifies a process by its name, a case-insensitive string of 1 to 15 characters.
all: Specifies all processes.
Examples
# Display the location of AAA.
<Sysname> display placement program aaa
Program Placed at location
----------------------------------------------------
aaa 1/0
Table 3 Command output
Field |
Description |
Program |
Process name. |
Placed at location |
Location of the process. If NA is displayed, the process is not available because the service is abnormal or the process is starting up or shut down. |
display placement reoptimize
Use display placement reoptimize to display the predicted changes that will occur when you run the placement reoptimize command.
Syntax
display placement reoptimize program { program-name [ instance instance-name ] | all }
Views
Any view
Predefined user roles
network-admin
network-operator
Parameters
program-name: Displays changes for a process (that supports process optimization) specified by its name, a case-insensitive string of 1 to 15 characters.
instance instance-name: Specifies an instance of the specified process by name, a case-insensitive string of 1 to 15 characters. Whether a process has multiple instances depends on the system software.
all: Displays changes for all processes that support process optimization.
Examples
# Display the predicted changes for all processes.
<Sysname> display placement reoptimize program all
Predicted changes to the placement
Program Current location New location
---------------------------------------------------------------------
rm6 1/0 1/0
rm 1/0 1/0
rpm 1/0 1/0
usr 1/0 1/0
usr6 1/0 1/0
bgp 1/0 1/0
pim 1/0 1/0
igmp 1/0 1/0
The output shows the process name, current location of the active process, and new location of the active process after optimization.
placement program
Use placement program to enter placement process view.
Use undo placement program to delete the placement policy for a process.
Syntax
placement program { program-name [ instance instance-name ] | default }
undo placement program { program-name [ instance instance-name ] | default }
Default
No placement process view is created, and all active processes run on the master device.
Views
System view
Predefined user roles
network-admin
Parameters
program-name: Specifies a process name, a case-insensitive string of 1 to 15 characters.
instance instance-name: Specifies the name of an instance of the specified process. The instance name is a case-insensitive string of 1 to 15 characters. If a process has only one instance, the system displays a prompt when you specify this option.
default: Configures the default placement policy for all processes.
Usage guidelines
You configure a process placement policy to optimize the distribution of processes in your system for optimal distribution of CPU and memory resources.
For an active process running only on the master device, it does not support placement optimization (by displaying a configuration failure prompt). When such an active process fails, the system automatically restarts the process. The standby processes are used for active/standby switchover and ISSU.
Some active processes can run on either the master or subordinate device. When such an active process fails, the system uses a placement policy to select a new active process among standby processes.
A process placement policy comprises the affinity location-type, affinity location-set, affinity program, and affinity self commands, which describe the preferences of the process for a specific location.
You can configure all the affinity commands in the placement policy for a process. Based on the placement policy and hardware resources, the system automatically determines the location for running the process. Before you apply the policy, you can use the display placement reoptimize command to view the predicted location for the process.
Examples
# Enter the placement process view of BGP.
<Sysname> system-view
[Sysname] placement program bgp
[Sysname-program-bgp]
# Enter the placement process view of BGP instance 100.
<Sysname> system-view
[Sysname] placement program bgp instance 100
[Sysname-program-bgp-100]
# Enter default placement process view.
<Sysname> system-view
[Sysname] placement program default
[Sysname-program-default]
placement reoptimize
Use placement reoptimize to apply configured process placement policies for optimizing process placement.
Syntax
placement reoptimize
Views
System view
Predefined user roles
network-admin
Usage guidelines
After you issue this command, the system bases its placement decisions on the new process placement policies, hardware resources, and locations and states of active processes. If the new location for an active process is different from its current location, the system changes its state to standby and the state of the standby process on the new location to active. This active/standby switchover does not interrupt running services because no process is restarted.
To keep the system stable, H3C recommends not performing any operation that requires process restart when you execute this command.
Examples
# Reoptimize process placement.
<Sysname> system-view
[Sysname] placement reoptimize
Predicted changes to the placement
Program Current location New location
---------------------------------------------------------------------
syslog 1/0 1/0
l3vpn 1/0 1/0
aaa 1/0 1/0
lauth 1/0 1/0
lsm 1/0 1/0
ip6addr 1/0 1/0
ip6base 1/0 1/0
rm 1/0 1/0
ipcfg 1/0 1/0
acl 1/0 1/0
tunnel 1/0 1/0
lagg 1/0 1/0
qos 1/0 1/0
ipcim 1/0 1/0
ipbase 1/0 1/0
eth 1/0 1/0
ipen 1/0 1/0
Continue? [y/n]:y
Re-optimization of the placement start. You will be notified on completion
Re-optimization of the placement complete. Use 'display placement' to view the new placement