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

[Xen-API] [PATCH] Never allow to PIF.unplug the management interface.


  • To: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
  • From: Rob Hoes <rob.hoes@xxxxxxxxxx>
  • Date: Tue, 24 Nov 2009 17:59:31 +0000
  • Delivery-date: Tue, 24 Nov 2009 09:59:45 -0800
  • List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>

# HG changeset patch
# User Rob Hoes <rob.hoes@xxxxxxxxxx>
Never allow to PIF.unplug the management interface.

This was already the case for pool slaves, but now also for the master, to 
prevent you from ending up in a bad state. If you want to unplug the management 
on the master, you should first call host.management_disable.

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

diff -r d292d82531ad ocaml/xapi/nm.ml
--- a/ocaml/xapi/nm.ml  Tue Nov 24 13:18:17 2009 +0000
+++ b/ocaml/xapi/nm.ml  Tue Nov 24 17:56:56 2009 +0000
@@ -83,12 +83,6 @@
     (fun () ->
        (* Check that the PIF is not in-use *)
        let uuid = Db.PIF.get_uuid ~__context ~self:pif in
-       (* XXX: temporarily remove to fix firstboot scripts
-       if Db.PIF.get_management ~__context ~self:pif then begin
-        warn "PIF %s is a management interface: refusing to bring down" uuid;
-        raise (Api_errors.Server_error(Api_errors.pif_is_management_iface, [ 
Ref.string_of pif ]))
-       end;
-       *)
        let network = Db.PIF.get_network ~__context ~self:pif in
        Xapi_network_attach_helpers.assert_network_has_no_vifs_in_use_on_me 
~__context ~host:(Helpers.get_localhost()) ~network;
        Xapi_network_attach_helpers.assert_pif_disallow_unplug_not_set 
~__context pif;
diff -r d292d82531ad ocaml/xapi/xapi_pif.ml
--- a/ocaml/xapi/xapi_pif.ml    Tue Nov 24 13:18:17 2009 +0000
+++ b/ocaml/xapi/xapi_pif.ml    Tue Nov 24 17:56:56 2009 +0000
@@ -423,7 +423,7 @@
 
 let unplug ~__context ~self = 
   assert_no_protection_enabled ~__context ~self;
-  assert_not_slave_management_pif ~__context ~self;
+  assert_not_management_pif ~__context ~self;
   let host = Db.PIF.get_host ~__context ~self in
   if Db.Host.get_enabled ~__context ~self:host
   then abort_if_network_attached_to_protected_vms ~__context ~self;

Attachment: disallow-management-unplug
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®.