In this example, you’ll run a job that checks the current disk usage for your nodes (minions). In your role as an IT system administrator or DevOps team member, you often need to monitor the disk capacity of your nodes. When your nodes are close to reaching their full capacity, that usually signals the need to purchase new hardware or requisition new virtual machines to meet server capacity needs. You’ll learn how to use Tanzu Salt to check for disk usage in this kind of scenario.
To run a job that checks the disk usage for your minions:
Create a new job.
a. In the Tanzu Salt user interface, open the Jobs workspace by clicking Config > Jobs in the side menu.
b. Click the Create Job button.
Note:
If you don’t see the Create Job button, you do not have permission to create new jobs. Contact your VMware Aria Automation administrator for access or to create this job on your behalf so that you can complete the tutorial.
Enter the details for the new job and save the job.
Field | Sample value |
---|---|
Name | Give this job a descriptive name such as “Check disk usage”. |
Description | Add a description that tells other users the purpose of this job, such as “Checks disk usage on targeted devices.” |
Command | Select salt. The |
Targets | Do not select anything from this menu. Leaving this field blank allows you to select the target at the time you run the job. |
Function | Click this field and begin typing This field is where you select the Salt module that is applied when this job is run. For more information about the disk usage module, see Salt modules - Disk usage. |
Arguments | This module does not accept arguments, so leave it blank. |
Job Inputs | This job does not require any job inputs, so leave it empty. For more information about job inputs, see How do I create jobs. |
Now that you’ve created a job, run the job by selecting the job targets.
a. In the side menu, click Targets to open the Targets workspace and view your targets.
b. Verify that the All Minions target is selected. Inside the All Minions target, click the Run Job button.
c. In the Run Job dialog box, click the Job menu and select the Sample Disk Usage job you created in the previous steps. You can type the name of the job to filter the jobs if needed.
d. Click Run Now.
If you successfully ran the job, a notification appears that explains the job was successfully started.
Check whether the job is complete by clicking Activity > Completed in the side menu.
If you don’t see your job in this table, it might still be in progress. You can find jobs that are currently running by clicking Activity > In Progress. Continue refreshing Activity > Completed until your job appears in the table.
When your job is complete and appears in the table, review the job results.
a. Find the row that displays your job and click its JID (job identification number).
Note:
The JID appears as a hyperlinked number with 20 digits. For example, one possible JID could be: 20210823204015061902.
b. In the job results, click the Disk Usage tab. This tab displays information about each minion that was targeted by the job, including its total size, the current amount used, the amount of space available, and the percentage of space being used.
As you review the job results, consider the following points: