From e11fc2c3b4ec53c591aaff0a331deef55a8fe23d Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 7 Nov 2008 14:11:05 +0000 Subject: [PATCH] -Fix problem where failed migration caused xCAT to lose track of Xen hypervisor -Fix problem where the gPXE dhcp configuration would not work git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2472 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/dhcp.pm | 5 ++++- xCAT-server/lib/xcat/plugins/xen.pm | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 61027640d..647e3d153 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -233,7 +233,7 @@ sub addnode if ($chainent and $chainent->{currstate} and $chainent->{currstate} eq 'iscsiboot') { $lstatements = 'if exists gpxe.bus-id { filename = \"\"; } else { filename = \"undionly.kpxe\"; } '.$lstatements; } else { - $lstatements = 'if exists gpxe.bus-id { filename = \"pxelinux.0\"; } else { filename = \"undionly.kpxe\"; } '.$lstatements; + $lstatements = 'if exists gpxe.bus-id { filename = \"pxelinux.0\"; } else if exists client-architecture { filename = \"undionly.kpxe\"; } '.$lstatements; #Only PXE compliant clients should ever receive gPXE } } #TODO: warn when windows } @@ -768,6 +768,9 @@ sub newconfig push @dhcpconf, "#xCAT generated dhcp configuration\n"; push @dhcpconf, "\n"; push @dhcpconf, "authoritative;\n"; + push @dhcpconf, "option space gpxe;\n"; + push @dhcpconf, "option gpxe-encap-opts code 175 = encapsulate gpxe;\n"; + push @dhcpconf, "option gpxe.bus-id code 177 = string;\n"; push @dhcpconf, "ddns-update-style none;\n"; push @dhcpconf, "option client-architecture code 93 = unsigned integer 16;\n"; diff --git a/xCAT-server/lib/xcat/plugins/xen.pm b/xCAT-server/lib/xcat/plugins/xen.pm index 087e6461a..d47c9637c 100644 --- a/xCAT-server/lib/xcat/plugins/xen.pm +++ b/xCAT-server/lib/xcat/plugins/xen.pm @@ -275,13 +275,13 @@ sub migrate { eval { $dom = $newhypconn->get_domain_by_name($node); }; - $vmtab->setNodeAttribs($node,{host=>$targ}); if ($dom) { refresh_vm($dom); } if ($rc) { return (1,"Failed migration from $prevhyp to $targ"); } else { + $vmtab->setNodeAttribs($node,{host=>$targ}); return (0,"migrated to $targ"); } }