Skip to content

Allow setting the lease expiry for DHCP#599

Merged
metal3-io-bot merged 1 commit intometal3-io:masterfrom
cybertron:infinite-leases
Jun 24, 2021
Merged

Allow setting the lease expiry for DHCP#599
metal3-io-bot merged 1 commit intometal3-io:masterfrom
cybertron:infinite-leases

Conversation

@cybertron
Copy link
Member

Newer versions of libvirt (6.3.0 and up) allow the lease expiry to
be set for hosts. We have some functionality that depends on using
infinite leases, so we would like to be able to set this through
metal3-dev-env.

@metal3-io-bot metal3-io-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 11, 2021
cybertron added a commit to cybertron/dev-scripts that referenced this pull request Feb 17, 2021
This was added to metal3-dev-env in [0]. Expose the setting for
dev-scripts too.

0: metal3-io/metal3-dev-env#599
@hardys
Copy link
Member

hardys commented Feb 25, 2021

/test-integration
/test-centos-integration

@hardys
Copy link
Member

hardys commented Feb 25, 2021

I triggered test-integration which may confirm - but do we know what libvirt version is expected in the supported Ubuntu release?

{% set hostname = hostname_format % num %}
<host mac='{{ node_mac_map.get(ironic_name).get(item.name)}}' name='{{hostname}}' ip='{{item.dhcp_range_v4[0]|ipmath(ns.index|int)}}'/>
<host mac='{{ node_mac_map.get(ironic_name).get(item.name)}}' name='{{hostname}}' ip='{{item.dhcp_range_v4[0]|ipmath(ns.index|int)}}'>
<lease expiry='{{ item.lease_expiry }}'/>
Copy link
Member

Choose a reason for hiding this comment

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

Should this be conditional on item.lease_expiry being defined?

Copy link
Member Author

Choose a reason for hiding this comment

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

I added a default for lease_expiry so it should always be set.

@fmuyassarov
Copy link
Member

fmuyassarov commented Feb 25, 2021

I triggered test-integration which may confirm - but do we know what libvirt version is expected in the supported Ubuntu release?

Description above says we need libvirt 6.3.0+. I just checked from the CI, and Ubuntu 20.04 based CI shows that we have 6.0.0 version,

ubuntu@ci-test-vm-20210225133921-xphj:~$ sudo virsh --version
6.0.0

which is installed here. I'm wondering if we can install 7.0.0 version on Ubuntu by specifying the version explicitly(UPDATED) during installation.

Copy link
Member Author

@cybertron cybertron left a comment

Choose a reason for hiding this comment

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

I've been using this locally for a while now and have noticed a couple of odd things with the advanced-virtualization version of libvirt. Neither prevent use of it, but I'm wondering if we don't want to force installation of the newer version and just document what version of libvirt is needed for this particular feature? That would save us from having to deal with the distro-specific methods of getting the correct version.

{% set hostname = hostname_format % num %}
<host mac='{{ node_mac_map.get(ironic_name).get(item.name)}}' name='{{hostname}}' ip='{{item.dhcp_range_v4[0]|ipmath(ns.index|int)}}'/>
<host mac='{{ node_mac_map.get(ironic_name).get(item.name)}}' name='{{hostname}}' ip='{{item.dhcp_range_v4[0]|ipmath(ns.index|int)}}'>
<lease expiry='{{ item.lease_expiry }}'/>
Copy link
Member Author

Choose a reason for hiding this comment

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

I added a default for lease_expiry so it should always be set.

@maelk
Copy link
Member

maelk commented Feb 27, 2021

Could you please elaborate on the use case you are trying to cover ? as is now, there would not be any choice from the user point of view (except if the user is using the roles directly, not via the high level scripts). Would it make sense to introduce a configuration variable and pass it to ansible ?

@cybertron
Copy link
Member Author

I'm looking to support setting infinite leases from dev-scripts. I have a patch up that makes use of this configuration: openshift-metal3/dev-scripts#1191

I'm not sure how broadly applicable this is. It's for an OpenShift feature that does some special handling of infinite leases, which I think is a little unusual. If you think others might want to use it I can wire something in though.

@maelk
Copy link
Member

maelk commented Mar 15, 2021

If it is openshift specific, then maybe it should not be added here

@cybertron
Copy link
Member Author

OpenShift is based on metal3 though. Without this we can't use metal3-dev-env to do development and testing.

@hardys
Copy link
Member

hardys commented Mar 25, 2021

@cybertron IIRC this is actually testing a feature of NetworkManager, so it's not specific to OpenShift (although the requirement originated there)?

@maelk the dev-scripts repo has some dependencies on metal3-dev-env, specifically centos_install_requirements.sh and the ansible roles - we could fork those pieces but the idea is to reduce duplicated effort when we need basically the exact same test setup for upstream metal3 testing, and metal3-enabled OpenShift.

@fmuyassarov
Copy link
Member

@cybertron IIRC this is actually testing a feature of NetworkManager, so it's not specific to OpenShift (although the requirement originated there)?

@maelk the dev-scripts repo has some dependencies on metal3-dev-env, specifically centos_install_requirements.sh and the ansible roles - we could fork those pieces but the idea is to reduce duplicated effort when we need basically the exact same test setup for upstream metal3 testing, and metal3-enabled OpenShift.

Note that centos_install_requirements.sh has been replaced by Ansible script in #574.

Newer versions of libvirt (6.3.0 and up) allow the lease expiry to
be set for hosts. We have some functionality that depends on using
infinite leases, so we would like to be able to set this through
metal3-dev-env.
@cybertron
Copy link
Member Author

I've removed the requirements part entirely. I'm not sure we should be forcing people to pull in a newer version of libvirt if they don't need it. Older releases of libvirt will just drop the lease configuration, and anyone who wants to use custom lease expirations can make sure they have the necessary libvirt themselves. That way it's a conscious choice, not something that might come as a surprise.

@maelk
Copy link
Member

maelk commented Mar 30, 2021

/test-integration

@maelk
Copy link
Member

maelk commented Mar 30, 2021

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 30, 2021
@cybertron
Copy link
Member Author

Hmm, the centos job seems to have gotten stuck.

/test-centos-integration

@furkatgofurov7
Copy link
Member

Hi @cybertron seems there was a glitch in CI by that time, re-triggering all tests once again since we have had changes recently to run integration tests.

/test-centos-integration
/test-integration
/test-v1a4-centos-integration
/test-v1a4-integration

Copy link
Member

@furkatgofurov7 furkatgofurov7 left a comment

Choose a reason for hiding this comment

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

/lgtm

@cybertron
Copy link
Member Author

Hi @cybertron seems there was a glitch in CI by that time, re-triggering all tests once again since we have had changes recently to run integration tests.

Thanks, I've been meaning to ask about this. Looks like it's still working!

@hardys
Copy link
Member

hardys commented Jun 24, 2021

/approve

@metal3-io-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hardys

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@metal3-io-bot metal3-io-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 24, 2021
@metal3-io-bot metal3-io-bot merged commit e5269d7 into metal3-io:master Jun 24, 2021
hardys pushed a commit to hardys/dev-scripts that referenced this pull request Aug 27, 2021
This was added to metal3-dev-env in [0]. Expose the setting for
dev-scripts too.

0: metal3-io/metal3-dev-env#599
cybertron added a commit to cybertron/dev-scripts that referenced this pull request Aug 30, 2021
This was added to metal3-dev-env in [0]. Expose the setting for
dev-scripts too.

0: metal3-io/metal3-dev-env#599
openshift-merge-robot pushed a commit to openshift-metal3/dev-scripts that referenced this pull request Sep 7, 2021
* Support lease expiry option

This was added to metal3-dev-env in [0]. Expose the setting for
dev-scripts too.

0: metal3-io/metal3-dev-env#599

* Bump to current metal3-dev-env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants