Soru

Zorluk: OrtaConfigure Azure Container Instances (ACI)

An administrator is configuring a container group in Azure Container Instances (ACI) to execute a scheduled database maintenance script. The script runs for approximately 10 minutes and then terminates. If the script exits with a non-zero code, it must attempt to run again. If it exits with code 0, the container group must release its compute resources. Which setting should the administrator configure to achieve this behavior?

  1. A
    Restart policy set to Always
  2. Restart policy set to OnFailureCevap
  3. C
    Restart policy set to Never
  4. D
    Restart policy set to OnError

Cevap

Restart policy set to OnFailure
The correct configuration is setting the restart policy to OnFailure. In Azure Container Instances (ACI), the OnFailure policy ensures that the containers in the container group are restarted only when the application process fails (returns a non-zero exit code). If the process succeeds (returns exit code 0), the containers stop and transition to a Terminated state, ensuring that billing stops and compute resources are released.

Adım Adım Çözüm

1
Analyze the execution requirements for the container group.
The script runs to completion (10 minutes), requires a retry upon failure (non-zero exit code), and must release compute resources upon success (exit code 0).
This establishes the behavioral criteria needed to evaluate and select the correct configuration.
2
Evaluate the supported restart policies in Azure Container Instances.
ACI supports three restart policies: Always (restarts container on any exit), Never (never restarts container), and OnFailure (restarts container only on non-zero exit).
This identifies valid configuration options and eliminates invalid settings.
3
Select the policy that matches the required restart behavior.
The OnFailure policy satisfies the requirements by retrying only when failures occur and stopping the container to save costs upon successful completion.
Choosing this policy directly aligns with the defined operational and cost-efficiency needs.

Anahtar Kavram

Azure Container Instances (ACI) Restart Policies
Bu soruyu puanla