SAC Automation, Scripting, and Virtualization 3 — Questions and Answers
Question 1: Which cron schedule expression runs a job at 2:30 AM every Monday?
- 30 2 * * 1 (Correct answer)
- 2 30 * * 1
- 30 2 1 * *
- * * 2 30 1
Correct answer: 30 2 * * 1
Cron fields are minute, hour, day-of-month, month, day-of-week — so '30 2 * * 1' means 2:30 AM on Monday.
Question 2: In Terraform, what command applies changes shown in a previously generated execution plan file?
- terraform init
- terraform plan
- terraform apply (Correct answer)
- terraform validate
Correct answer: terraform apply
terraform apply executes the changes outlined in the plan, provisioning or modifying infrastructure resources.
Question 3: What is the primary role of a 'Type 1' (bare-metal) hypervisor compared to a 'Type 2' hypervisor?
- Type 1 runs on top of a host OS; Type 2 runs directly on hardware
- Type 1 runs directly on hardware; Type 2 runs on top of a host OS (Correct answer)
- Type 1 supports only Linux guests; Type 2 supports only Windows guests
- Type 1 is software-based; Type 2 is hardware-based
Correct answer: Type 1 runs directly on hardware; Type 2 runs on top of a host OS
Type 1 hypervisors (e.g., ESXi, Hyper-V) run directly on hardware, while Type 2 (e.g., VirtualBox, VMware Workstation) run within a host OS.
Question 4: In a Bash script, which construct checks if the file '/etc/passwd' exists and is readable?
- if [ -x /etc/passwd ]
- if [ -r /etc/passwd ] (Correct answer)
- if [ -w /etc/passwd ]
- if [ -d /etc/passwd ]
Correct answer: if [ -r /etc/passwd ]
The -r flag in a Bash test expression returns true when the specified file exists and is readable.
Question 5: Which PowerShell feature allows you to define a reusable block of code that accepts parameters and returns a value?
- Alias
- Cmdlet
- Function (Correct answer)
- Module
Correct answer: Function
PowerShell functions are defined with the 'function' keyword and can accept typed parameters and return values.
Question 6: What is 'live migration' in a virtualized environment?
- Taking a snapshot of a VM before maintenance
- Moving a running VM from one physical host to another with no downtime (Correct answer)
- Converting a physical machine to a virtual machine
- Resizing a VM's virtual disk while it is powered off
Correct answer: Moving a running VM from one physical host to another with no downtime
Live migration (e.g., vMotion, KVM live migration) transfers a powered-on VM between hosts transparently to end users.
Question 7: Which Ansible inventory concept groups hosts so that plays can target multiple servers by a shared label?
- Variables
- Roles
- Host groups (Correct answer)
- Handlers
Correct answer: Host groups
Host groups let administrators target a logical set of servers (e.g., [webservers]) in playbook plays.
Which cron schedule expression runs a job at 2:30 AM every Monday?