RedHat Red Hat Certified Specialist in OpenShift Virtualization - EX316 模擬練習
How do you make sure that a VM disk is encrypted at rest?
正解:
See the Explanation.
Explanation:
1. Use a storage class that supports encryption (e.g., Ceph or CSI driver).
2. Confirm with:
oc get sc <sc-name> -o yaml | grep encryption
3. Ensure PVC uses that class.
4. Use CSI secrets if required.
5. Validate with provider documentation.
Explanation:
1. Use a storage class that supports encryption (e.g., Ceph or CSI driver).
2. Confirm with:
oc get sc <sc-name> -o yaml | grep encryption
3. Ensure PVC uses that class.
4. Use CSI secrets if required.
5. Validate with provider documentation.
How do you define a secondary physical NIC on a node using NMState?
正解:
See the Explanation.
Explanation:
1. Create a NodeNetworkConfigurationPolicy YAML:
apiVersion: nmstate.io/v1
kind: NodeNetworkConfigurationPolicy
metadata:
name: enable-second-nic
spec:
nodeSelector:
kubernetes.io/hostname: worker-0
desiredState:
interfaces:
- name: ens5
type: ethernet
state: up
2. Apply with oc apply -f
3. Check status: oc get nncp enable-second-nic -o yaml
4. Ensure Available: True
5. Confirm with oc debug node/worker-0 ip a
Explanation:
1. Create a NodeNetworkConfigurationPolicy YAML:
apiVersion: nmstate.io/v1
kind: NodeNetworkConfigurationPolicy
metadata:
name: enable-second-nic
spec:
nodeSelector:
kubernetes.io/hostname: worker-0
desiredState:
interfaces:
- name: ens5
type: ethernet
state: up
2. Apply with oc apply -f
3. Check status: oc get nncp enable-second-nic -o yaml
4. Ensure Available: True
5. Confirm with oc debug node/worker-0 ip a
How do you migrate multiple VMs in a rolling fashion?
正解:
See the Explanation.
Explanation:
1. List target VMs: oc get vm
2. For each VM:
virtctl migrate <vm-name>
3. Wait for migration to finish before
next: oc get vmim -w
4. Use scripting/Ansible for automation.
5. Best for reducing downtime during maintenance.
Explanation:
1. List target VMs: oc get vm
2. For each VM:
virtctl migrate <vm-name>
3. Wait for migration to finish before
next: oc get vmim -w
4. Use scripting/Ansible for automation.
5. Best for reducing downtime during maintenance.
How do you simulate high availability with two VMs using anti-affinity?
正解:
See the Explanation.
Explanation:
1. Label both VMs
with: oc label vm vm-
ha app=ha
2. Use anti-affinity in each VM YAML.
3. Start both VMs.
4. They should run on separate nodes.
5. Test node failure to observe continuity.
Explanation:
1. Label both VMs
with: oc label vm vm-
ha app=ha
2. Use anti-affinity in each VM YAML.
3. Start both VMs.
4. They should run on separate nodes.
5. Test node failure to observe continuity.
How do you verify that OpenShift Container Platform (OCP) is ready to support OpenShift Virtualization deployment?
正解:
See the Explanation.
Explanation:
1. Log in as a cluster admin: oc login -u kubeadmin -p <password> --server=https://<api-server-url>
2. Confirm that the cluster is healthy: oc get clusterversion
3. Check if necessary operators are available: oc get csv -n openshift-operators
4. Ensure storage class is present: oc get sc
5. Validate that at least one compute node has virtualization capabilities: oc describe node | grep
-i vmx\|svm
Explanation:
1. Log in as a cluster admin: oc login -u kubeadmin -p <password> --server=https://<api-server-url>
2. Confirm that the cluster is healthy: oc get clusterversion
3. Check if necessary operators are available: oc get csv -n openshift-operators
4. Ensure storage class is present: oc get sc
5. Validate that at least one compute node has virtualization capabilities: oc describe node | grep
-i vmx\|svm
How do you isolate external traffic from internal OpenShift SDN traffic?
正解:
See the Explanation.
Explanation:
1. Use dual-homed VMs (pod + Multus).
2. Set routing in VM so only internet traffic goes via Multus.
3. All cluster services use pod interface (eth0).
4. Avoid SDN congestion by separating paths.
5. Validate with traceroute from VM.
Explanation:
1. Use dual-homed VMs (pod + Multus).
2. Set routing in VM so only internet traffic goes via Multus.
3. All cluster services use pod interface (eth0).
4. Avoid SDN congestion by separating paths.
5. Validate with traceroute from VM.
How do you create a ClusterIP service for a running VM using the default interface?
正解:
See the Explanation.
Explanation:
1. Create a Service YAML:
apiVersion: v1
kind: Service
metadata:
name: vm-service
namespace: default
spec:
selector:
kubevirt.io/domain: test-vm
ports:
- protocol: TCP
port: 22
targetPort: 22
type: ClusterIP
2. Apply it: oc apply -f vm-service.yaml
3. Verify with: oc get svc vm-service
4. Use ping vm-service or SSH from another pod.
Explanation:
1. Create a Service YAML:
apiVersion: v1
kind: Service
metadata:
name: vm-service
namespace: default
spec:
selector:
kubevirt.io/domain: test-vm
ports:
- protocol: TCP
port: 22
targetPort: 22
type: ClusterIP
2. Apply it: oc apply -f vm-service.yaml
3. Verify with: oc get svc vm-service
4. Use ping vm-service or SSH from another pod.
How do you confirm that the DataVolume cloning was successful?
正解:
See the Explanation.
Explanation:
1. Run: oc get dv cloned-disk -o yaml
2. Wait for status:
status.phase: Succeeded
3. Confirm PVC was created: oc get pvc
4. Verify volume content by attaching to a VM.
5. Check logs of the importer pod if it fails.
Explanation:
1. Run: oc get dv cloned-disk -o yaml
2. Wait for status:
status.phase: Succeeded
3. Confirm PVC was created: oc get pvc
4. Verify volume content by attaching to a VM.
5. Check logs of the importer pod if it fails.
How do you restore a VM to a different namespace?
正解:
See the Explanation.
Explanation:
1. Create restore:
velero restore create restore-newns --from-backup vm-backup --namespace-mappings
<oldns>:<newns>
2. Wait for restore to complete.
3. Check resources in <newns> namespace.
4. Start the VM if not running.
5. Useful for DR scenarios.
Explanation:
1. Create restore:
velero restore create restore-newns --from-backup vm-backup --namespace-mappings
<oldns>:<newns>
2. Wait for restore to complete.
3. Check resources in <newns> namespace.
4. Start the VM if not running.
5. Useful for DR scenarios.
How do you verify that a Multus interface is active inside the VM?
正解:
See the Explanation.
Explanation:
1. Access VM: virtctl console <vm-name>
2. Use ip a to list interfaces.
3. Confirm that both eth0 (SDN) and eth1 (Multus) are present.
4. Run ping <gateway-ip> to test connectivity.
5. Run ethtool <interface> to confirm link.
Explanation:
1. Access VM: virtctl console <vm-name>
2. Use ip a to list interfaces.
3. Confirm that both eth0 (SDN) and eth1 (Multus) are present.
4. Run ping <gateway-ip> to test connectivity.
5. Run ethtool <interface> to confirm link.
How do you allow a VM to survive temporary node unavailability with RerunOnFailure?
正解:
See the Explanation.
Explanation:
1. Set run strategy:
spec:
runStrategy: RerunOnFailure
2. VM will auto-restart if node crashes or is evicted.
3. Works without manual intervention.
4. Useful for single-node clusters.
5. Confirm with oc get vm
Explanation:
1. Set run strategy:
spec:
runStrategy: RerunOnFailure
2. VM will auto-restart if node crashes or is evicted.
3. Works without manual intervention.
4. Useful for single-node clusters.
5. Confirm with oc get vm
How do you edit an existing VM's CPU and memory configuration?
正解:
See the Explanation.
Explanation:
1. Web UI: Open the VM Actions Edit VM Resources Update CPU/Memory.
2. CLI: oc edit vm test-vm
3. Modify:
resources:
requests:
memory: 2Gi
limits:
memory: 2Gi
4. Save changes.
5. Restart the VM if it's running for changes to apply.
Explanation:
1. Web UI: Open the VM Actions Edit VM Resources Update CPU/Memory.
2. CLI: oc edit vm test-vm
3. Modify:
resources:
requests:
memory: 2Gi
limits:
memory: 2Gi
4. Save changes.
5. Restart the VM if it's running for changes to apply.