xcat2 / xcat-core

Code repo for xCAT core packages
Eclipse Public License 1.0
368 stars 172 forks source link

can we have /tmp and /var on hardisk in the xCAT diskless installation #3876

Closed pharthiphan closed 7 years ago

pharthiphan commented 7 years ago

We​ into testing our application on different Linux OS distributions such as CentOS6.9, CentOS7.3

We are having very limited resources so we switch between distors by doing diskfull installations which takes 20-25 mins. So I am thinking to opt for diskless Installation by having different osimage and it loads in memory with less than 5 mins.

consistent distro versions and fresh system state are both important for us,

coming to my question can we have /tmp and /var on the Harddisk as we are testing, there are lot many logs generated into these directories.

We are having Disk /dev/sda: 250.1 GB can that be used for this purpose in diskless installation.

whowutwut commented 7 years ago

@bybai @immarvin Do you have any advice you can give? Should @pharthiphan be setting up a statelite environment , instead of NFS mounting, we would mount from local disk?

immarvin commented 7 years ago

hi @pharthiphan , xCAT support ramdisk-based satelite, the root file system resides in the memory and allows you to specify the directories which need to be persistent mounted from NFS server or local hard disk. the Doc on ramdisk-based satelite: http://xcat-docs.readthedocs.io/en/stable/guides/admin-guides/manage_clusters/ppc64le/statelite/provision_statelite.html#switch-to-the-ramdisk-based-solution

The Doc on enabling local disk for ramdisk based satellite: http://xcat-docs.readthedocs.io/en/stable/guides/admin-guides/manage_clusters/ppc64le/statelite/advanced_features.html?highlight=localdisk#enabling-the-localdisk-option

A reminder: if you want to have the whole /var directory on local disk, you have to handle the sync of the contents under /var in root file system to mounted the local disk by your self, so I suggest you to just have the subdirectories of /var, which keeps the logs and might increase during your application running , instead of whole /var directory on local hard disk.

Since you have just 2 nodes, if you find that the satellite solution is a little complex for you, you can partition the hard disks on the nodes by yourself first, then create a customized postbootscript to mount them before your application is run.

daniceexi commented 7 years ago

We call it localdisk support, and it does support stateless besides the statelite.

zet809 commented 7 years ago

Hi, @robin2008 , pls add document about using localdisk for diskless in RTD. Thx!

hu-weihua commented 7 years ago

@pharthiphan , could you help to verify and close this defect? thanks

immarvin commented 7 years ago

close this due to no update, please reopen it if you find this issue still exists

vigo332 commented 6 months ago

Did anybody have this working with stateless image?

I have both /var and /tmp mounted to the same partition sda2, which is unwanted (should be sda1 and sda2). I can't find any documentation to separate partitions for different mount points, ie /var and /tmp, if not missing it. @immarvin

I am running xCAT 2.16.5, on a rocky8.9 host, genimage on a rocky9.3 host.

This is the partition I get for the stateless client.

lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8:0 0 200G 0 disk |-sda1 8:1 0 19.6G 0 part /.sllocal/localmnt |-sda2 8:2 0 169.5G 0 part /var | /tmp | /.sllocal/localmnt `-sda3 8:3 0 9.3G 0 part [SWAP] sr0 11:0 1 1024M 0 rom

I have the litefile

tabdump litefile

image,file,options,comments,disable

"rocky9.3-x86_64-netboot-compute.mssm","/tmp/","localdisk",, "rocky9.3-x86_64-netboot-compute.mssm","/var/","localdisk",,

and the localdisk file.

cat /install/custom/netboot/rocky/compute.rocky.localdisk

enable=yes enablepart=yes

[disk] dev=/dev/sda clear=yes parts=10,85,5 fstype=xfs ptype=gpt

[localspace] dev=/dev/sda1 fstype=xfs

[localspace] dev=/dev/sda2 fstype=xfs

[swapspace] dev=/dev/sda3

I have the /var sync error in the /.sllocal/log/localdisk.log

Sync contents of /var/ to localdisk cp: cannot stat '/sysroot/var/*': No such file or directory mount --bind /sysroot/.sllocal/localmnt/var/ /sysroot/var/

The reason I want to have /var on local disk is that I would like to have /var/log, /var/mmfs, /var/adm to be on local disk.

Where should I fix copying the whole /var/?

samveen commented 6 months ago

@vigo332 please take a look at the state-lite image documentation. you may be able to modify the process in your environment to use some /dev/sdxY (disk partitiions) instead of /dev/ramY (ramdisks).