Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make timeout during waiting for uploadImage configurable #52

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

votdev
Copy link
Member

@votdev votdev commented Oct 2, 2024

Problem:
In VM Import Controller, the timeout after which the VM Import Controller fails (when waiting for uploadImage on OpenStack) is hard-coded to 300s or 5min (30 iterations of a 10s wait loop).

This should be configurable because the uploadImage OpenStack API Call can take several dozens of minutes if not hours sometimes.

Solution:
Add the fields UploadImageRetryCount and UploadImageRetryDelay to OpenstackSourceSpec.

Related Issue:
harvester/harvester#6675

Test plan:

  • Create a OpenstackSource. e.g. like this:
apiVersion: migration.harvesterhci.io/v1beta1
kind: OpenstackSource
metadata:
  name: foo
  namespace: default
spec:
  endpoint: "http://xxx.xxx.xxx.xxx/identity"
  region: "bar"
  credentials:
    name: foo-credentials
    namespace: default
  UploadImageRetryCount: 50
  uploadImageRetryDelay: 15
  • Trigger a VM import:
apiVersion: migration.harvesterhci.io/v1beta1
kind: VirtualMachineImport
metadata:
  name: cirros-tiny
  namespace: default
spec:
  virtualMachineName: "cirros-tiny"
  networkMapping:
  - sourceNetwork: "shared"
    destinationNetwork: "default/vlan1"
  sourceCluster:
    name: foo
    namespace: default
    kind: OpenstackSource
    apiVersion: migration.harvesterhci.io/v1beta1
  • The log output should look like this. Escpecially look out for msg="Waiting for volume to be available" ... retryCount=50 retryDelay=15.
time="2024-10-02T11:36:38Z" level=info msg="Running preflight checks ..." name=cirros-tiny namespace=default spec.virtualMachineName=cirros-tiny
time="2024-10-02T11:36:38Z" level=info msg="Importing client disk images ..." name=cirros-tiny namespace=default spec.virtualMachineName=cirros-tiny
time="2024-10-02T11:36:39Z" level=info msg="Powering off client VM ..." name=cirros-tiny namespace=default spec.virtualMachineName=cirros-tiny
time="2024-10-02T11:36:41Z" level=info msg="Importing client disk images ..." name=cirros-tiny namespace=default spec.virtualMachineName=cirros-tiny
time="2024-10-02T11:36:43Z" level=info msg="Importing client disk images ..." name=cirros-tiny namespace=default spec.virtualMachineName=cirros-tiny
time="2024-10-02T11:36:48Z" level=info msg="Waiting for volume to be available" name=cirros-tiny namespace=default retryCount=50 retryDelay=15 spec.virtualMachineName=cirros-tiny volume.createdAt="2024-10-02 11:36:48.687611 +0000 UTC" volume.id=fcf7e2da-bdd8-4c24-9ff3-7b8faff3554c volume.size=1 volume.snapshotID=56aa80a7-3c60-4812-ad49-144bf43a8ddf volume.status=creating

@votdev votdev self-assigned this Oct 2, 2024
@votdev votdev force-pushed the issue_6675_upload_img_retry branch from 1992c42 to 0a0b81a Compare October 2, 2024 10:55
@votdev votdev marked this pull request as ready for review October 2, 2024 11:37
@votdev votdev force-pushed the issue_6675_upload_img_retry branch from 0a0b81a to 5bf4080 Compare October 2, 2024 11:59
@votdev votdev force-pushed the issue_6675_upload_img_retry branch 2 times, most recently from a32b4ae to cea7cb7 Compare October 7, 2024 15:04
Copy link
Collaborator

@ibrokethecloud ibrokethecloud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. thanks for the PR. we should merge this after 1.4.0 is out

@votdev votdev force-pushed the issue_6675_upload_img_retry branch from cea7cb7 to de07e8f Compare October 9, 2024 09:54
Copy link
Member

@starbops starbops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, just one nit. Thank you.

pkg/apis/migration.harvesterhci.io/v1beta1/openstack.go Outdated Show resolved Hide resolved
Add the fields `UploadImageRetryCount` and `UploadImageRetryDelay` to `OpenstackSourceSpec`.

Related to: harvester/harvester#6675

Signed-off-by: Volker Theile <[email protected]>
@votdev votdev force-pushed the issue_6675_upload_img_retry branch from de07e8f to 9dd40c1 Compare October 16, 2024 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants