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

Adds parameters for MicroCeph bootstrap #252

Conversation

UtkarshBhatthere
Copy link
Contributor

@UtkarshBhatthere UtkarshBhatthere commented Oct 23, 2023

As a way of providing a custom public network for the mon cluster, a new bootstrap parameter is added to cli.
Desired monitor IP can be provided to the cluster bootstrap command as --mon-ip parameter.

Manual Testing ✅:

  1. On bootstrap (Default MonIP: 10.5.2.241, Custom MonIP: 10.24.0.203)
ubuntu@moniptest2:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 8942 qdisc fq_codel state UP group default qlen 1000
    link/ether fa:16:3e:ee:a7:40 brd ff:ff:ff:ff:ff:ff
    altname enp0s3
    inet 10.5.2.241/16 metric 100 brd 10.5.255.255 scope global dynamic ens3
       valid_lft 27994sec preferred_lft 27994sec
    inet6 fe80::f816:3eff:feee:a740/64 scope link 
       valid_lft forever preferred_lft forever
4: ens8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 8942 qdisc fq_codel state UP group default qlen 1000
    link/ether fa:16:3e:66:3e:b2 brd ff:ff:ff:ff:ff:ff
    altname enp0s8
    inet 10.24.0.203/16 metric 100 brd 10.24.255.255 scope global dynamic ens8
       valid_lft 6392sec preferred_lft 6392sec
    inet6 fe80::f816:3eff:fe66:3eb2/64 scope link 
       valid_lft forever preferred_lft forever
ubuntu@moniptest2:~$ sudo microceph cluster bootstrap --mon-ip 10.24.0.203
ubuntu@moniptest2:~$ cat /var/snap/microceph/current/conf/ceph.conf 
# # Generated by MicroCeph, DO NOT EDIT.
[global]
run dir = /var/snap/microceph/x1/run
fsid = 752d688b-1a96-4284-82b3-cf5b1fa949d1
mon host = 10.24.0.203
auth allow insecure global id reclaim = false
public addr = 10.24.0.203
public_network = 10.24.0.203/16
ms bind ipv4 = true
ms bind ipv6 = false
ubuntu@moniptest2:~$ sudo microceph.ceph mon dump
epoch 2
fsid 752d688b-1a96-4284-82b3-cf5b1fa949d1
last_changed 2023-11-01T12:15:24.111578+0000
created 2023-11-01T12:15:19.605951+0000
min_mon_release 17 (quincy)
election_strategy: 1
0: [v2:10.24.0.203:3300/0,v1:10.24.0.203:6789/0] mon.moniptest2
dumped monmap epoch 2
  1. On Join
ubuntu@moniptest3:~$ cat /var/snap/microceph/current/conf/ceph.conf
# # Generated by MicroCeph, DO NOT EDIT.
[global]
run dir = /var/snap/microceph/x1/run
fsid = 752d688b-1a96-4284-82b3-cf5b1fa949d1
mon host = 10.24.0.203
auth allow insecure global id reclaim = false
public addr = 10.24.1.85
public_network = 10.24.0.203/16
ms bind ipv4 = true
ms bind ipv6 = false
ubuntu@moniptest3:~$ sudo microceph.ceph mon dump
epoch 3
fsid 752d688b-1a96-4284-82b3-cf5b1fa949d1
last_changed 2023-11-01T12:20:51.905194+0000
created 2023-11-01T12:15:19.605951+0000
min_mon_release 17 (quincy)
election_strategy: 1
0: [v2:10.24.0.203:3300/0,v1:10.24.0.203:6789/0] mon.moniptest2
1: [v2:10.24.1.85:3300/0,v1:10.24.1.85:6789/0] mon.moniptest3
dumped monmap epoch 3

@UtkarshBhatthere UtkarshBhatthere force-pushed the feature/bootstrap_enhancement branch 3 times, most recently from a7ad624 to 33e7443 Compare October 23, 2023 08:36
@UtkarshBhatthere UtkarshBhatthere self-assigned this Oct 23, 2023
microceph/common/network.go Outdated Show resolved Hide resolved
@UtkarshBhatthere UtkarshBhatthere force-pushed the feature/bootstrap_enhancement branch from 33e7443 to a1d6966 Compare October 25, 2023 14:46
Copy link
Contributor

@lmlg lmlg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nobuto-m
Copy link
Contributor

Are you folks going to implement --cluster-ip or something together with --mon-ip/--public-ip? So that we don't have to go through the post-installation steps like microceph cluster config set cluster_network 192.168.102.0/24.

@nobuto-m
Copy link
Contributor

Doesn't it make more sense if we say the new option as --public-network / --cluster-network to accept a subnet instead of a bare IP address to be aligned with the Ceph config options?

ref: #197

@UtkarshBhatthere
Copy link
Contributor Author

Doesn't it make more sense if we say the new option as --public-network / --cluster-network to accept a subnet instead of a bare IP address to be aligned with the Ceph config options?

The --mon-ip bootstrap method is consistent with popular tools like cephadm and is widely documented in upstream ceph documentation and similar resources. MicroCeph follows mon-host addressing for monitors, and, while I am sure we'll implement --public-network and --cluster-network parameters for bootstrap that would be done as a separate feature enhancement PR.
@nobuto-m

@nobuto-m
Copy link
Contributor

Doesn't it make more sense if we say the new option as --public-network / --cluster-network to accept a subnet instead of a bare IP address to be aligned with the Ceph config options?

The --mon-ip bootstrap method is consistent with popular tools like cephadm and is widely documented in upstream ceph documentation and similar resources. MicroCeph follows mon-host addressing for monitors, and, while I am sure we'll implement --public-network and --cluster-network parameters for bootstrap that would be done as a separate feature enhancement PR. @nobuto-m

Makes sense. Thanks for the clarification.

@UtkarshBhatthere UtkarshBhatthere force-pushed the feature/bootstrap_enhancement branch 2 times, most recently from 40c9c33 to 300f666 Compare November 1, 2023 12:26
Copy link
Collaborator

@sabaini sabaini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Utkarsh,

Many thanks for that -- I've added some comments.

Would it be possible to add some testing for the multinode test case as well?

microceph/ceph/bootstrap.go Outdated Show resolved Hide resolved
microceph/ceph/config.go Outdated Show resolved Hide resolved
microceph/ceph/join.go Outdated Show resolved Hide resolved
microceph/ceph/join.go Show resolved Hide resolved
microceph/cmd/microceph/cluster_bootstrap.go Show resolved Hide resolved
microceph/ceph/bootstrap.go Outdated Show resolved Hide resolved
microceph/common/network.go Outdated Show resolved Hide resolved
microceph/common/network.go Outdated Show resolved Hide resolved
microceph/common/network.go Show resolved Hide resolved
microceph/common/network.go Show resolved Hide resolved
@UtkarshBhatthere UtkarshBhatthere force-pushed the feature/bootstrap_enhancement branch 3 times, most recently from 6ac8769 to daaa4e4 Compare November 3, 2023 09:34
Copy link
Collaborator

@sabaini sabaini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Utkarsh, many thanks -- think the approach with separating out bootstrapping will serve well for future feature additions

Some comments inline.

Two things will be needed in addition:

  • Functional testing
  • Updateing the microceph init command to work with the new approach

microceph/cmd/microceph/cluster_bootstrap.go Outdated Show resolved Hide resolved
microceph/ceph/bootstrap.go Outdated Show resolved Hide resolved
microceph/api/services.go Outdated Show resolved Hide resolved
microceph/cmd/microceph/cluster_bootstrap.go Outdated Show resolved Hide resolved
@UtkarshBhatthere UtkarshBhatthere force-pushed the feature/bootstrap_enhancement branch 11 times, most recently from 313ef0e to f8c3fd1 Compare November 8, 2023 07:31
@UtkarshBhatthere UtkarshBhatthere force-pushed the feature/bootstrap_enhancement branch from f8c3fd1 to 386966b Compare November 8, 2023 07:48
@UtkarshBhatthere UtkarshBhatthere force-pushed the feature/bootstrap_enhancement branch 2 times, most recently from 668a703 to 762d7ec Compare November 17, 2023 10:07
@UtkarshBhatthere UtkarshBhatthere force-pushed the feature/bootstrap_enhancement branch from 762d7ec to b2f10fa Compare November 17, 2023 10:22
@UtkarshBhatthere UtkarshBhatthere force-pushed the feature/bootstrap_enhancement branch from b2f10fa to b826f87 Compare November 17, 2023 11:03
@UtkarshBhatthere UtkarshBhatthere changed the title Adds --mon-ip parameter to specify IP for monitor bootstrap Adds parameters MicroCeph bootstrap Nov 27, 2023
@UtkarshBhatthere UtkarshBhatthere changed the title Adds parameters MicroCeph bootstrap Adds parameters for MicroCeph bootstrap Nov 27, 2023
@UtkarshBhatthere
Copy link
Contributor Author

Recreated PR#:#266

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

Successfully merging this pull request may close these issues.

4 participants