Automation, Scripting, and Virtualization Flashcards
7 cards from real SAC practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 Automation, Scripting, and Virtualization flashcards as text
What does the 'shebang' line '#!/usr/bin/env python3' at the top of a script do?
Answer: Tells the OS to execute the script using the python3 interpreter found in PATH
The shebang combined with /usr/bin/env locates python3 dynamically in PATH, making the script portable across systems.
In VMware vSphere, what resource pool feature prevents a single VM from consuming all CPU resources on a host?
Answer: CPU Limits and Reservations
CPU limits cap the maximum MHz a VM can use, while reservations guarantee a minimum, preventing resource starvation.
Which sed command replaces the first occurrence of 'error' with 'warning' in each line of a file?
Answer: sed 's/error/warning/' file
Without the 'g' flag, sed's substitute command replaces only the first match per line.
What is the primary purpose of Infrastructure as Code (IaC) tools like Terraform or CloudFormation?
Answer: Provisioning and managing infrastructure through machine-readable configuration files
IaC tools let administrators define infrastructure in code, enabling version control, repeatability, and automated provisioning.
In a Bash script, what does 'set -e' at the beginning accomplish?
Answer: Causes the script to exit immediately if any command returns a non-zero exit code
set -e (errexit) makes the shell exit on the first command failure, preventing scripts from silently continuing after errors.
Which virtualization concept describes the ability to present a single physical NIC as multiple virtual network adapters to VMs?
Answer: SR-IOV (Single Root I/O Virtualization)
SR-IOV enables a physical NIC to expose multiple virtual functions (VFs) directly to VMs, bypassing the hypervisor for near-native performance.
When writing a PowerShell automation script, which approach is recommended to securely handle credentials rather than hardcoding them?
Answer: Use Get-Credential to prompt interactively or store as an encrypted SecureString
Get-Credential captures passwords as SecureString objects, or you can export encrypted credential objects with Export-Clixml.