[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-API] [PATCH] # HG changeset patch


  • To: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
  • From: Rob Hoes <rob.hoes@xxxxxxxxxx>
  • Date: Wed, 24 Feb 2010 14:36:25 +0000
  • Delivery-date: Wed, 24 Feb 2010 06:37:07 -0800
  • List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>

# HG changeset patch
# User Rob Hoes <rob.hoes@xxxxxxxxxx>
# HG changeset patch
# User Rob Hoes <rob.hoes@xxxxxxxxxx>
CA-38014: Pool.create_VLAN_from_PIF should not try to create VLANs on offline 
hosts

When the hosts come online again, the startup sequence will copy the VLANs from 
the master.

Signed-off-by: Rob Hoes <rob.hoes@xxxxxxxxxx>

diff -r 3f6cca4efa73 ocaml/xapi/xapi_pool.ml
--- a/ocaml/xapi/xapi_pool.ml   Tue Feb 23 12:28:47 2010 +0000
+++ b/ocaml/xapi/xapi_pool.ml   Tue Feb 23 16:28:45 2010 +0000
@@ -850,6 +850,11 @@
      in order to satisfy ca-22381 *)
   let network_to_get_pifs_from = Db.PIF.get_network ~__context ~self:pif in
   let pifs_on_network = Db.Network.get_PIFs ~__context 
~self:network_to_get_pifs_from in
+  let pifs_on_live_hosts =
+    List.filter (fun p -> 
+      let h = Db.PIF.get_host ~__context ~self:p in
+      Db.Host.get_enabled ~__context ~self:h = true
+    ) pifs_on_network in
   (* Keep track of what we've created *)
   let created = ref [] in
   Helpers.call_api_functions ~__context
@@ -867,7 +872,7 @@
                  safe_destroy_VLANs ~__context !created;
                  raise e
           )
-          pifs_on_network in
+          pifs_on_live_hosts in
        let vlan_pifs = List.map (fun vlan -> Db.VLAN.get_untagged_PIF 
~__context ~self:vlan) vlans in
        (* CA-22381: best-effort plug of the newly-created VLAN PIFs. Note if 
any of these calls fail
          then nothing is rolled-back and the system will be left with some 
unplugged VLAN PIFs, which may

Attachment: pool-vlan-create
Description: Text document

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.