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

CRD:nlsc spec.ResourceToBeInited.vgs does not support updating? #256

Open
Clara12062 opened this issue May 27, 2024 · 0 comments
Open

CRD:nlsc spec.ResourceToBeInited.vgs does not support updating? #256

Clara12062 opened this issue May 27, 2024 · 0 comments

Comments

@Clara12062
Copy link
Contributor

Question

问题描述

  1. 部署时, nlsc的spec配置如下:
spec:
  globalConfig:
    listConfig:
      vgs:
        include:
        - open-local-pool-[0-9]+
        - yoda-pool[0-9]+
        - ackdistro-pool
    resourceToBeInited:
      vgs:
      - devices:
        - /dev/vdb
        name: open-local-pool-0
  1. vg空间不够了, 修改nlsc的CR实例的spec如下:
spec:
  globalConfig:
    listConfig:
      vgs:
        include:
        - open-local-pool-[0-9]+
        - yoda-pool[0-9]+
        - ackdistro-pool
    resourceToBeInited:
      vgs:
      - devices:
        - /dev/vdb
        - /dev/vdc
        name: open-local-pool-0

期望结果

查看每个节点的nls的CR实例, spec更新, open-local-pool-0包含两块磁盘的PV, 宿主机上执行vgs, 卷组成功扩容.

实际结果

每个节点的nls的CR实例, spec更新, 但是open-local-pool-0没有变化, /dev/vdc并没有加进去.
查看代码open-local/pkg/agent/discovery/discovery.go:

		for _, vg := range vgs {
			if _, err := lvm.LookupVolumeGroup(vg.Name); err == lvm.ErrVolumeGroupNotFound {
				err := d.createVG(vg.Name, vg.Devices)
				if err != nil {
					msg := fmt.Sprintf("create vg %s with device %v failed: %s. you can try command \"vgcreate %s %v --force\" manually on this node", vg.Name, vg.Devices, err.Error(), vg.Name, strings.Join(vg.Devices, " "))
					log.Error(msg)
					d.recorder.Event(nls, corev1.EventTypeWarning, localtype.EventCreateVGFailed, msg)
				}
			}
		}

似乎只有VG不存在时, 才会创建VG, 而更新nlsc.spec.resourceToBeInited并不会把新建的磁盘扩到卷组中?
目前的行为是符合期望的吗? 如果resourceToBeInited仅在初始化时使用, 是不是应该添加webhook等处理限制后续的修改行为; 或者支持后续更改, 当卷组添加新磁盘时, 新增expansionVG的处理.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant