Open hu-weihua opened 5 years ago
Need to re-init the data (xcatconfig -i xcatconfig -d) when first run the container, then xcatconfig will populate the DB from based on the current networking.
Now the data is only from xcat installation (this is when building the container)
And the container will do the init with rc-local
script, its contents are from entrypoint.sh
.
The rc-local
should be called by systemd
, but looks like it is not working as expected always. Need to check if there is a service dependency issue.
With the same steps, i also got some results. Same with above, the network table is not set up correctly.
#netname,net,mask,mgtifname,gateway,dhcpserver,tftpserver,nameservers,ntpservers,logservers,dynamicrange,staticrange,staticrangeincrement,nodehostname,ddnsdomain,vlanid,domain,mtu,comments,disable
"172_17_0_0-255_255_0_0","172.17.0.0","255.255.0.0","eth0","172.17.0.1",,"<xcatmaster>",,,,,,,,,,,"1500",,
And the site table is not set correctly
[root@c910f03c01p16 autotest]# docker exec xcatmn tabdump site
#key,value,comments,disable
"blademaxp","64",,
"fsptimeout","0",,
"installdir","/install",,
"ipmimaxp","64",,
"ipmiretries","3",,
"ipmitimeout","2",,
"consoleondemand","no",,
"master","172.17.0.2",,
"forwarders","10.0.0.103",,
"nameservers","172.17.0.2",,
"maxssh","8",,
"ppcmaxp","64",,
"ppcretry","3",,
"ppctimeout","0",,
"powerinterval","0",,
"syspowerinterval","0",,
"sharedtftp","1",,
"SNsyncfiledir","/var/xcat/syncfiles",,
"nodesyncfiledir","/var/xcat/node/syncfiles",,
"tftpdir","/tftpboot",,
"xcatdport","3001",,
"xcatiport","3002",,
"xcatconfdir","/etc/xcat",,
"timezone","Etc/UTC",,
"useNmapfromMN","no",,
"enableASMI","no",,
"db2installloc","/mntdb2",,
"databaseloc","/var/lib",,
"sshbetweennodes","ALLGROUPS",,
"dnshandler","ddns",,
"vsftp","n",,
"cleanupxcatpost","no",,
"dhcplease","43200",,
"auditnosyslog","0",,
"auditskipcmds","ALL",,
I have tried xcatconfig -i
after container starting, the networks
table was able to be updated, but he site
table still had "master","172.17.0.2",,
. Maybe need more work in xcat container initial script.
Try to fix this in https://github.com/xcat2/xcat-docker/pull/14
Still found issue in the above PR.
xcatconfig -i
won't populate site table when it is already there, so it requires to xcatconfig -d
first, and then xcatconfig -i
; not using other combination of -c
, -k
as there are too much logic in xcatconfig
.
Testing:
1, build a new container make build VERSION=latest
2, push to xcatdevops
for later testing
docker tag xcat2:2.14.6-x86_64 xcatdevops/xcat2:2.14.6-x86_64
# docker login -u robin2008
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
# docker push xcatdevops/xcat2:2.14.6-x86_64
The push refers to repository [docker.io/xcatdevops/xcat2]
1c31f3458fc9: Pushed
b03b48b5dc6f: Pushed
aca4bbf46e46: Pushed
9e3dcfa22a57: Pushing [===========> ] 196.1MB/850.5MB
b162b9cc72b1: Pushed
ce451e0c3a23: Layer already exists
bcc97fbfc9e1: Layer already exists
docker logout
3, pull it and testing
docker run -d --name xcatmn --network=host --hostname c910f04x27v22 --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro -v /xcatdata:/xcatdata -v /root/.ssh:/root/.ssh xcatdevops/xcat2:2.14.6-x86_64
Unable to find image 'xcatdevops/xcat2:2.14.6-x86_64' locally
2.14.6-x86_64: Pulling from xcatdevops/xcat2
...
4, check the result
docker exec -it xcatmn /bin/bash
[root@c910f04x27v22 /]# tabdump networks
#netname,net,mask,mgtifname,gateway,dhcpserver,tftpserver,nameservers,ntpservers,logservers,dynamicrange,staticrange,staticrangeincrement,nodehostname,ddnsdomain,vlanid,domain,mtu,comments,disable
"172_17_0_0-255_255_0_0","172.17.0.0","255.255.0.0","eth0","172.17.0.1",,"<xcatmaster>",,,,,,,,,,,"1500",,
"10_0_0_0-255_0_0_0","10.0.0.0","255.0.0.0","eth0","10.0.0.101",,"<xcatmaster>",,,,,,,,,,,"1500",,
[root@c910f04x27v22 /]# tabdump site|grep domain
"domain","example.com",,
[root@c910f04x27v22 /]# tabdump site|grep master
"master","10.4.27.22",,
okay, this is covered in #15, and the container is uploaded, please verify it.
@robin2008 , it seems the network is set correctly, but the master in site table still is 172.17.0.2
.
[root@xcat2latest /]# tabdump networks
#netname,net,mask,mgtifname,gateway,dhcpserver,tftpserver,nameservers,ntpservers,logservers,dynamicrange,staticrange,staticrangeincrement,nodehostname,ddnsdomain,vlanid,domain,mtu,comments,disable
"172_17_0_0-255_255_0_0","172.17.0.0","255.255.0.0","eth0","172.17.0.1",,"<xcatmaster>",,,,,,,,,,,"1500",,
"10_0_0_0-255_0_0_0","10.0.0.0","255.0.0.0","eth1","10.0.0.101",,"<xcatmaster>",,,,,,,,,,,"1500",,
[root@xcat2latest /]# tabdump site
#key,value,comments,disable
"blademaxp","64",,
"fsptimeout","0",,
"installdir","/install",,
"ipmimaxp","64",,
"ipmiretries","3",,
"ipmitimeout","2",,
"consoleondemand","no",,
"master","172.17.0.2",,
"forwarders","10.0.0.103",,
"nameservers","172.17.0.2",,
"maxssh","8",,
"ppcmaxp","64",,
"ppcretry","3",,
"ppctimeout","0",,
"powerinterval","0",,
"syspowerinterval","0",,
"sharedtftp","1",,
"SNsyncfiledir","/var/xcat/syncfiles",,
"nodesyncfiledir","/var/xcat/node/syncfiles",,
"tftpdir","/tftpboot",,
"xcatdport","3001",,
"xcatiport","3002",,
"xcatconfdir","/etc/xcat",,
"timezone","Etc/UTC",,
"useNmapfromMN","no",,
"enableASMI","no",,
"db2installloc","/mntdb2",,
"databaseloc","/var/lib",,
"sshbetweennodes","ALLGROUPS",,
"dnshandler","ddns",,
"vsftp","n",,
"cleanupxcatpost","no",,
"dhcplease","43200",,
"auditnosyslog","0",,
"auditskipcmds","ALL",,
Start xCAT container, the networks table has not been set up correctly.
The provision network is 10 network
How to start xcat container
The Nic info in container
[root@c910f04x30v02 xcat]# ip addr 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 42:cb:0a:04:1e:03 brd ff:ff:ff:ff:ff:ff inet 10.4.30.3/8 brd 10.255.255.255 scope global dynamic eth0 valid_lft 42604sec preferred_lft 42604sec inet6 fe80::40cb:aff:fe04:1e03/64 scope link valid_lft forever preferred_lft forever 3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default link/ether 02:42:d1:89:c2:e4 brd ff:ff:ff:ff:ff:ff inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0 valid_lft forever preferred_lft forever
[root@c910f04x30v02 xcat]# tabdump networks
netname,net,mask,mgtifname,gateway,dhcpserver,tftpserver,nameservers,ntpservers,logservers,dynamicrange,staticrange,staticrangeincrement,nodehostname,ddnsdomain,vlanid,domain,mtu,comments,disable
"172_17_0_0-255_255_0_0","172.17.0.0","255.255.0.0","eth0","172.17.0.1",,"",,,,,,,,,,,"1500",,