Skip to content

kvm/ceph: When create a new RBD image use modern flags/features for t… - #2985

Merged
GabrielBrascher merged 1 commit into
apache:masterfrom
CLDIN:rbd-features
Nov 12, 2018
Merged

kvm/ceph: When create a new RBD image use modern flags/features for t…#2985
GabrielBrascher merged 1 commit into
apache:masterfrom
CLDIN:rbd-features

Conversation

@wido

@wido wido commented Oct 30, 2018

Copy link
Copy Markdown
Contributor

…he image

These additional RBD features allow for faster lookups of how much space a RBD
image is using, but with the exclusive locking we prevent two VMs from writing
to the same RBD image at the same time.

These are the default features used by Ceph for any new RBD image.

Signed-off-by: Wido den Hollander wido@widodh.nl

Description

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Screenshots (if appropriate):

How Has This Been Tested?

@wido

wido commented Oct 30, 2018

Copy link
Copy Markdown
Contributor Author

This also partially fixes #2650

(1 << 4): RBD_FEATURE_FAST_DIFF
(1 << 5): RBD_FEATURE_DEEP_FLATTEN
*/
private int rbdFeatures = (1 << 0) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How about define the feature as various final int hex values and rbdFeatures can be the or-ed value of those features. Should there also be some kind of version vs feature check?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I could also just write 61 as that's the default.

I took these values from the C-header file from Ceph so that people see what we actually use.

That's mainly a code style thing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agree that it is mainly a code style thing. But here are some suggestions as well.

private final int RBD_FEATURE_LAYERING = 1;
private final int RBD_FEATURE_EXCLUSIVE_LOCK = 4;
private final int RBD_FEATURE_OBJECT_MAP = 8;
private final int RBD_FEATURE_FAST_DIFF = 16;
private final int RBD_FEATURE_DEEP_FLATTEN = 32;
private int rbdFeatures = RBD_FEATURE_LAYERING + RBD_FEATURE_EXCLUSIVE_LOCK + RBD_FEATURE_OBJECT_MAP + RBD_FEATURE_FAST_DIFF + RBD_FEATURE_DEEP_FLATTEN;

or

/**
	Ceph RBD features to use when creating a new RBD image
        RBD_FEATURE_LAYERING: 1
        RBD_FEATURE_EXCLUSIVE_LOCK: 4
        RBD_FEATURE_OBJECT_MAP: 8
        RBD_FEATURE_FAST_DIFF: 16
        RBD_FEATURE_DEEP_FLATTEN: 32
	Total:61
*/
private final int RBF_FEATURES = 61;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like the first suggestion @GabrielBrascher makes, @wido . it comes down to "self documenting code by proper naming"

@yadvr

yadvr commented Oct 30, 2018

Copy link
Copy Markdown
Member

@blueorangutan package

1 similar comment
@yadvr

yadvr commented Oct 31, 2018

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2397

@yadvr

yadvr commented Oct 31, 2018

Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@GabrielBrascher GabrielBrascher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR @wido. Code LGTM.

(1 << 4): RBD_FEATURE_FAST_DIFF
(1 << 5): RBD_FEATURE_DEEP_FLATTEN
*/
private int rbdFeatures = (1 << 0) + (1 << 2) + (1 << 3) + (1 << 4) + (1 << 5);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agree that it is mainly a code style thing. But here are some suggestions as well.

private final int RBD_FEATURE_LAYERING = 1;
private final int RBD_FEATURE_EXCLUSIVE_LOCK = 4;
private final int RBD_FEATURE_OBJECT_MAP = 8;
private final int RBD_FEATURE_FAST_DIFF = 16;
private final int RBD_FEATURE_DEEP_FLATTEN = 32;
private int rbdFeatures = RBD_FEATURE_LAYERING + RBD_FEATURE_EXCLUSIVE_LOCK + RBD_FEATURE_OBJECT_MAP + RBD_FEATURE_FAST_DIFF + RBD_FEATURE_DEEP_FLATTEN;

or

/**
	Ceph RBD features to use when creating a new RBD image
        RBD_FEATURE_LAYERING: 1
        RBD_FEATURE_EXCLUSIVE_LOCK: 4
        RBD_FEATURE_OBJECT_MAP: 8
        RBD_FEATURE_FAST_DIFF: 16
        RBD_FEATURE_DEEP_FLATTEN: 32
	Total:61
*/
private final int RBF_FEATURES = 61;

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-3136)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 23708 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2985-t3136-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_multipleips_per_nic.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Intermittent failure detected: /marvin/tests/smoke/test_host_maintenance.py
Smoke tests completed. 66 look OK, 3 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_nic_secondaryip_add_remove Error 42.02 test_multipleips_per_nic.py
test_04_rvpc_network_garbage_collector_nics Failure 461.52 test_vpc_redundant.py
test_05_rvpc_multi_tiers Failure 319.77 test_vpc_redundant.py
test_05_rvpc_multi_tiers Error 343.88 test_vpc_redundant.py
test_02_cancel_host_maintenace_with_migration_jobs Error 2.32 test_host_maintenance.py

@wido

wido commented Nov 5, 2018

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback! See the updated code

@DaanHoogland DaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

won't pass without the static keyword


private String rbdTemplateSnapName = "cloudstack-base-snap";
private int rbdFeatures = (1 << 0); /* Feature 1<<0 means layering in RBD format 2 */
private final int RBD_FEATURE_LAYERING = 1;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the errors with checkstuyle are due to the vars not being static (final). full capitalised is reserved for those constants only.

@DaanHoogland DaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

won't pass without the static keyword

@DaanHoogland DaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

won't pass without the static keyword

…he image

These additional RBD features allow for faster lookups of how much space a RBD
image is using, but with the exclusive locking we prevent two VMs from writing
to the same RBD image at the same time.

These are the default features used by Ceph for any new RBD image.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
@wido

wido commented Nov 5, 2018

Copy link
Copy Markdown
Contributor Author

Yes, I trusted my IDE to help with this, but fixed it now! Compiles :)

@yadvr

yadvr commented Nov 12, 2018

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✖debian. JID-2423

@yadvr

yadvr commented Nov 12, 2018

Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@GabrielBrascher

Copy link
Copy Markdown
Member

@wido @DaanHoogland @rhtyd merging it to the master branch, based on code review (3 LGTMs) and that all checks have passed.

@GabrielBrascher
GabrielBrascher merged commit 4809fe7 into apache:master Nov 12, 2018
@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-3163)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 24282 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2985-t3163-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_deploy_virtio_scsi_vm.py
Intermittent failure detected: /marvin/tests/smoke/test_multipleips_per_nic.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_vpn.py
Smoke tests completed. 66 look OK, 3 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_nic_secondaryip_add_remove Error 32.93 test_multipleips_per_nic.py
test_04_rvpc_network_garbage_collector_nics Failure 484.29 test_vpc_redundant.py
test_05_rvpc_multi_tiers Failure 305.61 test_vpc_redundant.py
test_05_rvpc_multi_tiers Error 327.72 test_vpc_redundant.py
test_01_vpc_site2site_vpn_multiple_options Failure 230.04 test_vpc_vpn.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants