internal static void ReconfigureIP(AsyncAction action, PIF new_pif, PIF existing_pif, string ip, int hi) { log.DebugFormat("Reconfiguring IP on {0} {1} ...", existing_pif.Name(), existing_pif.uuid); action.RelatedTask = PIF.async_reconfigure_ip(action.Session, existing_pif.opaque_ref, new_pif.ip_configuration_mode, ip, new_pif.netmask, new_pif.gateway, new_pif.DNS); action.PollToCompletion(action.PercentComplete, hi); log.DebugFormat("Reconfiguring IP on {0} {1} done.", existing_pif.Name(), existing_pif.uuid); }
/// <summary> /// Remove the IP address from the given PIF. /// </summary> private static void ClearIP(AsyncAction action, PIF pif, int hi) { log.DebugFormat("Removing IP address from {0} {1}...", pif.Name, pif.uuid); action.Description = string.Format(Messages.ACTION_CHANGE_NETWORKING_BRINGING_DOWN, pif.Name); action.RelatedTask = PIF.async_reconfigure_ip(action.Session, pif.opaque_ref, ip_configuration_mode.None, "", "", "", ""); action.PollToCompletion(action.PercentComplete, hi); action.Description = string.Format(Messages.ACTION_CHANGE_NETWORKING_BRINGING_DOWN_DONE, pif.Name); log.DebugFormat("Removed IP address from {0} {1}.", pif.Name, pif.uuid); }
/// <summary> /// Remove the IP address from the given PIF. /// </summary> private static void ClearIP(AsyncAction action, PIF pif, int hi) { // if the network is used by clustering, then we don't remove the IP address if (pif.IsUsedByClustering()) { return; } log.DebugFormat("Removing IP address from {0} {1}...", pif.Name(), pif.uuid); action.Description = string.Format(Messages.ACTION_CHANGE_NETWORKING_BRINGING_DOWN, pif.Name()); action.RelatedTask = PIF.async_reconfigure_ip(action.Session, pif.opaque_ref, ip_configuration_mode.None, "", "", "", ""); action.PollToCompletion(action.PercentComplete, hi); action.Description = string.Format(Messages.ACTION_CHANGE_NETWORKING_BRINGING_DOWN_DONE, pif.Name()); log.DebugFormat("Removed IP address from {0} {1}.", pif.Name(), pif.uuid); }