move topics

This commit is contained in:
2024-08-08 09:55:20 +02:00
parent b74236adaa
commit 28450ce2d0
5 changed files with 82 additions and 94 deletions
@@ -1,10 +1,12 @@
# Resize System Volumes
# Partitioning
## Resize System Volumes
The size of the system volumes (inside volume group `vgroot`), are automatically set on a rather small size at the initial installation.
Note that due to the limitations of XFS a volume can only be increased, not be shrunk.
## Get Available Space and Volume Sizes
### Get Available Space and Volume Sizes
To check how much space is still available, use `pvs` and look for the volume group `vgroot`:
```
@@ -27,7 +29,7 @@ Then `lvs` gives the sizes of the volumes inside:
[root@lxdev00 ~]#
```
## Extend System Volume
### Extend System Volume
This can be done in Hiera with the `vgroot::path` key where for each volume which should be increased a new minium size can be set:
@@ -43,3 +45,35 @@ This is then applied on the next puppet run, you may trigger one as `root`:
```
puppet agent -t
```
## Custom Partitioning
To add a new volume to the system disk, you need to address the [lvm Puppet module](https://forge.puppet.com/modules/puppetlabs/lvm) directly in Hiera::
```yaml
lvm::volume_groups:
vg_root:
physical_volumes:
- /dev/nvme0n1p3
logical_volumes:
lv_data:
size: 3TB
fs_type: 'xfs'
mountpath: '/mnt/data'
size_is_minsize: true
```
Please note that you need also to list the partition on which `vg_root` is located.
The same you can do to add partitions outside of the system disk, but here you need to define the full LVM volume group:
```yaml
lvm::volume_groups:
vg_data:
physical_volumes:
- '/dev/sdb'
logical_volumes:
lv_usr_local:
mountpath: '/usr/local'
fs_type: 'xfs'
```
+42
View File
@@ -0,0 +1,42 @@
# Partitioning
## Default Partitioning
Partitions system are configured with a standard schema using LVM, so that they can be possibly changed afterwards.
By default the whole space available on the first block device is used and any existing partition is removed.
Alternatively you might set the sysdb attribute `system_disk` with the device name of the disk which should be used instead::
```bash
bob node set-attr $FQDN system_disk=md126
```
### RHEL7
The default partition schema for RHEL7 is:
- create one primary ``/boot`` partition of 1Gb;
- create the ``vg_root`` Volume Group that uses the rest of the disk;
- on ``vg_root`` create the following logical volumes:
- ``lv_root`` of 12 Gb size for ``/root``;
- ``lv_var`` of 8 Gb size for ``/var``;
- ``lv_var_log`` of 2 Gb size for ``/var/log``;
- ``lv_tmp`` of 2 Gb size for ``/tmp``.
### RHEL8
The default partition schema for RHEL8 is:
- create one primary ``/boot`` partition of 1Gb;
- create the ``vg_root`` Volume Group that uses the rest of the disk;
- on ``vg_root`` create the following logical volumes:
- ``lv_root`` of 14 Gb size for ``/root``;
- ``lv_home`` of 2 Gb size for ``/home``;
- ``lv_var`` of 8 Gb size for ``/var``;
- ``lv_var_log`` of 3 Gb size for ``/var/log``;
- ``lv_var_tmp`` of 2 Gb size for ``/var/log``;
- ``lv_tmp`` of 2 Gb size for ``/tmp``.
# Custom Partitioning
It is possible to customize the partitioning by using the `partitions` attribute on sysdb. See https://git.psi.ch/linux-infra/bob for more details.
-88
View File
@@ -1,88 +0,0 @@
Partitioning
============
Default Partitioning
--------------------
Partitions system are configured with a standard schema using LVM, so
that they can be possibly changed afterwards.
By default the whole space available on the first block device is used
and any existing partition is removed.
Alternatively you might set the sysdb attribute ``system_disk`` with the
device name of the disk which should be used instead::
bob node set-attr $FQDN system_disk=md126
The default partition schema for RHEL 7 is:
- create one primary ``/boot`` partition of 1Gb;
- create the ``vg_root`` Volume Group that uses the rest of the disk;
- on ``vg_root`` create the following logical volumes:
- ``lv_root`` of 12 Gb size for ``/root``;
- ``lv_var`` of 8 Gb size for ``/var``;
- ``lv_var_log`` of 2 Gb size for ``/var/log``;
- ``lv_tmp`` of 2 Gb size for ``/tmp``.
For RHEL 8 it is:
- create one primary ``/boot`` partition of 1Gb;
- create the ``vg_root`` Volume Group that uses the rest of the disk;
- on ``vg_root`` create the following logical volumes:
- ``lv_root`` of 14 Gb size for ``/root``;
- ``lv_home`` of 2 Gb size for ``/home``;
- ``lv_var`` of 8 Gb size for ``/var``;
- ``lv_var_log`` of 3 Gb size for ``/var/log``;
- ``lv_var_tmp`` of 2 Gb size for ``/var/log``;
- ``lv_tmp`` of 2 Gb size for ``/tmp``.
Partial Custom Partitioning
---------------------------
To increase these sizes of the above listed default volumes, you might use :doc:`vgroot::path <../puppet/profiles/vgroot>` in Hiera::
vgroot::path:
lv_root: 50GB
lv_var: 30GB
To add a new volume to the system disk (Volume Group ``vg_root``), you need to address the `lvm Puppet module <https://forge.puppet.com/modules/puppetlabs/lvm>`_ directly in Hiera::
lvm::volume_groups:
vg_root:
physical_volumes:
- /dev/nvme0n1p3
logical_volumes:
lv_data:
size: 3TB
fs_type: 'xfs'
mountpath: '/mnt/data'
size_is_minsize: true
Please note that you need also to list the partition on which ``vg_root`` is located.
The same you can do to add partitions outside of the system disk, but here you need to define the full LVM volume group::
lvm::volume_groups:
vg_data:
physical_volumes:
- '/dev/sdb'
logical_volumes:
lv_usr_local:
mountpath: '/usr/local'
fs_type: 'xfs'
Full Custom Partitioning
------------------------
It is possible to customize the partitioning by using the ``partitions`` attribute on sysdb.
The ``partitions`` attribute can take two values:
- ``manual``: this will not partition the disks and the installation process will wait for manual partitioning;
- ``<URL>``: it is assumed to be a file containing the partitioning commands as used in kickstart.
If it is not possible to download the given URL the system fails-back to manual at installation time.
Please also note that no check is done on the URL content.
-130
View File
@@ -1,130 +0,0 @@
# New Sysdb Deployment Environment
## Introduction
Deploying a new environment requires the following:
1. Configuring the environment in **bob**
2. Configuring the environment in GIT (`https://git.psi.ch/linux-infra/hiera`)
- Environment format: `data-<environment_name>`
- And change permissions accordingly
- Configure the necessary webhooks for the Puppet and Sysdb server
3. Configuring the environment in Puppet (e.g. `puppet01.psi.ch`)
## Configuring the environment in sysdb
Bob allows to create a new environment in `sysdb` by using the `bob env` option.
You must have permissions to do that.
You must belong to the `sysdb-admins` group that is actually
configured on the local `/etc/group` file. A migration to Active
Directory should be done for that group.
To list current defined environments run
bob env list
To add a new environment, run
bob env add <environment_name> <owner> <admin_group> "<description>"
In example, for the MeG cluster
bob env add meg caubet_m unx-hpc_adm "MeG Cluster"
### Test new environment in BOB
In order to test that environment was successfully created
bob env list | grep <environment_name>
An example
caubet_m@caubet-laptop:~/GIT/admin-guide/deployment$ bob env list | grep meg
meg caubet_m unx-hpc_adm MeG Cluster
## Configuring the environment in GIT
You must belong to the `unx-puppet_adm` Active Directory group in order to be able to create new projects.
In order to create a new environment in **GIT**, you should access and login in the following link: https://git.psi.ch/linux-infra/hiera/.
Here you can see the different environments.
The steps to create and configure a new **GIT** project are:
1. Create a new project (environment) in the `hiera` group. It can be done here: https://git.psi.ch/projects/new?namespace_id=1738
- Click `[Create blank project]`
- Define `[Project name]`, which *must* have the format `data-<environment_name>` where `<environment_name>` is the one defined in **Bob**
- Specify `[Visibility Level]`: Should be `Internal` or `Private`
- Remove the tick `[Initialize repository with a README]`.
2. Configure project permissions as follows:
- `[data-<environment_name]->[Settings]->[Repository]`, or directly: https://git.psi.ch/linux-infra/hiera/data-(environment_name)/-/settings/repository
- Enable already registered deploy key: `[Deploy Keys]` -> `[Privately accessible deploy keys]` -> select `root@puppet01'` -> click on `'Enable'`
- `[data-<environment_name]->[Manage]->[Members]`, or directly: https://git.psi.ch/linux-infra/hiera/data-(environment_name)/project_members
- Setup specific permissions for specific users or groups. In example:
- Set project `Maintainer`:
- `[Select members to invite]` (`caubet_m`) + `[Choose a role permission]` (`Maintainer`) + `[Add to project]`
- Set other roles:
- `[Select members to invite]` (`dorigo_a`) + `[Choose a role permission]` (`Developer`) + `[Add to project]`
- `[data-<environment_name]->[Settings]->[Webhooks]`, or directly: https://git.psi.ch/linux-infra/hiera/data-(environment_name)/-/hooks
- Add WebHooks as follows:
- `[URL]`: http://puppet01.psi.ch/events/dataupdate
- `[URL]`: http://sysdb.psi.ch/events/dataupdate
- (Checked) `[Push events]`. Uncheck the rest.
- `[SSL verification]` -> (uncheck) `[Enable SSL verification]`
- Confirm information from above, and click on `[Add webhook]` to add the new WebHook.
### Test new environment in GIT
In order to test that environment was successfully created
git clone git@git.psi.ch:linux-infra/hiera/data-<environment_name>.git
An example
caubet_m@caubet-laptop:~/GIT$ git clone git@git.psi.ch:linux-infra/hiera/data-meg.git
Cloning into 'data-meg'...
X11 forwarding request failed
warning: You appear to have cloned an empty repository.
## Configuring the environment in Puppet server
In [bootstrap](https://git.psi.ch/linux-infra/bootstrap) add the new repo to `instcode/puppet/puppet_server/manifests/data.pp` and run the bootstrap for the Puppet server. Note that before this can be rolled out `master` branch needs to exist on `git.psi.ch`.
## Configuring the environment in Sysdb Server
In [bootstrap](https://git.psi.ch/linux-infra/bootstrap) add the new repo to the suitable inventory file (eg. `ansible/inventory.yaml` for production) and run the playbook for the Sysdb server. Note that before this can be rolled out `master` branch needs to exist on `git.psi.ch`.
## Test new environment in Puppet
In order to test that environment was successfully created
git clone git@git.psi.ch:linux-infra/data-<environment_name>.git
Add a new file <environment_name>.yaml in to the project:
cd data-<environment_name>
touch <environment_name>.yaml
git add <environment_name>.yaml
git commit -a -m "Added first empty file"
git push
After a few seconds (needs time to trigger the change), check in `puppet01.psi.ch:/srv/puppet/data/<environment_name>` that file was successfully triggered (copied) to the puppet server from **GIT**
ssh root@puppet01.psi.ch ls /srv/puppet/data/<environment_name>/<environment_name>.yaml
Full real example:
git clone git@git.psi.ch:linux-infra/data-meg.git
cd data-meg
touch meg.yaml
git add meg.yaml
git commit -a -m "Added first empty file"
git push
sleep 5
ssh root@puppet01.psi.ch ls /srv/puppet/data/meg/meg.yaml