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

Use the Smartstate Snapshot Name Built by the Provider #44

Merged

Conversation

jerryk55
Copy link
Member

@jerryk55 jerryk55 commented Nov 2, 2017

Since there is an 80 character limit on the length of the snapshot name
constructed for managed disks use the name set by the Azure provider.

This is one of two PRs required to fix https://bugzilla.redhat.com/show_bug.cgi?id=1508577.
The other will be against the Azure provider repo.

This change is required upstream, for Fine, and for Gaprindashvili. Once this gem is
pushed out the Gemfile for the Azure provider will be updated in all three places.

@roliveri @hsong-rh please review and merge. This PR should be merged asap since the
The Azure Provider PR is ManageIQ/manageiq-providers-azure#157.
has already been merged.

Since there is an 80 character limit on the length of the snapshot name
constructed for managed disks use the name set by the Azure provider.
If there is no name passed in the provider is using the previous code
that built the name known here and use that name instead.
if args[:snapshot]
@disk_name = args[:snapshot]
else
@disk_name = os_disk.name + "__EVM__SSA__SNAPSHOT"
Copy link
Member

Choose a reason for hiding this comment

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

@jerryk55 Under what conditions will we enter this else block? I don't understand when this code will be paired with older provider code.

If we can enter this else block, isn't it the same problem we had in the first place?

Copy link
Member Author

Choose a reason for hiding this comment

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

@roliveri I was concerned that there could be a situation where the old provider code was running with the new Smartstate gem and if so then the name of the snapshot would need to be the same as it was previous to this update. (more on that below)

If we enter this block and the old name is being used, then yes we have an issue if the name is too long - but only if the name is too long - and then we are no worse off than we were before.

If we aren't passing in the name of the snapshot as an argument then the provider already snapshotted the disk using the old name - if we don't use that name then any attempt at running SSA here will fail. If we do use the old name then it will only fail if it is too long.

The above all being said, now that the provider PR has been merged before this PR, this line of execution is actually moot and can probably be removed. I'll take it out....

Instead of allowing an old style name to be used in the case of a gem mismatch
between the Azure provider and this Gem, raise an exception if the required
snapshot argument has not been passed into this code.
@jerryk55
Copy link
Member Author

jerryk55 commented Nov 6, 2017

@roliveri the code to allow the old-style snapshot name has been removed and it will not be an exception if the snapshot name is not passed in as an argument.

@miq-bot
Copy link
Member

miq-bot commented Nov 6, 2017

Checked commits jerryk55/manageiq-smartstate@b7758d8~...ce1dc48 with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 0 offenses detected
Everything looks fine. 🍪

@roliveri roliveri added the bug label Nov 6, 2017
@roliveri roliveri merged commit 02ebbc2 into ManageIQ:master Nov 6, 2017
@simaishi
Copy link
Contributor

@jerryk55 I assume this should be fine/yes as ManageIQ/manageiq-providers-azure#157 is fine/yes?

@jerryk55
Copy link
Member Author

@simaishi yes except that this gem can't be fine/yes since its a gem that gets published.

@simaishi
Copy link
Contributor

simaishi commented Nov 14, 2017

@jerryk55 Please still mark as fine/yes as I know to backport to manageiq-gems-pending. Without the label, I won't know that PR needs to be backported.

@jerryk55
Copy link
Member Author

@miq-bot add_label fine/yes

@jerryk55
Copy link
Member Author

@miq-bot add_label gaprindashvili/yes

@miq-bot
Copy link
Member

miq-bot commented Nov 14, 2017

@jerryk55 Cannot apply the following label because they are not recognized: gaprindashvili/yes

@jerryk55
Copy link
Member Author

@simaishi it let me apply fine/yes but not gaprindashvili/yes

@simaishi
Copy link
Contributor

Gaprindashvili uses the released gem, so backport of this PR is needed only to Fine branch. The PR that bumps manageiq-smartstate gem version needs to be marked as gaprindashvili/yes instead.

@simaishi
Copy link
Contributor

Fine backport (to manageiq-gems-pending repo) details:

$ git log -1
commit 9a76effbec67c302b852917251594237c4b3ad25
Author: Richard Oliveri <oliveri.richard.github@gmail.com>
Date:   Mon Nov 6 11:45:14 2017 -0500

    Merge pull request #44 from jerryk55/diskname_longer_than_60chars_fails_snap
    
    Use the Smartstate Snapshot Name Built by the Provider
    (cherry picked from commit 02ebbc23a57ef8283c113199847cf4092c66466a)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1512967

@simaishi
Copy link
Contributor

@miq-bot add_label fine/backported

@simaishi
Copy link
Contributor

@miq-bot remove_label fine/yes

@miq-bot miq-bot removed the fine/yes label Nov 14, 2017
jerryk55 added a commit to jerryk55/manageiq-providers-azure that referenced this pull request Nov 14, 2017
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.

4 participants