On Thu, 6 Aug 2020, Denis Silakov wrote:

You clone the repo inside the rpmbuild/SOURCES folder, so you get all sources 
inside rpmbuild/SOURCES/fedora-32-x86_64-ez folder, not inside rpmbuild/SOURCES 
itself.

Just copy the files to the SOURCES folder directly, e.g.:
vrpmbuild/SOURCES
# cd rpmbuild/SOURCES
# git clone -b dist-vz7-u15 
https://src.openvz.org/scm/ovzt/fedora-32-x86_64-ez.git
# cp fedora-32-x86_64-ez/os*  fedora-32-x86_64-ez/*packages .
...

Also make sure that there no other files in rpmbuild/SOURCES, otherwise the 
template can pick up them.

Great, with this a clone of the default branch (dist-vz7-u12) of fedora-30-x86_64-ez results in an rpm that allows creating a bootable fedora-30 container. It is only lacking the network-scripts package, so networking does not start automatically at boot time before bringing up the new container's interface manually and installing the rpm. I expect this should be easily fixable by adding "network-scripts" to the "os_packages" source.

The fedora-32-x86_64-ez dist-vz7-u15 source seems to contain a problem.
Container creation fails, because the cache creation step fails for "repo 'base2'". Running vzpkg create cache we get:

# vzpkg create cache fedora-32-x86_64
Creating OS template cache for fedora-32-x86_64 template
Cache was expired
18 files removed
base0 5.0 MB/s |  63 MB     00:12
base1 4.6 MB/s |  25 MB     00:05
base2 876  B/s | 319  B     00:00
Error: Failed to synchronize cache for repo 'base2'
Error: /usr/share/vzyum/bin/yum failed, exitcode=1



The root of the problem is that template authors are quite lazy to declare 
every source file separately in spec, so the spec looks for sources in a rather 
tricky way:

%define sources_lst() \
%((cd %_sourcedir;\
s=1;\
for tmpl in %1; do\
sources=$tmpl"_*";\
for file in $sources; do\
echo Source$s: $file;\
s=$((s+1))\
done;\
done))\
%nil

%define templates_list() %((cd %_sourcedir; for f in *_packages; do echo -n "${f%_*} 
"; done))

The latter command scans _sourcedir recursively so it finds *_packages files 
even in subfolders. But the former macro doesn't look into subfolders so at 
least os* files are missing.
________________________________
From: users-boun...@openvz.org <users-boun...@openvz.org> on behalf of Peter Schultze 
<peter...@cs.ucla.edu>
Sent: Thursday, August 6, 2020 3:17 AM
To: OpenVZ users <users@openvz.org>
Subject: Re: [Users] Fedora-3x template packages

On Wed, 5 Aug 2020, Denis Silakov wrote:

I guess there are no docs, but the process is rather simple - clone the repo, 
checkout a branch corresponding to the development version (dist-vz7-u15 atm), 
copy all files to your ~/rpmbuild/SOURCES folder and launch rpmbuild -bb *spec.

I am evidently still missing something. Building and installing an rpm
ran without errors:

# cd rpmbuild/SOURCES
# git clone -b dist-vz7-u15 
https://src.openvz.org/scm/ovzt/fedora-32-x86_64-ez.git

# cd
# rpmbuild -bb rpmbuild/SOURCES/fedora-32-x86_64-ez/fedora-32-x86_64-ez.spec
# yum localinstall 
rpmbuild/RPMS/noarch/fedora-32-x86_64-ez-7.0.0-1.vl7.noarch.rpm

However, the resulting rpm contains no os files:

# rpm -ql fedora-32-x86_64-ez-7.0.0-1.vl7.noarch
/vz/template/fedora/32/x86_64/config/app/*/default
/vz/template/fedora/32/x86_64/config/app/*/default/description
/vz/template/fedora/32/x86_64/config/app/*/default/release
/vz/template/fedora/32/x86_64/config/app/*/default/summary
/vz/template/fedora/32/x86_64/config/app/*/default/version

and container generation of course fails:
# prlctl create F32 --vmtype ct --ostemplate fedora-32-x86_64
Creating the Container...
Failed to register the CT: PRL_ERR_VZCTL_OPERATION_FAILED (Details: Error:
Unable to find ostemplate: fedora-32-x86_64
Creation of Container private area failed)
Failed to create the virtual machine.


What am I missing?



________________________________
From: users-boun...@openvz.org <users-boun...@openvz.org> on behalf of Peter Schultze 
<peter...@cs.ucla.edu>
Sent: Wednesday, August 5, 2020 11:01 PM
To: users@openvz.org <users@openvz.org>
Subject: [Users] Fedora-3x template packages

Hello,

https://src.openvz.org/projects/OVZT has entries for Fedora-30 and
Fedora-32. However, the most recent rpm package available in the normal
OpenVZ 7.0 repository is fedora-23-x86_64-ez

Does documentation exist on how to build a template from the available
sources?

Peter S.

_______________________________________________
Users mailing list
Users@openvz.org
https://lists.openvz.org/mailman/listinfo/users


--
Peter Schultze
UCLA Computer Science Department                    310-825-9929
_______________________________________________
Users mailing list
Users@openvz.org
https://lists.openvz.org/mailman/listinfo/users


--
Peter Schultze
UCLA Computer Science Department                    310-825-9929
_______________________________________________
Users mailing list
Users@openvz.org
https://lists.openvz.org/mailman/listinfo/users

Reply via email to