-
Notifications
You must be signed in to change notification settings - Fork 898
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
Add built in policy to prevent transformed VM from starting. #17389
Conversation
27bb242
to
38146e8
Compare
cc @agrare |
@lfu My concern here is that as a built-in method there is no option to work around this if the VM is migrated. The intention is to stop someone for accidentally starting a migrated VM which this PR does achieves, but there may be reasons to start the source VM. For example after a successfully migration you may find a need to delete the newly created VM and restart the old one, or you may want to restart the old VM as part of testing. This needs to discuss further before we can merge this change. It may have to change to be a manually applied policy or changed to use another check like a tag to override this logic. cc @bthurber |
38146e8
to
029a38c
Compare
app/models/vm.rb
Outdated
@@ -4,6 +4,7 @@ class Vm < VmOrTemplate | |||
has_one :container_deployment_node | |||
|
|||
virtual_has_one :supported_consoles, :class_name => "Hash" | |||
virtual_column :transformed, :type => :boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need to expose this method? Can't the policy be written to check for the tag directly?
db/fixtures/classifications.yml
Outdated
@@ -1070,3 +1070,20 @@ | |||
:parent_id: 0 | |||
:default: true | |||
:single_value: "0" | |||
- :description: V2V - Transformation Status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop the V2V
from the naming. The point of using Transformation
was to make it generic so it can be reused for other operations. P2V for example.
The existing "v2v" tags are specifically for v2v operations and will eventually be replaced with backend operations once we can properly support them with RHV inventory.
029a38c
to
1d28504
Compare
1d28504
to
4e3336b
Compare
4e3336b
to
7a46dd2
Compare
Checked commits lfu/manageiq@75b03cb~...7a46dd2 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Add built in policy to prevent transformed VM from starting. (cherry picked from commit 2252542) https://bugzilla.redhat.com/show_bug.cgi?id=1590430
Gaprindashvili backport details:
|
Includes ManageIQ/manageiq-content#324.
Includes ManageIQ/manageiq-automation_engine#186.
https://bugzilla.redhat.com/show_bug.cgi?id=1565199
@miq-bot assign @gmcculloug
@miq-bot add_label transformation, enhancement
cc @bzwei