xcat2 / xcat-core

Code repo for xCAT core packages
Eclipse Public License 1.0
362 stars 171 forks source link

copycds <dvd1.iso> <dvd2.iso> <dvd3.iso> results in only dvd3 content #5843

Open marksmit-ibm opened 5 years ago

marksmit-ibm commented 5 years ago

Recreated on RHEL MGMT node attempting to do copycds for SLES15 and SLES12.SP4. In both SLES osdistros, osimages are properly created. However when more than 1 dvd is specified, only the contents of the last iso specified in the list remains. In the case of SLES12.SP4 both dvd1 and dvd3 go in the /1/ subdirectory. In the case of SLES15, all 3 install iso's go in the same /1/ subdir.

https://xcat-docs.readthedocs.io/en/latest/guides/admin-guides/references/man8/copycds.8.html?highlight=copycds indicates the syntax of specifying all 3 ISO's in one copycds command is supported.

However I am unsure if copycds is supposed to erase contents of subdir /1/ or leave what is there and add to it.

To recreate, copycds SLE-12-SP4-Server-DVD-ppc64le-GM-DVD1.iso and inspect contents of /1/ subdir. It will be correct and rinstall cn06 osimage=sles12.4-ppc64le-install-service will succeed.

Then copycds SLE-12-SP4-Server-DVD-ppc64le-GM-DVD3.iso and the contents of subdir /1/ gets removed and only DVD3 contents remains.

If you run multiple copies in one command, copycds SLE-12-SP4-Server-DVD-ppc64le-GM-DVD1.iso SLE-12-SP4-Server-DVD-ppc64le-GM-DVD2.iso SLE-12-SP4-Server-DVD-ppc64le-GM-DVD3.iso

it does the same thing, leaving only the contents of the last DVD targeted for /1/

Version 2.14.5 (git commit 3b5fd8582ede266407e9bcb83b8fff0faf5d652e, built Tue Nov 27 06:17:30 EST 2018)

Help me understand if copycds is supposed to add to the contents of the dir, or it is designed to only have one dvd contents per subdir. I think this needs a change in either copycds or the naming of the media by SLES. I'm not sure which is needed.

copycds -i SLE-15-Installer-DVD-ppc64le-GM-DVD1.iso SLE-15-Installer-DVD-ppc64le-GM-DVD2.iso SLE-15-Installer-DVD-ppc64le-GM-DVD3.iso OS Image:/root/Downloads/ftp3install.linux.ibm.com/suse/release_cds/sle-15-installer/SLE-15-Installer-DVD-ppc64le-GM-DVD1.iso DISTNAME:sle15 ARCH:ppc64le DISCNO:1

OS Image:/root/Downloads/ftp3install.linux.ibm.com/suse/release_cds/sle-15-installer/SLE-15-Installer-DVD-ppc64le-GM-DVD2.iso DISTNAME:sle15 ARCH:ppc64le DISCNO:1

OS Image:/root/Downloads/ftp3install.linux.ibm.com/suse/release_cds/sle-15-installer/SLE-15-Installer-DVD-ppc64le-GM-DVD3.iso DISTNAME:sle15 ARCH:ppc64le DISCNO:1

bybai commented 5 years ago

Hi @marksmit-ibm, I reproduced this issue, It is a old copycds bug. copycds does not support sles src and debuginfo ISO well.

For sles12.4, copycds the third iso cause the problem. Now copycds these 2 iso work well: copycds SLE-12-SP4-Server-DVD-ppc64le-GM-DVD1.iso SLE-12-SP4-Server-DVD-ppc64le-GM-DVD2.iso For sle15, currently copycds supports these full iso work well: copycds SLE-15-Installer-DVD-ppc64le-GM-DVD1.iso SLE-15-Packages-ppc64le-GM-DVD1.iso

If you want to use debuginfo packages, you can manually mount the SLE-12-SP4-Server-DVD-ppc64le-GM-DVD3.iso and create its repo on your compute node.

Since copycds identify media number from media.1/media is the same in these medias (sles12.x, sle15), we need to enhance related code to use new criteria to identify different ISO. Will fix this bug later. Thanks

cxhong commented 5 years ago

SlE-15 worked fine, because following of code:

 if ($dsc =~ /Installer/ and $dsc =~ /SLE-15/) {
            $discnumber = 1;
            unless ($distname) { $distname = "sle15" };
        } elsif ($dsc =~ /SLE-15/ and $dsc =~ /Packages/) {
            $discnumber = 2;
            unless ($distname) { $distname = "sle15" };
        }

For other sles version, DVD1 and DVD3 has similar directory structure, and both contains 'media.1', and xcat split media.1 as $disnumber. If we want to use copycds for DVD3.iso, we may need to do similar as for SLE-15.

elsif ($dsc =~ /DVD3/ ) {
            $discnumber = 3;
 }
bybai commented 5 years ago

@cxhong, SLE-15 have the similar problem, there are 3 installer and 3 packages ISOs, and all 3 installer ISOs disc number is 1. all 3 packages ISOs disc number is 2, and these 3 ISOs contain different repos but our code do not deal with them well. If we want to provision, SLE15 suggest use SLE-15-Installer-DVD-ppc64le-GM-DVD1.iso and SLE-15-Packages-ppc64le-GM-DVD1.iso

copycds -i SLE-15-Installer-DVD-ppc64le-GM-DVD1.iso SLE-15-Installer-DVD-ppc64le-GM-DVD2.iso SLE-15-Installer-DVD-ppc64le-GM-DVD3.iso
OS Image:/root/Downloads/ftp3install.linux.ibm.com/suse/release_cds/sle-15-installer/SLE-15-Installer-DVD-ppc64le-GM-DVD1.iso
DISTNAME:sle15
ARCH:ppc64le
DISCNO:1

OS Image:/root/Downloads/ftp3install.linux.ibm.com/suse/release_cds/sle-15-installer/SLE-15-Installer-DVD-ppc64le-GM-DVD2.iso
DISTNAME:sle15
ARCH:ppc64le
DISCNO:1

OS Image:/root/Downloads/ftp3install.linux.ibm.com/suse/release_cds/sle-15-installer/SLE-15-Installer-DVD-ppc64le-GM-DVD3.iso
DISTNAME:sle15
ARCH:ppc64le
DISCNO:1