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
osddaemon: run vgchange -ay during init #3771
Conversation
pkg/daemon/ceph/osd/daemon.go
Outdated
} | ||
|
||
// Activate all VGs on the server | ||
context.Executor.ExecuteCommand(false, "", "/sbin/vgchange", "-ay") |
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.
I think we should consider using just vgchange
and letting exec.Cmd
search the PATH
for where vgchange
actually lives so we can support environments where this might be a different path.
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.
Will implement to search through PATH
, though to note this will be executed inside the Rook Ceph container image used in the OSD init container.
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.
That is [probably] not necessary. If ExecuteCommand
uses exec.Cmd
, then Go will automatically search PATH
. https://godoc.org/os/exec#LookPath
pkg/daemon/ceph/osd/daemon.go
Outdated
@@ -55,10 +55,11 @@ func StartOSD(context *clusterd.Context, osdType, osdID, osdUUID string, pvcBack | |||
} | |||
|
|||
context.Executor.ExecuteCommand(false, "", "/sbin/vgchange", "-an") | |||
|
|||
context.Executor.ExecuteCommand(false, "", "/sbin/vgchange", "-ay") |
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.
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.
The vgname related change is part of this PR - #3779
pkg/daemon/ceph/osd/daemon.go
Outdated
} | ||
|
||
// Activate all VGs on the server |
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.
Let's add this in an else
statement, related to the change coming in #3755
@galexrt Related changes may have already covered the fix? Or is there something else after the rebase? |
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.
Is this change still relevant?
c347db7
to
f03e7af
Compare
Yes, this PR is still relevant as the VGs are only activated when the OSDs are backed by PVCs, see rook/pkg/daemon/ceph/osd/daemon.go Lines 61 to 75 in 24fc94c
I have updated the PR to enable the VGs all the time. Does anything speak against that? |
f03e7af
to
7f4ac30
Compare
@leseb @travisn @BlaineEXE PTAL |
pkg/daemon/ceph/osd/daemon.go
Outdated
return fmt.Errorf("failed to activate volume group for lv %+v. Error: %+v", lvPath, err) | ||
} | ||
if err := context.Executor.ExecuteCommand(false, "", "vgchange", "-ay", volumeGroupName); err != nil { | ||
return fmt.Errorf("failed to activate volume group for lv %+v. %+v", lvPath, err) |
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.
Isn't lvPath
a string? If so please use %q
instead. Thanks.
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.
Fixed it now.
7f4ac30
to
73ec92f
Compare
pkg/daemon/ceph/osd/daemon.go
Outdated
if err := context.Executor.ExecuteCommand(false, "", "vgchange", "-ay", volumeGroupName); err != nil { | ||
return fmt.Errorf("failed to activate volume group for lv %+v. Error: %+v", lvPath, err) | ||
} | ||
if err := context.Executor.ExecuteCommand(false, "", "vgchange", "-ay", volumeGroupName); err != nil { |
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.
The volumeGroupName won't be set if it's not a PVC, if you could take another look per discussion
Running `vgchange -ay` will enable all VGs on the host. This will remove the need to have the lvm* services running on the host. In such a case with a host, this would lead to all OSDs on that host to be unavailable and the OSD Pods crashlooping as they can't find their VG and / or LV. Signed-off-by: Alexander Trost <galexrt@googlemail.com>
73ec92f
to
d353544
Compare
The So it'll be either just enabling all VGs or finding a working way to get the LVPath from the non-PVC backed OSDs as well. If anyone knows a good way to get the LVPath for existing OSDs, please let me know. I'll ask in the huddle on Tuesday. |
I'm not sure it's a good idea to blindly enable all VGs on a host. If anything, we should have a filter of some sort. There might be VGs we don't own. |
c-v should incorporate the necessary de-activate call soon, so we should wait for that instead of running this in Rook. @galexrt can we close this? Thanks. |
Closing this due to inactivity. Feel free to re-open. Thanks. Also, we are moving away from LVM and the current implementation is stable so we probably can skip this. |
@leseb Any idea on the timeline for moving away from LVM? I'd like to deploy rook but this is the one thing holding me up. |
@andrewrynhard If you're using PVC, it'll be in 1.3, if not it's a bit difficult because a lot of things need to be implemented in raw mode. |
Description of your changes:
Running
vgchange -ay
will enable all VGs on the host. This will removethe need to have the lvm* services running on the host. In such a case
with a host, this would lead to all OSDs on that host to be unavailable
and the OSD Pods crashlooping as they can't find their VG and / or LV.
Signed-off-by: Alexander Trost galexrt@googlemail.com
Which issue is resolved by this Pull Request:
Resolves #3640
Checklist:
make codegen
) has been run to update object specifications, if necessary.[test ceph min]