Bug 1572640
| Summary: | vdo create --force overwrites existing vdo using same device | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Joe Shimkus <jshimkus> |
| Component: | vdo | Assignee: | Joe Shimkus <jshimkus> |
| Status: | CLOSED ERRATA | QA Contact: | Jakub Krysl <jkrysl> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.6 | CC: | awalsh, bgurney, jkrysl, jshimkus, limershe, tbzatek |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | 6.1.1.115 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-10-30 09:39:31 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Joe Shimkus
2018-04-27 13:35:01 UTC
I always though '--force' is a flag to say: "I know what I am doing, let me shot myself". Even manpage says VDO should overwrite existing formatted VDO volume with '--force'. create Creates a VDO volume and its associated index and makes it available. If --activate=disabled is specified the VDO volume is created but not made available. Will not overwrite an existing file system or formatted VDO volume unless --force is given. What happens if you create a VDO, remove the disk, remove the VDO with --force, reattach the disk and try to create a new VDO on it? There would still be all VDO data and '--force' will not work with this change, so user will have to use stuff like dd. Is my assumption correct here? If --force is interpreted as "let me shot[sic] myself" then there's a bug in vdo manager in not removing the existing configuration referencing the device, unless we agree that is acceptable as part of shooting oneself; which I think is incorrect. As to the question related to removing the disk, etc. that will successfully work with --force. It's the presence of an existing entry in the config file referencing the device that overrides the effect of --force. If there is no referencing entry, --force would act to allow the reuse of the device. P.S. This issue gives more support to getting rid of the config file (or, until such time, making it non-specifiable) to avoid the cross-config file scenario of this issue. # vdo create --name vdo --device /dev/sdb Creating VDO vdo Starting VDO vdo Starting compression on VDO vdo VDO instance 0 volume is ready at /dev/mapper/vdo # vdo create --name vdo --device /dev/sdb --verbose Creating VDO vdo vdo: ERROR - VDO volume vdo already exists # vdo create --name vdo2 --device /dev/sdb --verbose Creating VDO vdo2 vdo: ERROR - Device /dev/sdb already configured for VDO use # vdo create --name vdo2 --device /dev/sdb --verbose --force Creating VDO vdo2 vdo: ERROR - Device /dev/sdb already configured for VDO use So VDO no longer allows overwriting VDO device with another VDO using --force. But there is still sentence in vdo manpage that suggests it should be able to do it: 'Will not overwrite an existing filesystem or formatted VDO volume unless --force is given.' Can you please fix it in this BZ or should I create a new one? I don't see the need for a new BZ; it should have been addressed as part of this one. Send it back. Updated man page. Giving back as per discussion to more clearly state that using --force will not work if VDO is already running on the device (checked in /etc/vdoconf.yml) Alright...everyone's supposedly happy with the man page as just changed (at least in relation to this question :-)). It now specifies that for an 'in use' device (config file contains a vdo using the device) that even --force will not make us use it. man vdo: "If the specified device is already in use by a VDO volume (as determined from the configuration file) the create will always be rejected, even if --force is specified. If the device is not so in use but is formatted as a VDO volume or contains an existing file system the create will be rejected unless --force is given." # vdo create --name vdo --device /dev/sda Creating VDO vdo Starting VDO vdo Starting compression on VDO vdo VDO instance 1 volume is ready at /dev/mapper/vdo # vdo create --name vdo1 --device /dev/sda Creating VDO vdo1 vdo: ERROR - Device /dev/sda already configured for VDO use # vdo create --name vdo1 --device /dev/sda --force Creating VDO vdo1 vdo: ERROR - Device /dev/sda already configured for VDO use Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:3094 |