-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Removes unnecessary validations #4283
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
Removes unnecessary validations #4283
Conversation
|
@blueorangutan package |
|
@RodrigoDLopez a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos7 ✔centos8 ✔debian. JID-1814 |
shwstppr
left a comment
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.
@RodrigoDLopez this removes tags checking altogether? This will allow migrating volumes to storages which are not even suitable wrt tags?
Exactly that. This was discussed and developed within a series of PRs I created some time ago, and it was broken while merging forward. Therefore, @RodrigoDLopez is fixing part of the broken code with this PR. These are the following PRs that were used to deliver this feature:
The implementation was broken down into several different PRs to easy development and testing. Moreover, the feature was already discussed, approved, and merged a long time ago and there are already people using it. What @RodrigoDLopez is doing is just fixing this feature that was broken during a merge forward from 4.11 that was executed on 4.12. |
|
@rafaelweingartner what branch should this go on (since it was broken in 4.12 you say) |
|
Hi @DaanHoogland |
shwstppr
left a comment
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.
@DaanHoogland maybe we need to do some manual testing here. My concern is this puts too much responsibility on the operator if we are skipping tag matching. I would suggest adding a new parameter in migrateVolume API (forced or something) which would bypass the matching tags.
Method preStorageMigrationStateCheck also changes VM state to Migrating and without it that might break.
Bypassing tag matching for volumes will need changes at other places as well such as in the flow of migrateVirtualMachineWithVolume API. In that API whole migration at times depend on suitable storage pools for the volume. Will we change that behaviour as well in future?
cc @RodrigoDLopez @rafaelweingartner @rhtyd
|
@shwstppr to me it is very simple. It is a feature to provide flexibility and power to operators. It was already discussed with the community, accepted, merged, and released to people. Moreover, there are CloudStack deployments that take advantage of that. Operators must be responsible and aware of the actions they take. Therefore, ACS must fix it (which is what @RodrigoDLopez is doing). If we want to remove this feature, we need a new discussion, and this will break API compatibility @DaanHoogland I do not have any preference on what version this fix must go in. However, I see it as I explained. It is a feature that was proposed, discussed, and accepted. People use it. And therefore, we should maintain it as designed and sold to the community and documented. |
engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java
Show resolved
Hide resolved
|
@sureshanaparti @shwstppr @rhtyd can we merge? Or do you want to re-start the discussion? |
|
@rhtyd, @DaanHoogland, @PaulAngus, @shwstppr Hello guys, happy new year. Is there something missing here? Everything seems to be ok with the patch. it has no errors, and tests are passing. |
|
|
@PaulAngus it is not that complicated. @RodrigoDLopez is not introducing a feature, but rather fixing a bug. The feature was introduced via #2636. It was first released on ACS 4.12. If you check the title of the PR that introduced it "Fix limitation on tag matching in 'migrateVolume' with disk offering replacement", and its code, you will see that there is a mechanism to normalize/update the disk offering in the DB to match the target storage. You can even check this option in the API documentation (https://cloudstack.apache.org/api/apidocs-4.14/apis/migrateVolume.html). The feature was introduced to allow operators to have means to move the volume around, even if the tags do not match. This allows tasks such as troubleshooting performance problems, or validating if a storage tier upgrade would improve application performance. There was a series of PRs that I created to address these needs two years ago or so. They all have been reviewed, approved and merged, and were released. However, it happens to be that this feature was broken at some point in time, and @RodrigoDLopez is fixing this. Also, there was an e-mail today stating "[ANNOUNCE] master and 4.15 branches open for merge". Therefore, we expected that to be open for everybody, especially for a bug fix such as this one, that was not even raised as a blocker. We know people using this feature, which required some internal patching to make it work on 4.13 for instance. |
GabrielBrascher
left a comment
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.
Both code and feature are good, API documentation also describes behavior that matches with this PR fix proposal.
LGTM based on code review.
Side-note: this fixes a regression bug, as we can see on the presented commit history. Should this PR also be marked as blocker and added in time for RC4?
|
thank you I didn't see the email this morning. I still disagree with the premise; and having the facility to change the disk offering at the same time gives no guarantee that the disk offering and the new storage placement will match. I cannot see how an API that has the ability to break the integrity of the database is justifiable. |
|
Please, check the code, and the cited PRs, you can check there in the PR I created there is a method called
|
|
@rafaelweingartner I can't speak for anyone else, but my objection is the perpetuation of the database integrity issue. I only comment now because I wasn't pinged on the other PRs, I was on this one. If I'd seen this before, I would have objected before. Also, there is no double jeopardy, there is nothing to stop any piece of code being revisited at a later date. |
|
@PaulAngus I disagree. Your concern is only valid if (and only if) the operator is careless, which they should not be. This API is only available (should only be) to root admin. If we revise this piece of code, we break API compatibility, which has already been broken as a matter of fact. Right now, it is considered as a bug, but if you want to remove this feature, then this has many other implications such as versioning. |
|
One alternative would then be to forbid the override placement. And then, we allow changing the target storage pool, as long as the new disk offering matches it (or the current disk offering, if there is no new disk offering). What do you think? Then, the DB would always be consistent with the storage where the volume resides. |
|
There are many ways an admin can wreck their environment which are out of our control. This is within our control. And i don't believe there is another API that allows the database to be corrupted in this way. Thats my objection. IMO these checks are not unnecessary, but vital. I haven't -1'd this. |
|
just one thing needs to be clear, it does not corrupt the DB. The volume table shows the correct storage pool. The only thing is that this storage pool might not have have tags of the volume's disk offering (in case of disk placement override by the operator). However, this can be fixed if the operator uses the parameter No DB will ever be corrupted by this feature. There is only the possibility to apply some override in case of an emergency or some necessity by the operator. Nothing will break! Tags on pools and volume are merely logical constraints applied by ACS, and nothing more. |
|
Unless I've read the thread incorrectly (and I hope that I have): The aim of the feature is to allow an admin to move a volume from storage pool A (with tag A) to storage pool B (with tag B), despite the fact that the volume's disk offering tag (A) doesn't match the destination tag (B). If this is done, then the DB says that the volume should be in a pool with tag A when it's actually on storage with tag B. If I've understood this correctly, then... This could be fixed by making it mandatory to supply a 'correct' new disk offering if the migration would otherwise be blocked by the tag mismatch. The disk offering change should only be made upon successful migration. |
|
@PaulAngus it is your opinion. In my opinion, if the root wants to do a disk placement override, she/he should be able to do so. That is how it was presented for the community, when this feature was first introduced via #2425, then we had a series of other patches to improve this feature, one of the PRs introduced the new option in the API to update the DB (#2486), if the root admin wants to make a permanent change. The feature was presented to the community as a method to empower/enable root admins to do disk placement override in their daily tasks. Then, to normalize this situation, the root admin can use the option to replace the disk offering. I really see no harm in this API. |
|
@rhtyd @shwstppr @sureshanaparti @PaulAngus Hello to everyone, can I have more reviews/tests here? |
|
@RodrigoDLopez I understand this could be a use-case for operators as explained in previous comments but I cannot agree to it in its current form due to the reasons highlighted in Paul's comment. Also, completely doing away tag matching for a particular use-case is not appropriate in my opinion. If this is done on one hand we will have migrateVirtualMachineWithVolumes API which depends on storage tag matching for finding suitable storage pools for volume (when pools for a volume is not passed by the user) and on the other migrateVirtualMachine API which completely ignores storage tags |
|
for vms, we use "cmk find hostsformigration" to list all hosts, it also mentions if the hosts are suitable or not for migration. for volumes, it looks like "find storagepoolsformigration" also mark storage pools with unmatched tag as "unsuitable". @rafaelweingartner @RodrigoDLopez could you please confirm it ? |
@weizhouapache Exactly! Moreover, even though the override is a possibility, if the operator defines the "newDiskOffering" option, the tags are checked (tags of the new target storage pool with the new disk offering being set). The only situation that the tags are not checked is during a disk placement override that operators might execute in case of emergency or maybe for testing purposes. |
|
@RodrigoDLopez can you please resolve the conflicts? |
|
The way I see there is no risk. The migration command is clear about overriding offerings.
NOTE: I would like to stress how important it is to allow migrating volumes between storage pools as well as overriding disk offerings. We have some annoying issues in production due to such restrictions. For now, we have to manually run MySQL queries any time that such a migration operation is necessary; thus, betting that there will be no human mistakes compromising the DB consistency. |
…ing_virtual_machine
Thanks for the review. |
|
I don’t know anything about another version of your idea, no one has pinged me to comment on it. I would be sad if the author of the other version hadn’t pinged you for your comments.
Certainly nothing should be merged without tests. If there aren’t tests you should bring it up with whoever merged it and if you get no joy there, the community.
Kind Regards
Paul Angus
From: Rodrigo D. Lopez ***@***.***>
Sent: Friday, June 11, 2021 2:39 PM
To: apache/cloudstack ***@***.***>
Cc: Paul Angus ***@***.***>; Mention ***@***.***>
Subject: Re: [apache/cloudstack] Removes unnecessary validations (#4283)
@PaulAngus<https://github.com/PaulAngus> @shwstppr<https://github.com/shwstppr>
This one is not needed anymore.
Those that made trouble to merge this, has merged another branch that do exactly the same result.
Many thanks to you all, prevents mine ideas to go through. but implements those ideas in another way and merge it without testes. you rock
@weizhouapache<https://github.com/weizhouapache> @rafaelweingartner<https://github.com/rafaelweingartner> @GabrielBrascher<https://github.com/GabrielBrascher>
thanks for the review
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#4283 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABEWL3DS5YIZWSNORY7PMFTTSIGV7ANCNFSM4QJS6M7Q>.
|
Description
On PR#2848 the author added the method
preStorageMigrationStateCheckthat will check tags when the operator runsmigrateVirtualMachinecommand. We do not need this kind of check, because when running migrations, the operator must have the ability to migrate volumes to the destination pool, and assuming the risk/responsibilities of migrations to different QoS primary storage systems as proposed and implemented in Fix limitation on tag matching in 'migrateVolume' with disk offering replacementTherefore, this PR removes the unnecessary method and permits the operator to run migrate commands without any kind of tags check, as it should be.
Types of changes
Screenshots (if appropriate):
How Has This Been Tested?
To test this, I used the
cloudmonkeyto runmigrateVirtualMachinecommand