RedHat Red Hat Certified Specialist in OpenShift Virtualization - EX316 Exam Practice Test
How do you create a snapshot of a running virtual machine using CLI?
Correct Answer:
See the Explanation.
Explanation:
1. Define the snapshot YAML:
apiVersion: snapshot.kubevirt.io/v1alpha1
kind: VirtualMachineSnapshot
metadata:
name: test-vm-snap
namespace: default
spec:
source:
name: test-vm
kind: VirtualMachine
2. Apply: oc apply -f vm-snapshot.yaml
3. Monitor with: oc get vmsnapshot test-vm-snap -o yaml
4. Wait for status.readyToUse: true
5. Confirm snapshot appears in oc get volumesnapshots.
Explanation:
1. Define the snapshot YAML:
apiVersion: snapshot.kubevirt.io/v1alpha1
kind: VirtualMachineSnapshot
metadata:
name: test-vm-snap
namespace: default
spec:
source:
name: test-vm
kind: VirtualMachine
2. Apply: oc apply -f vm-snapshot.yaml
3. Monitor with: oc get vmsnapshot test-vm-snap -o yaml
4. Wait for status.readyToUse: true
5. Confirm snapshot appears in oc get volumesnapshots.
How do you verify that snapshot capability is enabled in the cluster?
Correct Answer:
See the Explanation.
Explanation:
1. Run: oc get volumesnapshotclass
2. Ensure at least one CSI-compatible VolumeSnapshotClass exists.
3. Verify deletionPolicy is set to Delete or Retain.
4. Run: oc get volumesnapshot to check existing snapshots.
5. Confirm snapshot CRDs are installed.
Explanation:
1. Run: oc get volumesnapshotclass
2. Ensure at least one CSI-compatible VolumeSnapshotClass exists.
3. Verify deletionPolicy is set to Delete or Retain.
4. Run: oc get volumesnapshot to check existing snapshots.
5. Confirm snapshot CRDs are installed.
How do you detach a Multus interface from a VM safely?
Correct Answer:
See the Explanation.
Explanation:
1. Stop VM: virtctl stop <vm>
2. Edit VM spec to remove the multus network and bridge interface.
3. Apply change: oc apply -f vm.yaml
4. Start VM: virtctl start <vm>
5. Confirm with ip a that interface is removed.
Explanation:
1. Stop VM: virtctl stop <vm>
2. Edit VM spec to remove the multus network and bridge interface.
3. Apply change: oc apply -f vm.yaml
4. Start VM: virtctl start <vm>
5. Confirm with ip a that interface is removed.
How do you enable maintenance mode for a node using the NodeMaintenance CR?
Correct Answer:
See the Explanation.
Explanation:
1. Create a YAML:
apiVersion: nodemaintenance.kubevirt.io/v1
kind: NodeMaintenance
metadata:
name: maintenance-worker-1
spec:
nodeName: worker-1
2. Apply: oc apply -f node-maintenance.yaml
3. Monitor: oc get nodemaintenance
4. VMs should auto-migrate off the node.
5. Node is now in maintenance mode.
Explanation:
1. Create a YAML:
apiVersion: nodemaintenance.kubevirt.io/v1
kind: NodeMaintenance
metadata:
name: maintenance-worker-1
spec:
nodeName: worker-1
2. Apply: oc apply -f node-maintenance.yaml
3. Monitor: oc get nodemaintenance
4. VMs should auto-migrate off the node.
5. Node is now in maintenance mode.
How do you stop a running service (e.g., firewalld) inside the VM?
Correct Answer:
See the Explanation.
Explanation:
1. Enter the VM via virtctl console or SSH.
2. Run:
sudo systemctl stop firewalld
3. Verify:
systemctl is-active firewalld
4. Should return inactive or dead.
5. Confirms successful stop.
Explanation:
1. Enter the VM via virtctl console or SSH.
2. Run:
sudo systemctl stop firewalld
3. Verify:
systemctl is-active firewalld
4. Should return inactive or dead.
5. Confirms successful stop.
How do you instantiate a VM from a preconfigured template using the web console?
Correct Answer:
See the Explanation.
Explanation:
1. Navigate to Virtualization Templates.
2. Select a template (e.g., Fedora, RHEL8).
3. Click Create VM Fill in VM name, resources, disks, networks.
4. Configure cloud-init if needed.
5. Click Create and start virtual machine.
Explanation:
1. Navigate to Virtualization Templates.
2. Select a template (e.g., Fedora, RHEL8).
3. Click Create VM Fill in VM name, resources, disks, networks.
4. Configure cloud-init if needed.
5. Click Create and start virtual machine.
How do you create a snapshot of a stopped VM?
Correct Answer:
See the Explanation.
Explanation:
1. Stop the VM: virtctl stop test-vm
2. Create the VirtualMachineSnapshot resource (same YAML as Q2).
3. Wait for snapshot completion: oc get vmsnapshot -w
4. Once done, you can restart the VM.
5. Offline snapshots are faster and more consistent.
Explanation:
1. Stop the VM: virtctl stop test-vm
2. Create the VirtualMachineSnapshot resource (same YAML as Q2).
3. Wait for snapshot completion: oc get vmsnapshot -w
4. Once done, you can restart the VM.
5. Offline snapshots are faster and more consistent.
How do you clone a block-mode disk from one VM to another?
Correct Answer:
See the Explanation.
Explanation:
1. Ensure volumeMode: Block in PVC.
2. Use DataVolume clone source with volumeMode: Block:
pvc:
volumeMode: Block
...
3. Use same storage class with block support.
4. Attach to VM with lun or disk bus type.
5. Verify block device inside VM with lsblk.
Explanation:
1. Ensure volumeMode: Block in PVC.
2. Use DataVolume clone source with volumeMode: Block:
pvc:
volumeMode: Block
...
3. Use same storage class with block support.
4. Attach to VM with lun or disk bus type.
5. Verify block device inside VM with lsblk.