Hi all,
I’m running v6.0 and I am somewhat confused over the execution process when creating VMs. I have some scripts that need to be executed when a system is brought up for the first time. One of them, repository-setup.sh, retrieves a .repo file from another server in the network and then runs “yum update” against the RPMs that are on that same server. These are stored in the Files repository in ON and are configured as CONTEXT variables in the VM templates:
CONTEXT = [
FILES_DS = "$FILE[IMAGE=\"sshd-configuration.sh\", IMAGE_UNAME=\"oneadmin\"] $FILE[IMAGE=\"create-profile.sh\", IMAGE_UNAME=\"oneadmin\"] $FILE[IMAGE=\"install-packages.sh\", IMAGE_UNAME=\"oneadmin\"] $FILE[IMAGE=\"repository-setup.sh\", IMAGE_UNAME=\"oneadmin\"]",
INIT_SCRIPTS = "sshd-configuration.sh create-profile.sh repository-setup.sh install-packages.sh",
NETWORK = "YES",
SSH_PUBLIC_KEY = "ecdsa-sha2-nistp256 AAAAblahblahblah....= oneadmin@on1.test.lab" ]
the problem is that, although the network looks like it is properly set up as in it has an IP address, the DNS server is correctly configured.
I modified the script to print IP and routing information to a file in the root directory so that I could see what state things were in when the script was executed and I see the following:
+ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 02:00:ac:1f:20:18 brd ff:ff:ff:ff:ff:ff
inet 172.31.32.24/16 brd 172.31.255.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::acff:fe1f:2018/64 scope link
valid_lft forever preferred_lft forever
+ ip route
default via 172.31.0.1 dev eth0
172.31.0.0/16 dev eth0 proto kernel scope link src 172.31.32.24
This is all absolutely fine and is exactly how the network looks once I can login. However the script is unable to access the server that contains the repo files:
+ curl -o /etc/yum.repos.d/lab.repo http://repos.test.lab/lab-el7.repo
curl: (6) Could not resolve host: repos.test.lab; Unknown error
If I replace “repos.test.lab” with the actual IP address it still fails, this time with “No route to host”.
These tests suggest that although the network is configured within the VM, ON has not yet set up any links to the virtual network so the VM cannot actually access any other hosts on the network at this time.
Is there any way to have the INIT_SCRIPTS scripts run when there is a fully-working network?
Any thoughts on what ON is doing at this point?
|\/|artin