1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-11 05:17:41 +03:00

feature #1691: New state for hotplugging a network interface

This commit is contained in:
Ruben S. Montero 2013-03-06 18:33:18 +01:00
parent ec0f94c10c
commit e5ca272b7e
11 changed files with 21 additions and 13 deletions

View File

@ -90,7 +90,8 @@ public:
BOOT_SUSPENDED = 21, BOOT_SUSPENDED = 21,
BOOT_STOPPED = 22, BOOT_STOPPED = 22,
CLEANUP_DELETE = 23, CLEANUP_DELETE = 23,
HOTPLUG_SNAPSHOT = 24 HOTPLUG_SNAPSHOT = 24,
HOTPLUG_NIC = 25
}; };
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------

View File

@ -107,7 +107,8 @@
BOOT_SUSPENDED = 21, BOOT_SUSPENDED = 21,
BOOT_STOPPED = 22, BOOT_STOPPED = 22,
CLEANUP_DELETE = 23, CLEANUP_DELETE = 23,
HOTPLUG_SNAPSHOT = 24 HOTPLUG_SNAPSHOT = 24,
HOTPLUG_NIC = 25
--> -->
<xs:element name="LCM_STATE" type="xs:integer"/> <xs:element name="LCM_STATE" type="xs:integer"/>
<xs:element name="RESCHED" type="xs:integer"/> <xs:element name="RESCHED" type="xs:integer"/>

View File

@ -69,7 +69,8 @@
BOOT_SUSPENDED = 21, BOOT_SUSPENDED = 21,
BOOT_STOPPED = 22, BOOT_STOPPED = 22,
CLEANUP_DELETE = 23, CLEANUP_DELETE = 23,
HOTPLUG_SNAPSHOT = 24 HOTPLUG_SNAPSHOT = 24,
HOTPLUG_NIC = 25
--> -->
<xs:element name="LCM_STATE" type="xs:integer"/> <xs:element name="LCM_STATE" type="xs:integer"/>
<xs:element name="RESCHED" type="xs:integer"/> <xs:element name="RESCHED" type="xs:integer"/>

View File

@ -1313,7 +1313,7 @@ int DispatchManager::attach_nic(
vm->get_nic_info(max_nic_id); vm->get_nic_info(max_nic_id);
vm->set_state(VirtualMachine::HOTPLUG); vm->set_state(VirtualMachine::HOTPLUG_NIC);
vm->set_resched(false); vm->set_resched(false);
@ -1418,7 +1418,7 @@ int DispatchManager::detach_nic(
return -1; return -1;
} }
vm->set_state(VirtualMachine::HOTPLUG); vm->set_state(VirtualMachine::HOTPLUG_NIC);
vm->set_resched(false); vm->set_resched(false);

View File

@ -739,6 +739,7 @@ void LifeCycleManager::clean_up_vm(VirtualMachine * vm, bool dispose)
case VirtualMachine::CANCEL: case VirtualMachine::CANCEL:
case VirtualMachine::HOTPLUG: case VirtualMachine::HOTPLUG:
case VirtualMachine::HOTPLUG_SNAPSHOT: case VirtualMachine::HOTPLUG_SNAPSHOT:
case VirtualMachine::HOTPLUG_NIC:
vm->set_running_etime(the_time); vm->set_running_etime(the_time);
vmpool->update_history(vm); vmpool->update_history(vm);

View File

@ -1394,7 +1394,7 @@ void LifeCycleManager::attach_nic_success_action(int vid)
return; return;
} }
if ( vm->get_lcm_state() == VirtualMachine::HOTPLUG ) if ( vm->get_lcm_state() == VirtualMachine::HOTPLUG_NIC )
{ {
vm->clear_attach_nic(); vm->clear_attach_nic();
@ -1429,7 +1429,7 @@ void LifeCycleManager::attach_nic_failure_action(int vid)
return; return;
} }
if ( vm->get_lcm_state() == VirtualMachine::HOTPLUG ) if ( vm->get_lcm_state() == VirtualMachine::HOTPLUG_NIC )
{ {
nic = vm->delete_attach_nic(); nic = vm->delete_attach_nic();
uid = vm->get_uid(); uid = vm->get_uid();

View File

@ -93,7 +93,8 @@ public class VirtualMachine extends PoolElement{
"BOOT_SUSPENDED", "BOOT_SUSPENDED",
"BOOT_STOPPED", "BOOT_STOPPED",
"CLEANUP_DELETE", "CLEANUP_DELETE",
"HOTPLUG_SNAPSHOT" }; "HOTPLUG_SNAPSHOT",
"HOTPLUG_NIC" };
private static final String[] SHORT_LCM_STATES = private static final String[] SHORT_LCM_STATES =
{ {

View File

@ -52,7 +52,7 @@ module OpenNebula
SAVE_MIGRATE PROLOG_MIGRATE PROLOG_RESUME EPILOG_STOP EPILOG SAVE_MIGRATE PROLOG_MIGRATE PROLOG_RESUME EPILOG_STOP EPILOG
SHUTDOWN CANCEL FAILURE CLEANUP_RESUBMIT UNKNOWN HOTPLUG SHUTDOWN_POWEROFF SHUTDOWN CANCEL FAILURE CLEANUP_RESUBMIT UNKNOWN HOTPLUG SHUTDOWN_POWEROFF
BOOT_UNKNOWN BOOT_POWEROFF BOOT_SUSPENDED BOOT_STOPPED CLEANUP_DELETE BOOT_UNKNOWN BOOT_POWEROFF BOOT_SUSPENDED BOOT_STOPPED CLEANUP_DELETE
HOTPLUG_SNAPSHOT} HOTPLUG_SNAPSHOT HOTPLUG_NIC}
SHORT_VM_STATES={ SHORT_VM_STATES={
"INIT" => "init", "INIT" => "init",
@ -90,7 +90,8 @@ module OpenNebula
"BOOT_SUSPENDED" => "boot", "BOOT_SUSPENDED" => "boot",
"BOOT_STOPPED" => "boot", "BOOT_STOPPED" => "boot",
"CLEANUP_DELETE" => "clea", "CLEANUP_DELETE" => "clea",
"HOTPLUG_SNAPSHOT" => "snap" "HOTPLUG_SNAPSHOT" => "snap",
"HOTPLUG_NIC" => "hotp"
} }
MIGRATE_REASON=%w{NONE ERROR STOP_RESUME USER CANCEL} MIGRATE_REASON=%w{NONE ERROR STOP_RESUME USER CANCEL}

View File

@ -103,7 +103,8 @@ var oZones = {
"BOOT_SUSPENDED", "BOOT_SUSPENDED",
"BOOT_STOPPED", "BOOT_STOPPED",
"CLEANUP_DELETE", "CLEANUP_DELETE",
"HOTPLUG_SNAPSHOT"][value]); "HOTPLUG_SNAPSHOT",
"HOTPLUG_NIC"][value]);
break; break;
case "IMAGE": case "IMAGE":
case "image": case "image":

View File

@ -111,7 +111,8 @@ var OpenNebula = {
"BOOT_SUSPENDED", "BOOT_SUSPENDED",
"BOOT_STOPPED", "BOOT_STOPPED",
"CLEANUP_DELETE", "CLEANUP_DELETE",
"HOTPLUG_SNAPSHOT"][value]); "HOTPLUG_SNAPSHOT",
"HOTPLUG_NIC"][value]);
break; break;
case "IMAGE": case "IMAGE":
case "image": case "image":

View File

@ -50,7 +50,7 @@ var vm_graphs = [
]; ];
var VNCstates=["RUNNING","SHUTDOWN","SHUTDOWN_POWEROFF","UNKNOWN","HOTPLUG","CANCEL","MIGRATE", "HOTPLUG_SNAPSHOT"]; var VNCstates=["RUNNING","SHUTDOWN","SHUTDOWN_POWEROFF","UNKNOWN","HOTPLUG","CANCEL","MIGRATE", "HOTPLUG_SNAPSHOT", "HOTPLUG_NIC"];
//Permanent storage for last value of aggregated network usage //Permanent storage for last value of aggregated network usage
//Used to calculate bandwidth //Used to calculate bandwidth