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

CentOS 7 iso file and atomic package not available in repository #367

Open
kamesh2229 opened this issue Dec 22, 2018 · 10 comments
Open

CentOS 7 iso file and atomic package not available in repository #367

kamesh2229 opened this issue Dec 22, 2018 · 10 comments

Comments

@kamesh2229
Copy link

Hi all,

I need to install CentOS 7.20160404 Atomic Host on one of the bare metal node which i will doing using PXE installation from kickstart file anaconda installation.

I need the iso file which will be mounted and the atomic repo that contains the actual OS.
I couldn't see anywhere these file and can you please help me in providing the links for the same where i can download.

http://vault.centos.org/7.2.1511/atomic/ --- We will have atomic repo similar to the one shown here and in this location we have only 7.2.1511 and not the one i mentioned above.
This version number i got it from the atomic host status command after installing by some other person earlier and the images are not available now and no back-up taken.

Any help would really be appreciated.

7.20160404 === Version
e39c28570a ==== Checksum

Regards,
Kamesh,

@kamesh2229
Copy link
Author

Hi,

Can some one help me in getting the required files ?

@miabbott
Copy link
Contributor

miabbott commented Jan 3, 2019

That version is really old, so I'm not surprised the ISO file isn't around. The oldest ISO that I was able to find appears to correspond to 7.20160130 - https://cloud.centos.org/centos/7/atomic/images/CentOS-Atomic-Host-7.20160130-Installer.iso

And the ostree repo that contains the OS is the same repo that is used by the most recent version of CentOS Atomic Host - http://mirror.centos.org/centos/7/atomic/x86_64/repo

The bits for 7.20160404 exist in that ostree repo and correspond to commit e39c28570a7ceb765feed1a0f017b94641e75137afd317730c7cd3a6651492f6

Because the exact ISO isn't available, you have a couple of options.

  1. Boot the ISO linked above (or even a more recent one) and after the initial install is completed, use rpm-ostree deploy 7.20160404 to deploy the version you want.

  2. Make a local repo that points to the commit for 7.20160404, make that available via http, then change your kickstart file to point the ostreesetup to your local repo. I did this with a test VM and it looked like this:

## create the local repo and mirror the desired commit
# mkdir repo
# ostree --repo=repo init --mode=archive
# ostree --repo=repo remote add --no-gpg-verify centos-atomic-host http://mirror.centos.org/centos/7/atomic/x86_64/repo
# ostree --repo=repo pull --mirror centos-atomic-host centos-atomic-host/7/x86_64/standard@e39c28570a7ceb765feed1a0f017b94641e75137afd317730c7cd3a6651492f6
# python3 -m http.server 9001
## edit kickstart to have the following line:
ostreesetup --osname="centos-atomic-host" --remote="centos-atomic-host" --url="http://<ip address>:9001/repo" --ref="centos-atomic-host/7/x86_64/standard" --nogpg

@kamesh2229
Copy link
Author

Hi,

Thanks a lot for the great help.
The PXE what we have is in the lab behind a firewall which doesn't have the internete access.

So i am wondering if i have any chance of download the repo in my laptop and i can copy the atomic.tart file to the PXE which will be untar during installation time in the PXE ?

Anyhow i will as well check the given suggestions and see if i am able to download and install.

Regards,
Kamesh.

@kamesh2229
Copy link
Author

Hi,

Just a quick question..

create the local repo and mirror the desired commit

mkdir repo

ostree --repo=repo init --mode=archive

ostree --repo=repo remote add --no-gpg-verify centos-atomic-host http://mirror.centos.org/centos/7/atomic/x86_64/repo

ostree --repo=repo pull --mirror centos-atomic-host centos-atomic-host/7/x86_64/standard@e39c28570a7ceb765feed1a0f017b94641e75137afd317730c7cd3a6651492f6

python3 -m http.server 9001

The above lines where i should use ?
The last iine as said i will be doing in the kickstart file,but the lines related to create the local repo should be in which file ?

Regards,
Kamesh.

@kamesh2229
Copy link
Author

Local HTTP

ostreesetup --nogpg --osname="centos" --remote="localmedia" --url="http://:32080/_repositories/centos/7/atomic/x86_64/repo/" --ref="centos-atomic-host/7/x86_64/standard"

mkdir /var/cloud-init
curl http://:32080/_cloud-init//meta-data > /var/cloud-init/meta-data
curl http://:32080/_cloud-init//user-data > /var/cloud-init/user-data

ostree remote add --set=gpg-verify=false centos-atomic-host 'http://:32080/_repositories/centos/7/atomic/x86_64/repo'

where the repo is copied under the below directory.

What it is done is that this repo is downloaded outside the PXE and then is splitted as the files below since the atomic repo is a very huge file and then the same is compressed and copied under the repo directory as specified which is updated in the kickstart file.

atomic_split.gz_aa
atomic_split.gz_ab
atomic_split.gz_ac
atomic_split.gz_ad

So if you can let me know if I can do some download like rsync for the specified version then I can get the repo in my laptop and can transfer to the PXE ?

Repo path :
/var/www/pub/_repositories/centos/7/atomic/x86_64

Repo Contents :
drwxr-xr-x. 3 65532 65532 4096 feb 16 2016 adb
drwxr-xr-x. 7 65532 65532 4096 dec 8 23:53 repo

Your help would get me some wayforward.

Regrds,
Kamesh.

@kamesh2229
Copy link
Author

Hi,

Can you please let me know if there is a way that I can download the repo i. e the atomic folder as mentioned?

This helps in copying to PXE as required for installation.

The problem is that I don't have Internet in the PXE for run time download.

Thanks for your support.

Regards,
Kamesh.

@miabbott
Copy link
Contributor

miabbott commented Jan 7, 2019

I'm not very familiar with PXE, but if you just want to make the repo available on your laptop, you can use the instructions I provided above. Using your folder structure you provided (which I assume is your laptop), you would do the following. It does require you to have ostree installed on your laptop:

# cd  /var/www/pub/_repositories/centos/7/atomic/x86_64
# mkdir repo
# ostree --repo=repo init --mode=archive
# ostree --repo=repo remote add --no-gpg-verify centos-atomic-host http://mirror.centos.org/centos/7/atomic/x86_64/repo
# ostree --repo=repo pull --mirror centos-atomic-host centos-atomic-host/7/x86_64/standard@e39c28570a7ceb765feed1a0f017b94641e75137afd317730c7cd3a6651492f6

Then you could serve up the repo directory through whatever web server you have running on your laptop.

Regarding the ostreesetup line in the kickstart file, I was using that as an example to illustrate that you can configure which repo you are using during install. When I did this using a basic ISO installation, used the ks argument to the vmlinuz line during boot to point to my kickstart file. I was providing the kickstart file via a simple http server from my workstation.

So I had a kickstart file that looked like this:

$ cat centosah-ks.cfg 
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# OSTree setup
ostreesetup --osname="centos-atomic-host" --remote="centos-atomic-host" --url="http://192.168.124.1:9001/repo" --ref="centos-atomic-host/7/x86_64/standard" --nogpg
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=vda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8

# Network information
network  --bootproto=dhcp --device=eth0 --ipv6=auto --activate
network  --hostname=localhost.localdomain

# Root password
rootpw --iscrypted $6$yXkPE0CcYu/wBwA4$2w7bLHPLyhACnxRDuX.kHqMEEXlXAE8cXTWQFuHZUdsSWcF3lp5t3C5u0SMn.NUTN0grjEzhbw0P35h2EkF29.
# System services
services --disabled="cloud-init,cloud-config,cloud-final,cloud-init-local"
# System timezone
timezone America/New_York --isUtc
user --groups=wheel --name=cloud-user --password=$6$WxFBq5RW8UNAs8rD$hC8BF5F34EQqnU7ZOMJtEB.D9yeDAKe7fh78.x7tKJDq/ZHe/j8ZFRjAlmuYSku58QLFKb33WcueNF4Aap.wg1 --iscrypted --gecos="Cloud User"
# System bootloader configuration
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=vda
autopart --type=lvm
# Partition clearing information
clearpart --all --initlabel --drives=vda

%post --erroronfail
fn=/etc/ostree/remotes.d/centos-atomic-host.conf; if test -f ${fn} && grep -q -e '^url=file:///install/ostree' ${fn}$; then rm ${fn}; fi
%end

%packages
kexec-tools

%end

%addon com_redhat_kdump --enable --reserve-mb='auto'

%end

I served up the kickstart file via HTTP. And then I edited the vmlinuz parameters during boot to include the ks argument:

> vmlinuz initrd=initrd.img inst.stage2=hd:LABEL=CentOS\%20Atomic\%20Host\%207\%20x86_64 ks=http://192.168.124.1:9001/centosah-ks.cfg

I imagine there is some way to edit the vmlinuz parameters during PXE boot so you can point to a customized kickstart file?

@kamesh2229
Copy link
Author

Hi,

Thanks for the detailed explanation.
Is there any way where i can download the repo directly using wget http://mirror.centos.org/centos/7/atomic/x86_64/repostandard@e39c28570a7ceb765feed1a0f017b94641e75137afd317730c7cd3a6651492f6

kind of such that i can get the repo donwloaded instead of pulling using ostree-pull ?

Regards,
Kamesh.

@miabbott
Copy link
Contributor

miabbott commented Jan 7, 2019

It would be really impractical to try to use wget to mirror the repo like that because of the way the files have been hashed and organized. It would involve unrolling the commit data to find and retrieve each individual file that corresponds to the commit.

This is something that the ostree binary does natively and is really the best tool for the job.

@kamesh2229
Copy link
Author

Hi again,

I managed to download the required repo using ostree command.
As said since i already have a system installed with 7.20160203 i tried to copy the downloaded repo to the system installed with 7.20160203 to check if i can upgrade using atomic host upgrade but i am getting the below error

-bash-4.2# atomic host upgrade
Updating from: localmedia:centos-atomic-host/7/x86_64/standard
error: Multiple specifications found for remote "centos-atomic-host"

What i am doing is

  1. Logged to the system where 7.20160203 is installed
  2. Went to the path /sysroot/ostree
  3. copied the downloaded repo folder here i.e /sysroot/ostree/repo and this repo contains the downloaded repo that i need to install.
  4. Executed atomic host upgrade

I am getting the above error and i checked the various sites and it was mentioned that this is a bug .. but i couldn't check the solution anywhere..

can you please let me know if i can do this way ? Am i doing something wrong and if it is a bug is there any way i can solve ?

Please let me know.

Regards,
Kamesh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants