-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
15bd434
e78b624
c9a1761
35782ff
9ff8bbe
8beb152
0ad8137
e6edefe
4af0c57
842de64
bee8b1f
d9ee04c
52f89c9
c4e3c1f
8d7eb90
b8a412d
85d21f8
efa40bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Ansible Shade uses OpenStack clients running locally | ||
[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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Unit] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
- name: copy rpms to server | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These two items appear to be the same... There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
--- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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'] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
--- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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'] |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.