VK Cloud logo

ivkcs_compute_instance_reboot resource

The argument of the ivkcs_compute_instance_reboot resource is given in table 1.

Table 1 — Argument of the ivkcs_compute_instance_reboot resource

Name

Description

Format

Required

Resource recreation upon value change

instance

ID of the host that will be rebooted.

The ID is computed by the resource that creates the host (the vkcs_compute_instance resource of the VK CS provider)

string

ivkcs_compute_instance_reboot resource

ivkcs_compute_instance_reboot resource

If the reboot occurs immediately after creating a VM, use a pause between creation and reboot. The pause will ensure that all processes occurring during VM creation are completed.

Example of the `ivkcs_compute_instance_reboot` resource with a pause
# Creating a pauseresource "time_sleep" "before_reboot" {  create_duration = "30s"  depends_on = [    # Dependency on VM creation and disk attachment    vkcs_compute_instance.compute,    vkcs_compute_volume_attach.attached,  ]}# VM rebootresource "ivkcs_compute_instance_reboot" "reboot" {  instance = vkcs_compute_instance.compute.id  depends_on = [    # Dependency on the pause    time_sleep.before_reboot,  ]}# Running scriptsresource "ivkcs_agent_exec" "start" {  …  depends_on = [    # Dependency on VM reboot    ivkcs_compute_instance_reboot.reboot,  ]  …}
Was this article helpful?