|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-users] Xen 4.2.2 /etc/init.d/xendomains save and restore of domains does not work
first sorry that I explained it bad but my English is not very well:second I realize why you could not reproduce my problems under xl JSON format: short: my symlink names in $XENDOMAINS_AUTO differ from the "real" domain name. Later more about that Problem description detail:File: /etc/init.d/xendomains (from 4.3 git commit543a2657182dbb9237d1feeb1d3193096ab2cb2d )
The sed "expression in function rdname()
rdname()
{
NM=$($CMD create --quiet --dryrun --defconfig "$1" |
sed -n 's/^.*(name \(.*\))$/\1/p')
}
called by
is_running $dom
called from
start
in the if block
if contains_something "$XENDOMAINS_AUTO"
then
[....]
if [ $? -eq 0 ] || is_running $dom; then
works only for the SXP format and not for the JSON format. For
JSON fromat the funktion is_running $dom will nearly always return false
Example to show that:root@srv01:~# xl create --quiet --dryrun --defconfig /etc/xen/auto/03_gnomedag | head -10
{
"domid": null,
"config": {
"c_info": {
"type": "pv",
"hap": "<default>",
"oos": "<default>",
"ssidref": 0,
"name": "gnomedag",
"uuid": "2d33d9c8-7efe-4060-8e61-b47af2796a5c",
root@srv01:~#
root@srv01:~# xl create --quiet --dryrun --defconfig
/etc/xen/auto/03_gnomedag \
| sed -n 's/^.*(name \(.*\))$/\1/p' root@srv01:~#So $NM will always be empty and is_running() will nearly always return false;
is_running()
{
rdname $1
RC=1
name=;id=
while read LN; do
parseln "$LN" || continue
if test $id = 0; then continue; fi
case $name in
($NM)
RC=0
;;
esac
done < <($CMD list -l | grep "$LIST_GREP")
return $RC
}
In contrast my sed "expression" will work for JSON format but not for
SXP (Yes with that you are right. Sorry ! Up to now I did not know or
have forgotten that xl supports both formats).
root@srv01:~# xl create --quiet --dryrun --defconfig /etc/xen/auto/03_gnomedag \ | sed -n 's/^.*"name": "\(.*\)",$/\1/p' gnomedag root@srv01:~# That is what I expected for JSON format. I found why our both test have different results for the JSON fromat:On my System (historical reason) the name of the symlinks in $XENDOMAINS_AUTO/* differ from the "real" domain name (example: domain name: gnomedag symlink name: /etc/xen/auto/03_gnomedag -> /etc/xen/gnomedag.cfg).
shortdom=$(echo $dom | sed -n 's/^.*\/\(.*\)$/\1/p')
echo $saved_domains | grep -w $shortdom > /dev/null
if [ $? -eq 0 ] || is_running $dom; then
echo -n "(skip)"
else
In your configuration the restored domain names are filtered by the
echo ... | grep -w ... instruction. So
is_running $dom is never called for them. So you will never see the
semantical error produced by rdname().
In my system the "real" domain name stored in saved_domains differ from the value in $dom. So is_running $dom is always called and always returns false. Which leads to a "second start" of the already restored domain. In the moment I have no good idea how to combine the two needed sed expressions for the rdname() function sed -n 's/^.*(name \(.*\))$/\1/p' #SXP sed -n 's/^.*"name": "\(.*\)",$/\1/p' #JSON On 07/01/13 02:06, Ian Murray wrote: I download the file by from git and give him a chance. It works nearly perfect.It appears to be working fine for me. I am running 4.3 rc 6 + next commit. Rather than saying the output has changed for xl, I think you may be referring to the fact that xl now can output JSON as well as xm's SXP. Having said this, xendomains works both properly for me both using JSON and SXP although I am not sure why the skipping of the autostart domains is working when I select JSON in xl.conf. Certainly the xl ... sed line fails when I execute it manually when using JSON.On xendomains stop there was all ok.On xendomains start it restores the saved domains but after that it tries to start them again and produce some error messages like domain is already running.I think your solution is not the right approach because xl can produce JSON and SXP format and that is defined in xl.conf. Your solution will have a problem when setting xl to produce SXP, I think.root@xen6:/etc/xen/auto# service xendomains stopShutting down Xen domains: ubuntu-email(save)................................vpn2(save).... * [done] root@xen6:/etc/xen/auto# service xendomains start Restoring Xen domains: ubuntu-email vpn2 Starting auto Xen domains: ubuntu-email(skip) vpn2(skip) * [done] Not tested against xm as I have no means to do so.The reason is the sed script in rdname() does not work with xl output.I'll changed it in the way as you have done with HEADCOMP (see the diff below). _______________________________________________ Xen-users mailing list Xen-users@xxxxxxxxxxxxx http://lists.xen.org/xen-users
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |