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 failure checking if OSD is not created #2599

Closed
wants to merge 1 commit into from

Conversation

trozet
Copy link

@trozet trozet commented May 16, 2018

There are several different types of OSD that may be created depending
on a users environment/settings. However, in the case that no
conditions are met for OSD creation, ceph-ansible completes and no OSD
is created.

resolves #2598

@leseb leseb changed the title Adds failure checking if OSD is not created [skip ci] Adds failure checking if OSD is not created May 17, 2018
@@ -70,6 +80,11 @@
- not containerized_deployment
- item.0.partitions|length == 0

register: osd
Copy link
Member

Choose a reason for hiding this comment

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

This won't work because of the changed_when: false.

Copy link
Author

Choose a reason for hiding this comment

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

why is this task set to changed_when false? Can we change it? It isn't present in the same command for manually prepare ceph.

Copy link
Author

Choose a reason for hiding this comment

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

nvm I'll work around it

@@ -2,6 +2,8 @@
# use shell rather than docker module
# to ensure osd disk prepare finishes before
# starting the next task
- set_fact: osd_created=False
Copy link
Member

Choose a reason for hiding this comment

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

- name: set_fact osd_created
  set_fact:
    osd_created: False

Copy link
Author

Choose a reason for hiding this comment

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

done

@@ -26,6 +28,10 @@
- not osd_auto_discovery
- containerized_deployment
- item.0.partitions|length == 0
register: osd
Copy link
Member

Choose a reason for hiding this comment

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

Calling the register the same name won't work since ansible will overwrite the previous one, even if the task is skipped. So you have to use different names for each task.

Copy link
Author

Choose a reason for hiding this comment

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

That's the point. I want it to overwrite each one because the real state variable is osd_created

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, in this approach there is no issue to register multiple times the same variable name.
It might be an issue if we wanted to have the possibility to deploy multiple osd scenario per host though.

Copy link
Author

Choose a reason for hiding this comment

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

@guits Is that supported today? Are you asking me to change it or this is OK?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@trozet this is OK, I was just trying to clarify.

- item.0.partitions|length == 0
Copy link
Member

Choose a reason for hiding this comment

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

looks like this is fixing a different bug, which means you need a separate commit for that.

Copy link
Author

Choose a reason for hiding this comment

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

oops. I must have accidentally done that with copy paste. Will remove.

@leseb
Copy link
Member

leseb commented May 18, 2018

@trozet let us know when this is ready for review again.

@trozet trozet force-pushed the add_osd_creation_check branch 2 times, most recently from 4c8cc1d to ee92b95 Compare May 18, 2018 14:12
@trozet
Copy link
Author

trozet commented May 18, 2018

@leseb please review again when you have a moment.

- fail:
msg: >
OSD was never created. If using not using osd_auto_discovery, ensure the
Copy link
Member

Choose a reason for hiding this comment

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

extra space between . and If.

Copy link
Author

Choose a reason for hiding this comment

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

I usually use 2 spaces after periods. I'll change them all to 1.

- "{{ parted_results.results | default([]) }}"
- "{{ devices }}"
- "{{ dedicated_devices }}"
changed_when: false
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Can you elaborate on your comment some more? I'm not sure what you think may not work with the register on 99.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@leseb are you concerned because of the changed_when: false because it's changing the "changed" attribute of a registered variable ? If yes, the register L99 isn't affected since they are not applied on the same task.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah my bad, missed the indent and the block :). Not an issue.

- fail:
msg: >
OSD was never created. Ensure the specified devices do not have
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@@ -2,6 +2,10 @@
# use shell rather than docker module
Copy link
Collaborator

Choose a reason for hiding this comment

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

this comment should be moved L9

Copy link
Author

Choose a reason for hiding this comment

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

done

@@ -26,6 +30,10 @@
- not osd_auto_discovery
- containerized_deployment
- item.0.partitions|length == 0
register: osd

- set_fact: osd_created=True
Copy link
Collaborator

Choose a reason for hiding this comment

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

please, use the same syntax than above (L5-7, which is what we use in the whole playbook)

Copy link
Author

Choose a reason for hiding this comment

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

done

@@ -28,6 +32,10 @@
- containerized_deployment
- osd_objectstore == 'filestore'
- item.0.partitions|length == 0
register: osd

- set_fact: osd_created=True
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

- "{{ devices }}"
- "{{ dedicated_devices }}"
changed_when: false
- set_fact: osd_created=True
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

- "{{ dedicated_devices }}"
changed_when: false

- set_fact: osd_created=True
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

Copy link
Collaborator

Choose a reason for hiding this comment

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

@trozet you missed this one ;)

register: osd

- set_fact: osd_created=True
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

@guits
Copy link
Collaborator

guits commented May 23, 2018

@trozet did you push your changes?

@trozet
Copy link
Author

trozet commented May 23, 2018

@guits @leseb just pushed new patch set

- "{{ dedicated_devices }}"
changed_when: false

- set_fact: osd_created=True
Copy link
Collaborator

Choose a reason for hiding this comment

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

@trozet you missed this one ;)

@trozet
Copy link
Author

trozet commented May 23, 2018

@guits please review again

Copy link
Member

@leseb leseb left a comment

Choose a reason for hiding this comment

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

sorry, one more thing.

when: osd.changed

- name: fail if OSD was never created
Copy link
Member

Choose a reason for hiding this comment

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

oops missed this one, no uppercase in name's task.

Copy link
Author

Choose a reason for hiding this comment

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

@leseb done. Out of curiosity is that an ansible standards type of thing? Or is that just something decided on for this particular project?

Copy link
Member

@leseb leseb May 23, 2018

Choose a reason for hiding this comment

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

This is something we decided on this particular project.

when: osd.changed

- name: fail if OSD was never created
Copy link
Member

Choose a reason for hiding this comment

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

ditto

guits
guits previously approved these changes May 23, 2018
@guits guits changed the title [skip ci] Adds failure checking if OSD is not created Adds failure checking if OSD is not created May 23, 2018
@guits
Copy link
Collaborator

guits commented May 23, 2018

jenkins test luminous-ansible2.4-docker_cluster

@guits
Copy link
Collaborator

guits commented May 23, 2018

jenkins test luminous-ansible2.4-bluestore_osds_non_container

leseb
leseb previously approved these changes May 23, 2018
@leseb leseb changed the title Adds failure checking if OSD is not created [skip ci] Adds failure checking if OSD is not created May 24, 2018
@guits
Copy link
Collaborator

guits commented May 30, 2018

@trozet could you please rebase on master?

@trozet
Copy link
Author

trozet commented Jun 11, 2018

@guits sorry I missed this. Will rebase.

There are several different types of OSD that may be created depending
on a users environment/settings.  However, in the case that no
conditions are met for OSD creation, ceph-ansible completes and no OSD
is created.

resolves ceph#2598

Signed-off-by: Tim Rozet <trozet@redhat.com>
@trozet trozet dismissed stale reviews from leseb and guits via f4a0973 June 11, 2018 19:38
@guits guits changed the title [skip ci] Adds failure checking if OSD is not created Adds failure checking if OSD is not created Jun 11, 2018
@guits
Copy link
Collaborator

guits commented Jun 11, 2018

jenkins test this please

@leseb
Copy link
Member

leseb commented Oct 19, 2018

It'd be nice to resurrect something similar once #3187 merges.

@leseb
Copy link
Member

leseb commented Dec 20, 2018

Closing this due to inactivity, feel free to re-open, thanks!

@leseb leseb closed this Dec 20, 2018
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.

ceph-ansible silently ignores no osd creation
3 participants