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

initial orangefs work for sdp #1

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions alaska-ofs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- hosts: orange-all
become: yes
roles:
- role: orange_setup
- role: orangefs
21 changes: 21 additions & 0 deletions inventory.pvfs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Ansible Shade uses OpenStack clients running locally
Copy link
Collaborator

Choose a reason for hiding this comment

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

Inventory files should be auto-generated by the Heat role (which you didn't run, so that's fine).

I'm wondering where your DNS is coming from, have you tinkered with that?

What's interesting here is that we have overlapping roles: a node can be both server and client. This needs a little bit of thinking (but probably, in the first instance, manual adjustment)

Copy link
Author

Choose a reason for hiding this comment

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

i had SSH config point to the nodes and sort out the keys. So ansible will be resolving names that way. not sure how this works with heat.

[orange-data]
orange-0

[orange-meta]
orange-0
orange-1
#orange2

[orange-client]
orange-1
#orange2

[orange-all]
orange-0
orange-1
#orange-2


[openstack]
127.0.0.1 ansible_connection=local ansible_python_interpreter=python
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions orange_setup/files/orangefs_client.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Copy link
Collaborator

Choose a reason for hiding this comment

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

As discussed, if this could get tucked into the RPM that'd be grand.

Description=OrangeFS Parallel File System Client
After=network.target

[Service]
Type=forking
ExecStart=/usr/sbin/pvfs2-client -p /usr/sbin/pvfs2-client-core

[Install]
WantedBy=multi-user.target
29 changes: 29 additions & 0 deletions orange_setup/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
- name: copy rpms to server
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think we should have the RPMs as artefacts in this repo, but how we handle them otherwise is TBD. Best option may be to make a locally-accessible repo server which contains the OrangeFS RPMs, plus a few others we've got kicking around.

copy: src={{ item.src }} dest={{ item.dest }}
with_items:
- { src: '{{ role_path }}/files/orangefs-2.9.7-1.fc25.x86_64.rpm',
dest: '/tmp/orangefs-2.9.7-1.fc25.x86_64.rpm' }
- { src: '{{ role_path }}/files/orangefs-server-2.9.7-1.fc25.x86_64.rpm',
dest: '/tmp/orangefs-server-2.9.7-1.fc25.x86_64.rpm' }

- name: copy unit file for client
copy: src={{ item.src }} dest={{ item.dest }}
with_items:
- { src: '{{ role_path }}/files/orangefs_client.service',
dest: '/usr/lib/systemd/system/' }
become: yes
when: inventory_hostname in groups['orange-client']

- name: orange dependencys
dnf:
name: perl-Math-BigInt
state: present

- name: install orangefs packages
dnf:
name: "{{ item }}"
state: present
with_items:
- /tmp/orangefs-2.9.7-1.fc25.x86_64.rpm
Copy link
Collaborator

Choose a reason for hiding this comment

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

These two items appear to be the same...

Copy link
Author

Choose a reason for hiding this comment

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

you meen the two RPMs? one should provide the server only one provides the client.

- /tmp/orangefs-2.9.7-1.fc25.x86_64.rpm
20 changes: 20 additions & 0 deletions orange_setup/tasks/main.yml~
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
Copy link
Collaborator

Choose a reason for hiding this comment

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

Temporary Emacs file?

- name: copy rpms to server
copy: src={{ item.src }} dest={{ item.dest }}
with_items:
- { src: '{{ role_path }}/files/orangefs-2.9.7-1.fc25.x86_64.rpm',
dest: '/tmp/orangefs-2.9.7-1.fc25.x86_64.rpm' }
- { src: '{{ role_path }}/files/orangefs-server-2.9.7-1.fc25.x86_64.rpm',
dest: '/tmp/orangefs-server-2.9.7-1.fc25.x86_64.rpm' }
- name: orange dependencys
dnf:
name: perl-Math-BigInt
state: present

- name: install orangefs packages
dnf:
name: "{{ item }}"
status: present
with_items:
- /tmp/orangefs-2.9.7-1.fc25.x86_64.rpm
- /tmp/orangefs-2.9.7-1.fc25.x86_64.rpm
87 changes: 87 additions & 0 deletions orangefs/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
Copy link
Collaborator

Choose a reason for hiding this comment

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

It might be tidier syntax to conditionally include task files for client, server, etc. after the common tasks here.

- name: update hosts to make sure names will resolve in hosts file
lineinfile:
dest: /etc/hosts
line: "{{ hostvars[item]['ansible_default_ipv4']['address'] }} {{ hostvars[item].inventory_hostname }}"
state: present
with_items: "{{ groups['orange-all'] }}"


- name: Generate config file
command: pvfs2-genconfig --quiet --protocol tcp --ioservers "{{ groups['orange-data'] | join(',') }}" --metaservers "{{ groups['orange-data'] |join(',') }}" --storage /export/orangefs /etc/pvfs2.conf creates=/etc/pvfs2.conf
become: true

- name: update storage path
lineinfile:
path: /etc/pvfs2.conf
regexp: 'DataStorageSpace /export/orangefs'
line: ' DataStorageSpace /export/orangefs/data'

- name: update storage path
lineinfile:
path: /etc/pvfs2.conf
regexp: 'MetadataStorageSpace /export/orangefs'
line: ' MetadataStorageSpace /export/orangefs/meta'



# Setup disks

- name: install mdadm
dnf: name=mdadm state=latest
when: inventory_hostname in groups['orange-data']

- name: setup mdraid 5 on nvmes
command: mdadm --create --verbose /dev/md0 --level=5 --raid-devices=4 /dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1 creates=/dev/md0
Copy link
Collaborator

Choose a reason for hiding this comment

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

If /dev/md0 already exists, does this fail? If it doesn't, it'll get flattened in the next task. If it does, it means the playbook won't rerun.

Copy link
Author

Choose a reason for hiding this comment

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

if md0 exists the command wont run. if it dose not, then it will try to build the array. If the case that md0 was deleted or the mdadm stop, but raid superblocks exist, then the playbook will fail. Should probably brakeout this into a role that sets up mdraid, since lvm is also an option.

become: true
when: inventory_hostname in groups['orange-data']

- name: format nvme disks mdraid
filesystem:
fstype: xfs
dev: /dev/md0
when: inventory_hostname in groups['orange-data']

- name: create mountpoint
file: path=/export/orangefs state=directory
when: inventory_hostname in groups['orange-data']

- name: mount nvmes
mount:
path: /export/orangefs
src: /dev/md0
fstype: xfs
state: present
become: true
when: inventory_hostname in groups['orange-data']


- name: probe the orangefs module
modprobe:
name: orangefs
state: present

- name: format pvfs2 storage
command: pvfs2-server -f -a "{{ inventory_hostname }}" /etc/pvfs2.conf creates=/export/orangefs/data
when: inventory_hostname in groups['orange-data']

- name: start pvfs2 server
systemd:
name: orangefs
state: started
when: inventory_hostname in groups['orange-data']

- name: start pvfs2 client
systemd:
name: orangefs_client
state: started
when: inventory_hostname in groups['orange-client']

- name: create mountpoint scratch
file: path=/scratch state=directory
when: inventory_hostname in groups['orange-client']

- name: run the mount comand
command: "mount -t pvfs2 tcp://{{ groups['orange-data'] |join('') }}:3334/orangefs /scratch"
become: true
when: inventory_hostname in groups['orange-client']
90 changes: 90 additions & 0 deletions orangefs/tasks/main.yml~
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
Copy link
Collaborator

Choose a reason for hiding this comment

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

You Emacs users have no shame :-)

- name: update hosts to make sure names will resolve in hosts file
lineinfile:
dest: /etc/hosts
line: "{{ hostvars[item]['ansible_default_ipv4']['address'] }} {{ hostvars[item].inventory_hostname }}"
state: present
with_items: "{{ groups['orange-all'] }}"


- name: Generate config file
command: pvfs2-genconfig --quiet --protocol tcp --ioservers "{{ groups['orange-meta'] | join(',') }}" --metaservers "{{ groups['orange-meta'] |join(',') }}" --storage /export/orangefs /etc/pvfs2.conf creates=/etc/pvfs2.conf
become: true

- name: update storage path
lineinfile:
path: /etc/pvfs2.conf
regexp: 'DataStorageSpace /export/orangefs'
line: ' DataStorageSpace /export/orangefs/data'

- name: update storage path
lineinfile:
path: /etc/pvfs2.conf
regexp: 'MetadataStorageSpace /export/orangefs'
line: ' MetadataStorageSpace /export/orangefs/meta'



# Setup disks

- name: install mdadm
dnf: name=mdadm state=latest
when: inventory_hostname in groups['orange-data']

- name: setup mdraid 5 on nvmes
command: mdadm --create --verbose /dev/md0 --level=5 --raid-devices=4 /dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1 creates=/dev/md0
become: true
when: inventory_hostname in groups['orange-data']

- name: format nvme disks mdraid
filesystem:
fstype: xfs
dev: /dev/md0
when: inventory_hostname in groups['orange-data']
run_once: true

- name: create mountpoint
file: path=/export/orangefs state=directory
when: inventory_hostname in groups['orange-data']

- name: mount nvmes
mount:
path: /export/orangefs
src: /dev/md0
fstype: xfs
state: present
become: true
when: inventory_hostname in groups['orange-data']


- name: probe the orangefs module
modprobe:
name: orangefs
state: present

- name: format pvfs2 storage
command: pvfs2-server -f -a "{{ inventory_hostname }}" /etc/pvfs2.conf creates=/export/orangefs/data
when: inventory_hostname in groups['orange-data']

- name: start pvfs2 server
systemd:
name: orangefs
state: started
when: inventory_hostname in groups['orange-data']

- name: start pvfs2 client
command: pvfs2-client -p /usr/sbin/pvfs2-client-core
when: inventory_hostname in groups['orange-client']

- name: create mountpoint scratch
file: path=/scratch state=directory
when: inventory_hostname in groups['orange-client']

- name: mount pvfs2
mount:
path: /scratch
src: tcp://"{{ groups['orange-data'] }}":3334/orangefs
fstype: pvfs2
state: present
become: true
when: inventory_hostname in groups['orange-client']