2017-08-24 40 views
0

我在kickstart Virtuozzo上安装后出现问题。使用kickstart,我可以正常安装OS Virtuozzo。但是在我尝试使用安装后脚本添加后,脚本prl出现问题。安装后的Virtuozzo Kickstart

下面是我的脚本安装后:

%post --log=/root/ks-post.log 

# delete all virtual network 
while true; do prlsrvctl net list | awk {'print $1}' | tail -n +2 | while read line; do prlsrvctl net del $line; done && echo -e "$(date)\tSuccess" && break; echo -e "$(date)\tFailed"; systemctl status prl-disp.service; sleep 15; done 

# delete all interface include bridge network 
brctl show| awk {'print $1'}| tail -n +2| while read line; do ip link set $line down && brctl delbr $line; done 
nmcli c s|awk {'print $1'}| tail -n +2| while read line; do nmcli c down $line && ip link set $line nomaster && nmcli c d $line; done 
#ip a| awk -F: {'print $2'}| grep 'br\|enp'| awk -F @ {'print $1'}| while read line; do ip link set $line down; done 
#ip a| awk -F: {'print $2'}| grep enp| awk -F @ {'print $1'}| while read line; do ip link set $line nomaster; done 

# create virtual network 
for net in net01 net02 net03; do prlsrvctl net add $net; done 

# create interface 
nmcli c a type vlan con-name enp2s0f0.501 dev enp2s0f0 id 501 master virbr2 
nmcli c a type ethernet con-name enp2s0f0 ifname enp2s0f0 master virbr1 
nmcli c a type ethernet con-name enp2s0f1 ifname enp2s0f0 master virbr3 
nmcli c s| grep bridge| awk {'print $1'}| while read line; do nmcli c m $line connection.autoconnect yes ipv4.method auto bridge.stp yes bridge.forward-delay 15; done 

# delete ip link virbr#-nic 
ip a| awk -F: {'print $2'}| grep nic| while read line; do ip link del $line; done 

# restart network 
systemctl restart network 

# up2date 
yum update -y; yum install epel-release -y; yum update -y 

# set hostname 
dig -x 192.168.75.206 +short |sed 's/.$//' > /etc/hostname; hostname -F /etc/hostname 
echo "hostname changed. below is the hostname" 
cat /etc/hostname 

# reboot 
reboot 
%end 

当我检查记录,有与命令PRL问题。这些就像prl-disp没有运行。

Login failed: Unable to connect to Virtuozzo. You may experience a connection problem or the server may be down. Contact your Virtuozzo administrator for assistance. 
Virtual network has been deleted 
Connection 'enp2s0f0' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/0) 
Error: 'enp2s0f0' is not an active connection. 
Error: no active connection provided. 
Error: 'enp2s0f1' is not an active connection. 
Error: no active connection provided. 
Interface are cleaned 
Login failed: Unable to connect to Virtuozzo. You may experience a connection problem or the server may be down. Contact your Virtuozzo administrator for assistance. 
Login failed: Unable to connect to Virtuozzo. You may experience a connection problem or the server may be down. Contact your Virtuozzo administrator for assistance. 
Login failed: Unable to connect to Virtuozzo. You may experience a connection problem or the server may be down. Contact your Virtuozzo administrator for assistance. 
virtual network virtuozzo are created 
Warning: master='virbr2' doesn't refer to any existing profile. 
Error: Failed to add 'enp2s0f0.501' connection: connection.slave-type: Cannot set 'master' without 'slave-type' 
Warning: master='virbr1' doesn't refer to any existing profile. 
Error: Failed to add 'enp2s0f0' connection: connection.slave-type: Cannot set 'master' without 'slave-type' 
Warning: master='virbr3' doesn't refer to any existing profile. 
Error: Failed to add 'enp2s0f1' connection: connection.slave-type: Cannot set 'master' without 'slave-type' 
interface are prepared, restart network for discover an IP address 
interface virbr with nic has been deleted 
Running in chroot, ignoring request. 
network restarted 
Loaded plugins: fastestmirror, langpacks, priorities, product-id, refresh- 
       : packagekit, rhsm-auto-add-pools, search-disabled-repos, shaman, 
       : virtuozzo, vzlinux, yum-plugin-readykernel 
Unable to send message to PackageKit 
Trying to discover and attach new pools 


One of the configured repositories failed (Unknown), 
and yum doesn't have enough cached data to continue. At this point the only 
safe thing yum can do is fail. There are a few ways to work "fix" this: 

    1. Contact the upstream for the repository and get them to fix the problem. 

    2. Reconfigure the baseurl/etc. for the repository, to point to a working 
     upstream. This is most often useful if you are using a newer 
     distribution release than is supported by the repository (and the 
     packages for the previous distribution release still work). 

    3. Run the command with the repository temporarily disabled 
      yum --disablerepo=<repoid> ... 

    4. Disable the repository permanently, so yum won't use it by default. Yum 
     will then just ignore the repository until you permanently enable it 
     again or use --enablerepo for temporary usage: 

      yum-config-manager --disable <repoid> 
     or 
      subscription-manager repos --disable=<repoid> 

    5. Configure the failing repository to be skipped, if it is unavailable. 
     Note that yum will try to contact the repo. when it runs most commands, 
     so will have to try and fail each time (and thus. yum will be be much 
     slower). If it is a very temporary problem though, this is often a nice 
     compromise: 

      yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true 

Cannot find a valid baseurl for repo: virtuozzo-os 
Could not retrieve mirrorlist http://repo.virtuozzo.com/vz/mirrorlists/7.0/releases-os.mirrorlist error was 
14: curl#6 - "Could not resolve host: repo.virtuozzo.com; Unknown error" 
Loaded plugins: fastestmirror, langpacks, priorities, product-id, refresh- 
       : packagekit, rhsm-auto-add-pools, search-disabled-repos, shaman, 
       : virtuozzo, vzlinux, yum-plugin-readykernel 
Unable to send message to PackageKit 
Trying to discover and attach new pools 


One of the configured repositories failed (Unknown), 
and yum doesn't have enough cached data to continue. At this point the only 
safe thing yum can do is fail. There are a few ways to work "fix" this: 

    1. Contact the upstream for the repository and get them to fix the problem. 

    2. Reconfigure the baseurl/etc. for the repository, to point to a working 
     upstream. This is most often useful if you are using a newer 
     distribution release than is supported by the repository (and the 
     packages for the previous distribution release still work). 

    3. Run the command with the repository temporarily disabled 
      yum --disablerepo=<repoid> ... 

    4. Disable the repository permanently, so yum won't use it by default. Yum 
     will then just ignore the repository until you permanently enable it 
     again or use --enablerepo for temporary usage: 

      yum-config-manager --disable <repoid> 
     or 
      subscription-manager repos --disable=<repoid> 

    5. Configure the failing repository to be skipped, if it is unavailable. 
     Note that yum will try to contact the repo. when it runs most commands, 
     so will have to try and fail each time (and thus. yum will be be much 
     slower). If it is a very temporary problem though, this is often a nice 
     compromise: 

      yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true 

Cannot find a valid baseurl for repo: virtuozzo-os 
Could not retrieve mirrorlist http://repo.virtuozzo.com/vz/mirrorlists/7.0/releases-os.mirrorlist error was 
14: curl#6 - "Could not resolve host: repo.virtuozzo.com; Unknown error" 
Loaded plugins: fastestmirror, langpacks, priorities, product-id, refresh- 
       : packagekit, rhsm-auto-add-pools, search-disabled-repos, shaman, 
       : virtuozzo, vzlinux, yum-plugin-readykernel 
Unable to send message to PackageKit 
Trying to discover and attach new pools 


One of the configured repositories failed (Unknown), 
and yum doesn't have enough cached data to continue. At this point the only 
safe thing yum can do is fail. There are a few ways to work "fix" this: 

    1. Contact the upstream for the repository and get them to fix the problem. 

    2. Reconfigure the baseurl/etc. for the repository, to point to a working 
     upstream. This is most often useful if you are using a newer 
     distribution release than is supported by the repository (and the 
     packages for the previous distribution release still work). 

    3. Run the command with the repository temporarily disabled 
      yum --disablerepo=<repoid> ... 

    4. Disable the repository permanently, so yum won't use it by default. Yum 
     will then just ignore the repository until you permanently enable it 
     again or use --enablerepo for temporary usage: 

      yum-config-manager --disable <repoid> 
     or 
      subscription-manager repos --disable=<repoid> 

    5. Configure the failing repository to be skipped, if it is unavailable. 
     Note that yum will try to contact the repo. when it runs most commands, 
     so will have to try and fail each time (and thus. yum will be be much 
     slower). If it is a very temporary problem though, this is often a nice 
     compromise: 

      yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true 

Cannot find a valid baseurl for repo: virtuozzo-os 
Could not retrieve mirrorlist http://repo.virtuozzo.com/vz/mirrorlists/7.0/releases-os.mirrorlist error was 
14: curl#6 - "Could not resolve host: repo.virtuozzo.com; Unknown error" 
hostname: the specified hostname is invalid 
hostname changed. below is the hostname 

; <<>> DiG 9.9.4-RedHat-9.9.4-38.vl7.2 <<>> -x 192.168.75.206 +shor 
;; global options: +cm 
;; connection timed out; no servers could be reache 
Running in chroot, ignoring request. 

该限制使我的配置无法正常工作。

从安装后,我应该做什么命令/配置?现在我只是在学习它。所以我真的需要一些线索来理解这个问题的原因。

对不起,我英语不好,谢谢。

回答

0

有点晚回答,但希望这可以帮助某人。你没有说明你正在尝试安装哪个版本的Virtuozzo,但我会假设Virtuozzo 7,因为我本人不会用Virtuozzo 6建立任何新系统。

你发布的错误似乎表明你没有网络在安装后配置,我可以看到你的安装后操作,你正在禁用网络,它不会再次安装。这可以防止prl-disp正常工作,并且不允许prlsrvctl在之后运行(尽管它在删除所有默认Virtuozzo网桥的步骤中起作用)。这也是最后YUM错误的原因。

您的安装后应用标准kickstart选项来处理很多操作。

应使用kickstart中的“网络”选项处理主机名,网络设备和所有nmcli。

更好的方法是使用默认的GUI安装程序来手动配置一个系统,一旦你有了一个可以使用的安装,你就可以得到kickstart(应该位于/ root/original-ks。在新安装的系统上使用cfg),然后在安装后添加特殊的酱汁。通过这种方式,您可以开始使用已知可用的基本kickstart并知道您的所有网络设备名称,然后添加自定义设置。