diff -r 95b9e4f1b9dd ocaml/client_records/records.ml
--- a/ocaml/client_records/records.ml	Fri Sep 24 17:33:28 2010 +0100
+++ b/ocaml/client_records/records.ml	Fri Oct 01 04:42:10 2010 -0400
@@ -237,6 +237,7 @@
 	make_field ~name:"netmask"      ~get:(fun () -> (x ()).API.pIF_netmask) ();
 	make_field ~name:"gateway"      ~get:(fun () -> (x ()).API.pIF_gateway) ();
 	make_field ~name:"DNS"          ~get:(fun () -> (x ()).API.pIF_DNS) ();
+	make_field ~name:"NTP"          ~get:(fun () -> (x ()).API.pIF_NTP) ();
 	make_field ~name:"io_read_kbs" ~get:(fun () -> 
 	  try 
 	    let host = (x ()).API.pIF_host in
diff -r 95b9e4f1b9dd ocaml/idl/FriendlyNames.resx
--- a/ocaml/idl/FriendlyNames.resx	Fri Sep 24 17:33:28 2010 +0100
+++ b/ocaml/idl/FriendlyNames.resx	Fri Oct 01 04:42:10 2010 -0400
@@ -162,6 +162,10 @@
   <data name="Label-PIF.DNS" xml:space="preserve">
     <value>PIF.DNS</value>
   </data>
+  <data name="Label-PIF.NTP" xml:space="preserve">
+    <value>PIF.NTP</value>
+  </data>
+
   <data name="Label-PIF.IP" xml:space="preserve">
     <value>PIF.IP</value>
   </data>
@@ -1890,6 +1894,10 @@
   <data name="Description-PIF.DNS" xml:space="preserve">
     <value>IP address of DNS servers to use</value>
   </data>
+  <data name="Description-PIF.NTP" xml:space="preserve">
+    <value>NTP servers to use</value>
+  </data>
+
   <data name="Description-PIF.IP" xml:space="preserve">
     <value>IP address</value>
   </data>
@@ -3564,4 +3572,4 @@
   <data name="Message.name-vm_suspended" xml:space="preserve">
     <value>VM Suspended</value>
   </data>
-</root>
\ No newline at end of file
+</root>
diff -r 95b9e4f1b9dd ocaml/idl/datamodel.ml
--- a/ocaml/idl/datamodel.ml	Fri Sep 24 17:33:28 2010 +0100
+++ b/ocaml/idl/datamodel.ml	Fri Oct 01 04:42:10 2010 -0400
@@ -3973,6 +3973,7 @@
 	   String, "netmask", "the new netmask";
 	   String, "gateway", "the new gateway";
 	   String, "DNS", "the new DNS settings";
+	   String, "NTP", "the new NTP settings";
 	  ]
   ~in_product_since:rel_miami
   ~allowed_roles:_R_POOL_OP
@@ -4030,6 +4031,7 @@
     {param_type=String; param_name="netmask"; param_doc=""; param_release=first_rel; param_default=None};
     {param_type=String; param_name="gateway"; param_doc=""; param_release=first_rel; param_default=None};
     {param_type=String; param_name="DNS"; param_doc=""; param_release=first_rel; param_default=None};
+    {param_type=String; param_name="NTP"; param_doc=""; param_release=first_rel; param_default=None};
     {param_type=Ref _bond; param_name="bond_slave_of"; param_doc=""; param_release=first_rel; param_default=None};
     {param_type=Ref _vlan; param_name="VLAN_master_of"; param_doc=""; param_release=first_rel; param_default=None};
     {param_type=Bool; param_name="management"; param_doc=""; param_release=first_rel; param_default=None};
@@ -4099,6 +4101,7 @@
 	field ~in_oss_since:None ~ty:String ~in_product_since:rel_miami ~qualifier:DynamicRO "netmask" "IP netmask" ~default_value:(Some (VString ""));
 	field ~in_oss_since:None ~ty:String ~in_product_since:rel_miami ~qualifier:DynamicRO "gateway" "IP gateway" ~default_value:(Some (VString ""));
 	field ~in_oss_since:None ~ty:String ~in_product_since:rel_miami ~qualifier:DynamicRO "DNS" "IP address of DNS servers to use" ~default_value:(Some (VString ""));
+	field ~in_oss_since:None ~ty:String ~in_product_since:rel_miami ~qualifier:DynamicRO "NTP" "NTP servers to use" ~default_value:(Some (VString ""));
 	field ~in_oss_since:None ~ty:(Ref _bond) ~in_product_since:rel_miami ~qualifier:DynamicRO "bond_slave_of" "Indicates which bond this interface is part of" ~default_value:(Some (VRef ""));
 	field ~in_oss_since:None ~ty:(Set(Ref _bond)) ~in_product_since:rel_miami ~qualifier:DynamicRO "bond_master_of" "Indicates this PIF represents the results of a bond";	
 	field ~in_oss_since:None ~ty:(Ref _vlan) ~in_product_since:rel_miami ~qualifier:DynamicRO "VLAN_master_of" "Indicates wich VLAN this interface receives untagged traffic from" ~default_value:(Some (VRef ""));
diff -r 95b9e4f1b9dd ocaml/perftest/createpool.ml
--- a/ocaml/perftest/createpool.ml	Fri Sep 24 17:33:28 2010 +0100
+++ b/ocaml/perftest/createpool.ml	Fri Oct 01 04:42:10 2010 -0400
@@ -402,7 +402,7 @@
       let mac = Client.PIF.get_MAC poolrpc poolses master in
       let bond = Client.Bond.create poolrpc poolses bondednets.(bnum) pifs mac in
       let bondpif = Client.Bond.get_master poolrpc poolses bond in
-      Client.PIF.reconfigure_ip poolrpc poolses bondpif `Static (Client.PIF.get_IP poolrpc poolses master) "255.255.255.0" "" "";
+      Client.PIF.reconfigure_ip poolrpc poolses bondpif `Static (Client.PIF.get_IP poolrpc poolses master) "255.255.255.0" "" "" "";
       if Client.PIF.get_management poolrpc poolses master then begin
 	(try Client.Host.management_reconfigure poolrpc poolses bondpif;
 	  with _ -> ());
diff -r 95b9e4f1b9dd ocaml/xapi/cli_frontend.ml
--- a/ocaml/xapi/cli_frontend.ml	Fri Sep 24 17:33:28 2010 +0100
+++ b/ocaml/xapi/cli_frontend.ml	Fri Oct 01 04:42:10 2010 -0400
@@ -1429,7 +1429,7 @@
    "pif-reconfigure-ip",
     {
       reqd=["uuid"; "mode"];
-      optn=["IP"; "netmask"; "gateway"; "DNS"];
+      optn=["IP"; "netmask"; "gateway"; "DNS"; "NTP"];
       help="Reconfigure the IP address settings on a PIF.";
       implementation=No_fd Cli_operations.pif_reconfigure_ip;
       flags=[];
diff -r 95b9e4f1b9dd ocaml/xapi/cli_operations.ml
--- a/ocaml/xapi/cli_operations.ml	Fri Sep 24 17:33:28 2010 +0100
+++ b/ocaml/xapi/cli_operations.ml	Fri Oct 01 04:42:10 2010 -0400
@@ -3248,7 +3248,8 @@
   let netmask = if List.mem_assoc "netmask" params then List.assoc "netmask" params else "" in
   let gateway = if List.mem_assoc "gateway" params then List.assoc "gateway" params else "" in
   let dns = read_optional_case_insensitive "DNS" in
-  let () = Client.PIF.reconfigure_ip rpc session_id pif mode ip netmask gateway dns in ()
+  let ntp = read_optional_case_insensitive "NTP" in
+  let () = Client.PIF.reconfigure_ip rpc session_id pif mode ip netmask gateway dns ntp in ()
 
 let pif_unplug printer rpc session_id params = 
   let pif = Client.PIF.get_by_uuid rpc session_id (List.assoc "uuid" params) in
diff -r 95b9e4f1b9dd ocaml/xapi/message_forwarding.ml
--- a/ocaml/xapi/message_forwarding.ml	Fri Sep 24 17:33:28 2010 +0100
+++ b/ocaml/xapi/message_forwarding.ml	Fri Oct 01 04:42:10 2010 -0400
@@ -2394,10 +2394,10 @@
     
     let pool_introduce ~__context
 	~device ~network ~host ~mAC ~mTU ~vLAN ~physical ~ip_configuration_mode ~iP
-	~netmask ~gateway ~dNS ~bond_slave_of ~vLAN_master_of ~management ~other_config ~disallow_unplug =
+	~netmask ~gateway ~dNS ~nTP ~bond_slave_of ~vLAN_master_of ~management ~other_config ~disallow_unplug =
       Local.PIF.pool_introduce ~__context
 	~device ~network ~host ~mAC ~mTU ~vLAN ~physical ~ip_configuration_mode ~iP
-	~netmask ~gateway ~dNS ~bond_slave_of ~vLAN_master_of ~management ~other_config ~disallow_unplug
+	~netmask ~gateway ~dNS ~nTP ~bond_slave_of ~vLAN_master_of ~management ~other_config ~disallow_unplug
 	
     let db_introduce = Local.PIF.db_introduce
     let db_forget ~__context ~self = 
@@ -2424,10 +2424,10 @@
       let local_fn = Local.PIF.plug ~self in
       do_op_on ~local_fn ~__context ~host:(Db.PIF.get_host ~__context ~self) (fun session_id rpc -> Client.PIF.plug rpc session_id self)      
 
-    let reconfigure_ip ~__context ~self ~mode ~iP ~netmask ~gateway ~dNS = 
-      info "PIF.reconfigure_ip: PIF = '%s'; mode = '%s'; IP = '%s'; netmask = '%s'; gateway = '%s'; DNS = %s" 
+    let reconfigure_ip ~__context ~self ~mode ~iP ~netmask ~gateway ~dNS ~nTP = 
+      info "PIF.reconfigure_ip: PIF = '%s'; mode = '%s'; IP = '%s'; netmask = '%s'; gateway = '%s'; DNS = %s ; NTP = %s" 
 	(pif_uuid ~__context self) 
-	(match mode with `DHCP -> "DHCP" | `None -> "None" | `Static -> "Static") iP netmask gateway dNS;
+	(match mode with `DHCP -> "DHCP" | `None -> "None" | `Static -> "Static") iP netmask gateway dNS nTP;
 
 (*      let host = Db.PIF.get_host ~__context ~self in
       let pbds = Db.Host.get_PBDs ~__context ~self:host in
@@ -2441,7 +2441,7 @@
       if List.length (Db.Host.get_resident_VMs ~__context ~self:host) > 1 then 
 	raise (Api_errors.Server_error (Api_errors.host_in_use, ["VM",""]));*)
 
-      let local_fn = Local.PIF.reconfigure_ip ~self ~mode ~iP ~netmask ~gateway ~dNS in
+      let local_fn = Local.PIF.reconfigure_ip ~self ~mode ~iP ~netmask ~gateway ~dNS ~nTP in
       do_op_on ~local_fn ~__context ~host:(Db.PIF.get_host ~__context ~self) 
 	(fun session_id rpc -> 
 	  (* Reconfiguring the IP will potentially kill the connection without causing
@@ -2449,7 +2449,7 @@
 	     work and monitor the status of the task, which will be completed on the slave.
 	     We ignore errors at the moment (only on slaves) *)
 	  Thread.create (fun () -> 
-	    Client.PIF.reconfigure_ip rpc session_id self mode iP netmask gateway dNS) ();      
+	    Client.PIF.reconfigure_ip rpc session_id self mode iP netmask gateway dNS nTP) ();      
 	  let task_id = Context.get_task_id __context in
 	  let rec poll i =
 	    if i>300 then failwith "Failed to see host on network after timeout expired";
diff -r 95b9e4f1b9dd ocaml/xapi/xapi.ml
--- a/ocaml/xapi/xapi.ml	Fri Sep 24 17:33:28 2010 +0100
+++ b/ocaml/xapi/xapi.ml	Fri Oct 01 04:42:10 2010 -0400
@@ -557,6 +557,7 @@
 				let netmask = if List.mem_assoc "NETMASK" args then List.assoc "NETMASK" args else "" in
 				let gateway = if List.mem_assoc "GATEWAY" args then List.assoc "GATEWAY" args else "" in
 				let dNS = if List.mem_assoc "DNS" args then List.assoc "DNS" args else "" in
+				let nTP = if List.mem_assoc "NTP" args then List.assoc "NTP" args else "" in
 				
 				(* Erase networking database objects for this host *)
 				Helpers.call_api_functions ~__context
@@ -569,7 +570,7 @@
 				
 				(* Introduce and configure the management PIF *)
 				let pif = List.find (fun p -> Db.PIF.get_MAC ~__context ~self:p = mAC) pifs in
-				Xapi_pif.reconfigure_ip ~__context ~self:pif ~mode ~iP ~netmask ~gateway ~dNS;
+				Xapi_pif.reconfigure_ip ~__context ~self:pif ~mode ~iP ~netmask ~gateway ~dNS ~nTP;
 				Xapi_host.management_reconfigure ~__context ~pif;
 			);
 		(* Remove trigger file *)
diff -r 95b9e4f1b9dd ocaml/xapi/xapi_bond.ml
--- a/ocaml/xapi/xapi_bond.ml	Fri Sep 24 17:33:28 2010 +0100
+++ b/ocaml/xapi/xapi_bond.ml	Fri Oct 01 04:42:10 2010 -0400
@@ -80,7 +80,7 @@
        let () = Db.PIF.create ~__context ~ref:pif ~uuid:(Uuid.to_string (Uuid.make_uuid ()))
 	 ~device ~device_name ~network ~host ~mAC ~mTU:(-1L) ~vLAN:(-1L) ~metrics:Ref.null
 	 ~physical:false ~currently_attached:false 
-	 ~ip_configuration_mode:`None ~iP:"" ~netmask:"" ~gateway:"" ~dNS:"" ~bond_slave_of:Ref.null 
+	 ~ip_configuration_mode:`None ~iP:"" ~netmask:"" ~gateway:"" ~dNS:"" ~nTP:"" ~bond_slave_of:Ref.null 
 	 ~vLAN_master_of:Ref.null ~management:false ~other_config:[] ~disallow_unplug:false in
        
        Db.Bond.create ~__context ~ref:bond ~uuid:(Uuid.to_string (Uuid.make_uuid ())) ~master:pif ~other_config:[];
diff -r 95b9e4f1b9dd ocaml/xapi/xapi_pif.ml
--- a/ocaml/xapi/xapi_pif.ml	Fri Sep 24 17:33:28 2010 +0100
+++ b/ocaml/xapi/xapi_pif.ml	Fri Oct 01 04:42:10 2010 -0400
@@ -162,14 +162,14 @@
 
 let pool_introduce ~__context
     ~device ~network ~host ~mAC ~mTU ~vLAN ~physical ~ip_configuration_mode
-    ~iP ~netmask ~gateway ~dNS ~bond_slave_of ~vLAN_master_of ~management ~other_config ~disallow_unplug =
+    ~iP ~netmask ~gateway ~dNS ~nTP ~bond_slave_of ~vLAN_master_of ~management ~other_config ~disallow_unplug =
   let pif_ref = Ref.make() in
   let metrics = make_pif_metrics ~__context in
   let () =
     Db.PIF.create ~__context ~ref:pif_ref ~uuid:(Uuid.to_string (Uuid.make_uuid ()))
     ~device ~device_name:device ~network ~host ~mAC ~mTU ~vLAN ~metrics
     ~physical ~currently_attached:false 
-    ~ip_configuration_mode ~iP ~netmask ~gateway ~dNS
+    ~ip_configuration_mode ~iP ~netmask ~gateway ~dNS ~nTP
     ~bond_slave_of:Ref.null ~vLAN_master_of ~management ~other_config ~disallow_unplug in
   pif_ref
 
@@ -203,7 +203,7 @@
   let () = Db.PIF.create ~__context ~ref:pif ~uuid:(Uuid.to_string (Uuid.make_uuid ()))
     ~device ~device_name:device ~network:net_ref ~host ~mAC ~mTU ~vLAN ~metrics
     ~physical ~currently_attached:false 
-    ~ip_configuration_mode:`None ~iP:"" ~netmask:"" ~gateway:"" ~dNS:""
+    ~ip_configuration_mode:`None ~iP:"" ~netmask:"" ~gateway:"" ~dNS:"" ~nTP:""
     ~bond_slave_of:Ref.null ~vLAN_master_of ~management:false ~other_config:[] ~disallow_unplug:false in
 
   (* If I'm a pool slave and this pif represents my management interface then
@@ -421,7 +421,7 @@
     destroy ~__context ~self:untagged_PIF
   end
 
-let reconfigure_ip ~__context ~self ~mode ~iP ~netmask ~gateway ~dNS =
+let reconfigure_ip ~__context ~self ~mode ~iP ~netmask ~gateway ~dNS ~nTP =
   assert_no_protection_enabled ~__context ~self;
 
   let assert_is_valid ip_addr =
@@ -449,6 +449,7 @@
   Db.PIF.set_netmask ~__context ~self ~value:netmask;
   Db.PIF.set_gateway ~__context ~self ~value:gateway;
   Db.PIF.set_DNS ~__context ~self ~value:dNS;
+  Db.PIF.set_NTP ~__context ~self ~value:nTP;
   if Db.PIF.get_currently_attached ~__context ~self then begin
     debug "PIF %s is currently_attached and the configuration has changed; calling out to reconfigure"
       (Db.PIF.get_uuid ~__context ~self);
diff -r 95b9e4f1b9dd ocaml/xapi/xapi_pif.mli
--- a/ocaml/xapi/xapi_pif.mli	Fri Sep 24 17:33:28 2010 +0100
+++ b/ocaml/xapi/xapi_pif.mli	Fri Oct 01 04:42:10 2010 -0400
@@ -58,6 +58,7 @@
   netmask:string ->
   gateway:string ->
   dNS:string ->
+  nTP:string ->
   bond_slave_of:'a ->
   vLAN_master_of:[ `VLAN ] Ref.t ->
   management:bool ->
@@ -98,8 +99,8 @@
 val reconfigure_ip :
   __context:Context.t ->
   self:API.ref_PIF ->
-  mode:[< `DHCP | `None | `Static > `None `Static ] ->
-  iP:string -> netmask:string -> gateway:string -> dNS:string -> unit
+  mode:[< `DHCP | `None | `Static > `None `Static] ->
+  iP:string -> netmask:string -> gateway:string -> dNS:string -> nTP:string -> unit
   
 (** Attempt to bring down the PIF: disconnect the underlying network interface from
  *  its bridge and disable the interface. *)
@@ -160,6 +161,7 @@
   netmask:string ->
   gateway:string ->
   dNS:string ->
+  nTP:string ->
   bond_slave_of:'a ->
   vLAN_master_of:[ `VLAN ] Ref.t ->
   management:bool ->
diff -r 95b9e4f1b9dd ocaml/xapi/xapi_pool.ml
--- a/ocaml/xapi/xapi_pool.ml	Fri Sep 24 17:33:28 2010 +0100
+++ b/ocaml/xapi/xapi_pool.ml	Fri Oct 01 04:42:10 2010 -0400
@@ -430,6 +430,7 @@
 				~netmask:pif.API.pIF_netmask
 				~gateway:pif.API.pIF_gateway
 				~dNS:pif.API.pIF_DNS
+				~nTP:pif.API.pIF_NTP
 				~bond_slave_of:pif.API.pIF_bond_slave_of
 				~vLAN_master_of:pif.API.pIF_VLAN_master_of
 				~management:pif.API.pIF_management
diff -r 95b9e4f1b9dd ocaml/xapi/xapi_tunnel.ml
--- a/ocaml/xapi/xapi_tunnel.ml	Fri Sep 24 17:33:28 2010 +0100
+++ b/ocaml/xapi/xapi_tunnel.ml	Fri Oct 01 04:42:10 2010 -0400
@@ -40,7 +40,7 @@
 	Db.PIF.create ~__context ~ref:access_PIF ~uuid:(Uuid.to_string (Uuid.make_uuid ()))
 		~device ~device_name ~network ~host ~mAC ~mTU:(-1L) ~vLAN:(-1L) ~metrics:Ref.null
 		~physical:false ~currently_attached:false 
-		~ip_configuration_mode:`None ~iP:"" ~netmask:"" ~gateway:"" ~dNS:"" ~bond_slave_of:Ref.null 
+		~ip_configuration_mode:`None ~iP:"" ~netmask:"" ~gateway:"" ~dNS:"" ~nTP:"" ~bond_slave_of:Ref.null 
 		~vLAN_master_of:Ref.null ~management:false ~other_config:[] ~disallow_unplug:false;
 	Db.Tunnel.create ~__context ~ref:tunnel ~uuid:(Uuid.to_string (Uuid.make_uuid ()))
 		~access_PIF ~transport_PIF ~status:["active", "false"] ~other_config:[];
diff -r 95b9e4f1b9dd scripts/InterfaceReconfigure.py
--- a/scripts/InterfaceReconfigure.py	Fri Sep 24 17:33:28 2010 +0100
+++ b/scripts/InterfaceReconfigure.py	Fri Oct 01 04:42:10 2010 -0400
@@ -303,6 +303,7 @@
                'netmask': (_str_to_xml,_str_from_xml),
                'gateway': (_str_to_xml,_str_from_xml),
                'DNS': (_str_to_xml,_str_from_xml),
+               'NTP': (_str_to_xml,_str_from_xml),
                'MAC': (_str_to_xml,_str_from_xml),
                'other_config': (lambda x, p, t, v: _otherconfig_to_xml(x, p, v, _PIF_OTHERCONFIG_ATTRS),
                                 lambda n: _otherconfig_from_xml(n, _PIF_OTHERCONFIG_ATTRS)),
diff -r 95b9e4f1b9dd scripts/interface-reconfigure
--- a/scripts/interface-reconfigure	Fri Sep 24 17:33:28 2010 +0100
+++ b/scripts/interface-reconfigure	Fri Oct 01 04:42:10 2010 -0400
@@ -50,6 +50,7 @@
 import traceback
 import re
 import random
+import shutil
 
 management_pif = None
 
@@ -203,6 +204,20 @@
 #
 #
 
+#
+# Reload ntp configuration
+#
+def reloadntp():
+    """Bring up a network interface"""
+    if not os.path.exists(root_prefix() + "/etc/init.d/ntpd" ):
+        raise Error("reloadntp: /etc/init.d/ntpd doesnt exist")
+    run_command(["/etc/init.d/ntpd", "reload"])
+
+#
+#
+#
+
+
 def pif_rename_physical_devices(pif):
     if pif_is_tunnel(pif):
         return
@@ -330,10 +345,26 @@
     if mtu:
         f.write("MTU=%s\n" % mtu)
 
-
     if pifrec.has_key('DNS') and pifrec['DNS'] != "":
         ServerList = pifrec['DNS'].split(",")
         for i in range(len(ServerList)): f.write("DNS%d=%s\n" % (i+1, ServerList[i]))
+
+    if pifrec.has_key('NTP') and pifrec['NTP'] != "":
+        ServerList = pifrec['NTP'].split(",")
+        # Only configure ntp if ntp.conf exists
+        if os.path.exists(root_prefix() + "/etc/ntp.conf" ):
+            shutil.move("/etc/ntp.conf", "/etc/ntp.conf.save")
+	    ntpconf = open("/etc/ntp.conf.save")
+	    lines = ntpconf.readlines()
+	    ntpconf.close()
+	    ntpconf = open("/etc/ntp.conf", "w")
+	    for line in lines:
+	         if not line.startswith("server "):
+		     ntpconf.write(line)
+            for i in range(len(ServerList)): ntpconf.write("server %s\n" % (ServerList[i]))
+            ntpconf.close()
+	
+
     if oc and oc.has_key('domain'):
         f.write("DOMAIN='%s'\n" % oc['domain'].replace(',', ' '))
 
@@ -446,6 +477,8 @@
 
         dp.post()
 
+	reloadntp()
+
         # Update /etc/issue (which contains the IP address of the management interface)
         os.system(root_prefix() + "/sbin/update-issue")
 
