An administrator is creating a cron job that shuts down the virtual machines at night to save on costs. Which of the following is the best way to achieve this task?
Option C is the correct script for shutting down virtual machines that are currently running. It iterates through a list of VMs, checks if the status of each VM is 'running', and if so, proceeds to shut down the VM. The script then prints a message stating that the VM has been stopped. This approach ensures that only VMs that are actively running are targeted for shutdown, optimizing resource utilization and cost savings.
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit