Installing and Administering Solaris Container Manager 3.6.1

ProcedureTo Move Processes Into an Application-Based Project Individually

Use this procedure if you did not provide a match expression for an application-based project and want to move the application's processes into the project individually.

Steps
  1. Create an application-based project for managing the application. Select the Do Not Use Match Expression check box.

    For detailed steps, see the section, To Create an Application-Based Project.

  2. Review the/etc/project file to determine the project name by typing:


    % cat /etc/project
    

    You will need this project name in Step 5.

  3. If needed, start the application in a terminal window.

  4. Determine the processes that correspond to the application.

    For examples, see Example 4–1, Example 4–2, and Example 4–3.

  5. Move the corresponding processes.

    1. From the Container Manager GUI, click the host in the navigation window.

    2. Click the Projects tab.

      The Projects table is shown.

    3. In the Projects table, click the project name. Note that the project name is underlined to show it is a link.

      The Projects Properties tab is shown.

    4. Click the Processes tab.

      The Processes table is shown.

    5. Select the processes to be moved.

    6. Click the Move button.

      The Move Process dialog box appears.

    7. Select the new project (containers) for the process from the list of projects (containers).

    8. Click OK.

  6. Repeat Step 5 until all processes are moved.


Example 4–4 Verifying That the Processes Were Moved Into the Project With ps

You can use the ps command in combination with grep to verify that the processes have been moved into a container. The following example shows that the processes that were individually moved are now in the container payroll:


% ps -ae -o pid,project,comm | grep payroll
17773    payroll ora_reco_AcctEZ 
17763    payroll ora_pmon_AcctEZ 
17767    payroll ora_lgwr_AcctEZ 


Example 4–5 Verifying That the Processes Were Moved Into the Project With prstat

You can use the command prstat to verify that the processes were moved into a container if you know the project name. In this example, the project name is payroll.


% prstat -J payroll
   PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP       
 17773 admin     216M  215M cpu2     1    0   0:05:08  29% ora_reco_AcctEZ/1
 17763 admin     834M  782M sleep    1    0   0:35:02   0% ora_pmon_AcctEZ/1
 17767 admin     364M  352M run      1    0   0:22:05  23% ora_lgwr_AcctEZ/1