mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-22 13:33:52 +03:00
feature #1691: New state for hotplugging a network interface
This commit is contained in:
parent
ec0f94c10c
commit
e5ca272b7e
@ -90,7 +90,8 @@ public:
|
||||
BOOT_SUSPENDED = 21,
|
||||
BOOT_STOPPED = 22,
|
||||
CLEANUP_DELETE = 23,
|
||||
HOTPLUG_SNAPSHOT = 24
|
||||
HOTPLUG_SNAPSHOT = 24,
|
||||
HOTPLUG_NIC = 25
|
||||
};
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
@ -107,7 +107,8 @@
|
||||
BOOT_SUSPENDED = 21,
|
||||
BOOT_STOPPED = 22,
|
||||
CLEANUP_DELETE = 23,
|
||||
HOTPLUG_SNAPSHOT = 24
|
||||
HOTPLUG_SNAPSHOT = 24,
|
||||
HOTPLUG_NIC = 25
|
||||
-->
|
||||
<xs:element name="LCM_STATE" type="xs:integer"/>
|
||||
<xs:element name="RESCHED" type="xs:integer"/>
|
||||
|
@ -69,7 +69,8 @@
|
||||
BOOT_SUSPENDED = 21,
|
||||
BOOT_STOPPED = 22,
|
||||
CLEANUP_DELETE = 23,
|
||||
HOTPLUG_SNAPSHOT = 24
|
||||
HOTPLUG_SNAPSHOT = 24,
|
||||
HOTPLUG_NIC = 25
|
||||
-->
|
||||
<xs:element name="LCM_STATE" type="xs:integer"/>
|
||||
<xs:element name="RESCHED" type="xs:integer"/>
|
||||
|
@ -1313,7 +1313,7 @@ int DispatchManager::attach_nic(
|
||||
|
||||
vm->get_nic_info(max_nic_id);
|
||||
|
||||
vm->set_state(VirtualMachine::HOTPLUG);
|
||||
vm->set_state(VirtualMachine::HOTPLUG_NIC);
|
||||
|
||||
vm->set_resched(false);
|
||||
|
||||
@ -1418,7 +1418,7 @@ int DispatchManager::detach_nic(
|
||||
return -1;
|
||||
}
|
||||
|
||||
vm->set_state(VirtualMachine::HOTPLUG);
|
||||
vm->set_state(VirtualMachine::HOTPLUG_NIC);
|
||||
|
||||
vm->set_resched(false);
|
||||
|
||||
|
@ -739,6 +739,7 @@ void LifeCycleManager::clean_up_vm(VirtualMachine * vm, bool dispose)
|
||||
case VirtualMachine::CANCEL:
|
||||
case VirtualMachine::HOTPLUG:
|
||||
case VirtualMachine::HOTPLUG_SNAPSHOT:
|
||||
case VirtualMachine::HOTPLUG_NIC:
|
||||
vm->set_running_etime(the_time);
|
||||
vmpool->update_history(vm);
|
||||
|
||||
|
@ -1394,7 +1394,7 @@ void LifeCycleManager::attach_nic_success_action(int vid)
|
||||
return;
|
||||
}
|
||||
|
||||
if ( vm->get_lcm_state() == VirtualMachine::HOTPLUG )
|
||||
if ( vm->get_lcm_state() == VirtualMachine::HOTPLUG_NIC )
|
||||
{
|
||||
vm->clear_attach_nic();
|
||||
|
||||
@ -1429,7 +1429,7 @@ void LifeCycleManager::attach_nic_failure_action(int vid)
|
||||
return;
|
||||
}
|
||||
|
||||
if ( vm->get_lcm_state() == VirtualMachine::HOTPLUG )
|
||||
if ( vm->get_lcm_state() == VirtualMachine::HOTPLUG_NIC )
|
||||
{
|
||||
nic = vm->delete_attach_nic();
|
||||
uid = vm->get_uid();
|
||||
|
@ -93,7 +93,8 @@ public class VirtualMachine extends PoolElement{
|
||||
"BOOT_SUSPENDED",
|
||||
"BOOT_STOPPED",
|
||||
"CLEANUP_DELETE",
|
||||
"HOTPLUG_SNAPSHOT" };
|
||||
"HOTPLUG_SNAPSHOT",
|
||||
"HOTPLUG_NIC" };
|
||||
|
||||
private static final String[] SHORT_LCM_STATES =
|
||||
{
|
||||
|
@ -52,7 +52,7 @@ module OpenNebula
|
||||
SAVE_MIGRATE PROLOG_MIGRATE PROLOG_RESUME EPILOG_STOP EPILOG
|
||||
SHUTDOWN CANCEL FAILURE CLEANUP_RESUBMIT UNKNOWN HOTPLUG SHUTDOWN_POWEROFF
|
||||
BOOT_UNKNOWN BOOT_POWEROFF BOOT_SUSPENDED BOOT_STOPPED CLEANUP_DELETE
|
||||
HOTPLUG_SNAPSHOT}
|
||||
HOTPLUG_SNAPSHOT HOTPLUG_NIC}
|
||||
|
||||
SHORT_VM_STATES={
|
||||
"INIT" => "init",
|
||||
@ -90,7 +90,8 @@ module OpenNebula
|
||||
"BOOT_SUSPENDED" => "boot",
|
||||
"BOOT_STOPPED" => "boot",
|
||||
"CLEANUP_DELETE" => "clea",
|
||||
"HOTPLUG_SNAPSHOT" => "snap"
|
||||
"HOTPLUG_SNAPSHOT" => "snap",
|
||||
"HOTPLUG_NIC" => "hotp"
|
||||
}
|
||||
|
||||
MIGRATE_REASON=%w{NONE ERROR STOP_RESUME USER CANCEL}
|
||||
|
@ -103,7 +103,8 @@ var oZones = {
|
||||
"BOOT_SUSPENDED",
|
||||
"BOOT_STOPPED",
|
||||
"CLEANUP_DELETE",
|
||||
"HOTPLUG_SNAPSHOT"][value]);
|
||||
"HOTPLUG_SNAPSHOT",
|
||||
"HOTPLUG_NIC"][value]);
|
||||
break;
|
||||
case "IMAGE":
|
||||
case "image":
|
||||
|
@ -111,7 +111,8 @@ var OpenNebula = {
|
||||
"BOOT_SUSPENDED",
|
||||
"BOOT_STOPPED",
|
||||
"CLEANUP_DELETE",
|
||||
"HOTPLUG_SNAPSHOT"][value]);
|
||||
"HOTPLUG_SNAPSHOT",
|
||||
"HOTPLUG_NIC"][value]);
|
||||
break;
|
||||
case "IMAGE":
|
||||
case "image":
|
||||
|
@ -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
|
||||
//Used to calculate bandwidth
|
||||
|
Loading…
Reference in New Issue
Block a user