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

Implement "oneimage migrate" #6152

Closed
3 tasks
OpenNebulaSupport opened this issue Mar 6, 2023 · 1 comment
Closed
3 tasks

Implement "oneimage migrate" #6152

OpenNebulaSupport opened this issue Mar 6, 2023 · 1 comment
Assignees

Comments

@OpenNebulaSupport
Copy link
Collaborator

Description
Currently oneimage command can clone an image to a different image datastore but that image will have a different ID. The migrate command would keep the image ID moved to a different image datastore. In that case there is the following situation that can lead to problems:

  1. A new image datastore is being added and the old one has to be deleted
  2. The images are cloned in the new datastore, the old one is deleted
    In this moment
  3. VMs that rely on any image on the old datastore images can't be recreated easily (the image that was used to created them does not exist, they don't know about the clone on the new datastore)
  4. The database reflects that the images on the old datastore are still being in use by those VMs

The command may also have to update:

  • /VM/TEMPLATE/DISK/{DATASTORE,DATASTORE_ID,IMAGE,IMAGE_ID,SOURCE} on the VMs running that depend on the migrated image
  • /VMTEMPLATE/TEMPLATE/DISK/{DATASTORE,DATASTORE_ID,SOURCE} on the templates that depend on the migrated image

Use case
The use case for the command would be

oneimage migrate IMAGE_ID --datastore DATASTORE_ID

It should:

  1. Check if IMAGE_ID and DATASTORE_ID exist and if DATASTORE_ID is an image datastore
  2. Move IMAGE_ID to DATASTORE_ID keeping its IMAGE_ID and name (IMAGE field)
  3. Update the fields /IMAGE/{SOURCE,PATH,DATASTORE,DATASTORE_ID} of the image
  4. For all the templates that use IMAGE_ID: update the fields /VMTEMPLATE/TEMPLATE/DISK/{DATASTORE,DATASTORE_ID,SOURCE}
  5. For all the VMs that depend on IMAGE_ID: update the fields /VM/TEMPLATE/DISK/{DATASTORE,DATASTORE_ID,SOURCE}

After that, the /IMAGE/VMS field of the image should be consistent, and the templates and the vms too

Interface Changes
It may be relevant to have a way to migrate image from the interfaces, but it's out the original scope of the problem

Additional Context
It may be possible that the image source and datastore must be updated somewhere else

Progress Status

  • Code committed
  • Testing - QA
  • Documentation (Release notes - resolved issues, compatibility, known issues)
@brodriguez-opennebula
Copy link
Contributor

Duplicate of #3243

@brodriguez-opennebula brodriguez-opennebula marked this as a duplicate of #3243 Mar 6, 2023
@ONdboca ONdboca self-assigned this Mar 6, 2023
@dann1 dann1 closed this as completed Mar 7, 2023
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

No branches or pull requests

4 participants