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

Volume backup restore, delete. #15891

Merged
merged 2 commits into from
Aug 29, 2017

Conversation

alexander-demicev
Copy link

Add cloud volume backup delete and restore actions.

@alexander-demicev alexander-demicev force-pushed the cloud-volume-backup branch 2 times, most recently from 85a89d0 to b525ab3 Compare August 25, 2017 08:42
@alexander-demicev alexander-demicev changed the title Volume restore, delete. Volume backup restore, delete. Aug 25, 2017
@petrblaho
Copy link

Code looks good to me.


acts_as_miq_taggable

belongs_to :ext_management_system, :foreign_key => :ems_id, :class_name => "ExtManagementSystem"
belongs_to :availability_zone
belongs_to :cloud_volume
has_one :cloud_tenant, :through => :cloud_volume

def backup_restore_queue(userid, volumeid)
Copy link
Member

Choose a reason for hiding this comment

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

If this method is on CloudVolumeBackup then I think just restore_queue would be a better method, backup_restore_queue is redundant.

MiqTask.generic_action_with_callback(task_opts, queue_opts)
end

def delete_backup
Copy link
Member

Choose a reason for hiding this comment

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

Same

@agrare
Copy link
Member

agrare commented Aug 29, 2017

@alexander-demichev just some nits on the method names but looks good overall

@alexander-demicev
Copy link
Author

@agrare Thank you for review! Does it look better now?

Copy link
Member

@agrare agrare left a comment

Choose a reason for hiding this comment

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

Just a few more consistency changes then I'm 👍 with this

end

def restore(volume)
raw_backup_restore(volume)
Copy link
Member

@agrare agrare Aug 29, 2017

Choose a reason for hiding this comment

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

Can you change this to raw_restore?

end

def delete
raw_delete_backup
Copy link
Member

Choose a reason for hiding this comment

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

raw_delete

raw_delete_backup
end

def raw_delete_backup
Copy link
Member

Choose a reason for hiding this comment

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

raw_delete

- :name: Restore Backup
:description: Restore Backup to Volume
:feature_type: control
:identifier: cloud_volume_backup_restore_to_volume
Copy link
Member

Choose a reason for hiding this comment

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

How about cloud_volume_backup_restore?

Copy link
Author

@alexander-demicev alexander-demicev Aug 29, 2017

Choose a reason for hiding this comment

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

@agrare identifiers should be unique and cloud_volume_backup_restore is already there

Copy link
Member

Choose a reason for hiding this comment

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

Ah okay 👍

Copy link
Member

Choose a reason for hiding this comment

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

Hm is that feature used anywhere? It sounds like exactly what this does just defined on CloudVolume but I don't see any restore methods on CloudVolume

Copy link
Author

Choose a reason for hiding this comment

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

@agrare if you mean cloud_volume_backup_restore_to_volume, then it`s used here ManageIQ/manageiq-ui-classic#2037

Copy link
Author

Choose a reason for hiding this comment

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

Probably, I need a better name for this feature.

Copy link
Member

Choose a reason for hiding this comment

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

@alexander-demichev actually I was wondering if cloud_volume_backup_restore could be removed from CloudVolume and moved here?

Copy link
Author

@alexander-demicev alexander-demicev Aug 29, 2017

Choose a reason for hiding this comment

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

@agrare It`s used here

Copy link
Member

Choose a reason for hiding this comment

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

Alright maybe we can refactor this later to use this instead?

@miq-bot
Copy link
Member

miq-bot commented Aug 29, 2017

Checked commits alexander-demicev/manageiq@6ebb1ee~...f8b8535 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 0 offenses detected
Everything looks fine. 🍪

Copy link
Member

@agrare agrare left a comment

Choose a reason for hiding this comment

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

I'm good with this, I think we should move usage of CloudVolume.restore(backup_id) to this in the future

@agrare agrare merged commit 68cb56e into ManageIQ:master Aug 29, 2017
@agrare agrare added this to the Sprint 68 Ending Sep 4, 2017 milestone Aug 29, 2017
@alexander-demicev
Copy link
Author

@agrare Thank you!

@h-kataria
Copy link
Contributor

@agrare @alexander-demichev @tzumainn is there a pivotal story for this work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants