mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-19 03:12:55 +09:00
Merge remote-tracking branch 'origin/one-4.0' into feature-1825
Conflicts: share/doc/states/states-simple.dot src/sunstone/public/js/layout.js src/sunstone/public/js/plugins/files-tab.js src/sunstone/public/js/plugins/templates-tab.js
This commit is contained in:
commit
d42ef854b9
92 files changed
+6423
-3778
No files matched your search
@@ -46,6 +46,7 @@ public:
|
||||
{
|
||||
SUSPEND_SUCCESS,/**< Send by LCM when a VM is suspended*/
|
||||
STOP_SUCCESS, /**< Send by LCM when a VM is stopped*/
|
||||
UNDEPLOY_SUCCESS, /**< Send by LCM when a VM is undeployed and saved*/
|
||||
POWEROFF_SUCCESS, /**< Send by LCM when a VM is powered off */
|
||||
DONE, /**< Send by LCM when a VM is shut down*/
|
||||
FAILED, /**< Send by LCM when one of the execution steps fails*/
|
||||
@@ -130,14 +131,27 @@ public:
|
||||
int shutdown (
|
||||
int vid);
|
||||
|
||||
/**
|
||||
* Shuts down a VM, but it is saved in the system DS instead of destroyed.
|
||||
* @param vid VirtualMachine identification
|
||||
* @param hard True to force the shutdown (cancel instead of shutdown)
|
||||
* @return 0 on success, -1 if the VM does not exits or -2 if the VM is
|
||||
* in a wrong a state
|
||||
*/
|
||||
int undeploy (
|
||||
int vid,
|
||||
bool hard);
|
||||
|
||||
/**
|
||||
* Powers off a VM.
|
||||
* @param vid VirtualMachine identification
|
||||
* @param hard True to force the poweroff (cancel instead of shutdown)
|
||||
* @return 0 on success, -1 if the VM does not exits or -2 if the VM is
|
||||
* in a wrong a state
|
||||
*/
|
||||
int poweroff (
|
||||
int vid);
|
||||
int vid,
|
||||
bool hard);
|
||||
|
||||
/**
|
||||
* Holds a VM.
|
||||
@@ -396,6 +410,8 @@ private:
|
||||
|
||||
void stop_success_action(int vid);
|
||||
|
||||
void undeploy_success_action(int vid);
|
||||
|
||||
void poweroff_success_action(int vid);
|
||||
|
||||
void done_action(int vid);
|
||||
|
||||
+197
-7
@@ -28,13 +28,201 @@ using namespace std;
|
||||
class History:public ObjectSQL, public ObjectXML
|
||||
{
|
||||
public:
|
||||
enum MigrationReason
|
||||
enum EndReason
|
||||
{
|
||||
NONE, /** < Normal termination in host */
|
||||
ERROR, /** < The VM was migrated because of an error */
|
||||
STOP_RESUME,/** < The VM was migrated because of a stop/resume request*/
|
||||
USER, /** < The VM was migrated because of an explicit request */
|
||||
CANCEL /** < The VM was migrated because of an explicit cancel */
|
||||
NONE, /** < History record is not closed yet */
|
||||
ERROR, /** < History record was closed because of an error */
|
||||
USER /** < History record was closed because of a user action */
|
||||
};
|
||||
|
||||
enum VMAction
|
||||
{
|
||||
NONE_ACTION,
|
||||
MIGRATE_ACTION,
|
||||
LIVE_MIGRATE_ACTION,
|
||||
SHUTDOWN_ACTION,
|
||||
SHUTDOWN_HARD_ACTION,
|
||||
UNDEPLOY_ACTION,
|
||||
UNDEPLOY_HARD_ACTION,
|
||||
HOLD_ACTION,
|
||||
RELEASE_ACTION,
|
||||
STOP_ACTION,
|
||||
SUSPEND_ACTION,
|
||||
RESUME_ACTION,
|
||||
BOOT_ACTION,
|
||||
DESTROY_ACTION,
|
||||
DESTROY_RECREATE_ACTION,
|
||||
REBOOT_ACTION,
|
||||
REBOOT_HARD_ACTION,
|
||||
RESCHED_ACTION,
|
||||
UNRESCHED_ACTION,
|
||||
POWEROFF_ACTION,
|
||||
POWEROFF_HARD_ACTION
|
||||
};
|
||||
|
||||
static string action_to_str(VMAction action)
|
||||
{
|
||||
string st;
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case MIGRATE_ACTION:
|
||||
st = "migrate";
|
||||
break;
|
||||
case LIVE_MIGRATE_ACTION:
|
||||
st = "live-migrate";
|
||||
break;
|
||||
case SHUTDOWN_ACTION:
|
||||
st = "shutdown";
|
||||
break;
|
||||
case SHUTDOWN_HARD_ACTION:
|
||||
st = "shutdown-hard";
|
||||
break;
|
||||
case UNDEPLOY_ACTION:
|
||||
st = "undeploy";
|
||||
break;
|
||||
case UNDEPLOY_HARD_ACTION:
|
||||
st = "undeploy-hard";
|
||||
break;
|
||||
case HOLD_ACTION:
|
||||
st = "hold";
|
||||
break;
|
||||
case RELEASE_ACTION:
|
||||
st = "release";
|
||||
break;
|
||||
case STOP_ACTION:
|
||||
st = "stop";
|
||||
break;
|
||||
case SUSPEND_ACTION:
|
||||
st = "suspend";
|
||||
break;
|
||||
case RESUME_ACTION:
|
||||
st = "resume";
|
||||
break;
|
||||
case BOOT_ACTION:
|
||||
st = "boot";
|
||||
break;
|
||||
case DESTROY_ACTION:
|
||||
st = "destroy";
|
||||
break;
|
||||
case DESTROY_RECREATE_ACTION:
|
||||
st = "destroy-recreate";
|
||||
break;
|
||||
case REBOOT_ACTION:
|
||||
st = "reboot";
|
||||
break;
|
||||
case REBOOT_HARD_ACTION:
|
||||
st = "reboot-hard";
|
||||
break;
|
||||
case RESCHED_ACTION:
|
||||
st = "resched";
|
||||
break;
|
||||
case UNRESCHED_ACTION:
|
||||
st = "unresched";
|
||||
break;
|
||||
case POWEROFF_ACTION:
|
||||
st = "poweroff";
|
||||
break;
|
||||
case POWEROFF_HARD_ACTION:
|
||||
st = "poweroff-hard";
|
||||
break;
|
||||
case NONE_ACTION:
|
||||
st = "none";
|
||||
break;
|
||||
}
|
||||
|
||||
return st;
|
||||
};
|
||||
|
||||
static int action_from_str(string& st, VMAction& action)
|
||||
{
|
||||
if (st == "migrate")
|
||||
{
|
||||
action = MIGRATE_ACTION;
|
||||
}
|
||||
else if (st == "live-migrate")
|
||||
{
|
||||
action = LIVE_MIGRATE_ACTION;
|
||||
}
|
||||
else if (st == "shutdown")
|
||||
{
|
||||
action = SHUTDOWN_ACTION;
|
||||
}
|
||||
else if (st == "shutdown-hard")
|
||||
{
|
||||
action = SHUTDOWN_HARD_ACTION;
|
||||
}
|
||||
else if (st == "undeploy")
|
||||
{
|
||||
action = UNDEPLOY_ACTION;
|
||||
}
|
||||
else if (st == "undeploy-hard")
|
||||
{
|
||||
action = UNDEPLOY_HARD_ACTION;
|
||||
}
|
||||
else if (st == "hold")
|
||||
{
|
||||
action = HOLD_ACTION;
|
||||
}
|
||||
else if (st == "release")
|
||||
{
|
||||
action = RELEASE_ACTION;
|
||||
}
|
||||
else if (st == "stop")
|
||||
{
|
||||
action = STOP_ACTION;
|
||||
}
|
||||
else if (st == "suspend")
|
||||
{
|
||||
action = SUSPEND_ACTION;
|
||||
}
|
||||
else if (st == "resume")
|
||||
{
|
||||
action = RESUME_ACTION;
|
||||
}
|
||||
else if (st == "boot")
|
||||
{
|
||||
action = BOOT_ACTION;
|
||||
}
|
||||
else if (st == "destroy")
|
||||
{
|
||||
action = DESTROY_ACTION;
|
||||
}
|
||||
else if (st == "destroy-recreate")
|
||||
{
|
||||
action = DESTROY_RECREATE_ACTION;
|
||||
}
|
||||
else if (st == "reboot")
|
||||
{
|
||||
action = REBOOT_ACTION;
|
||||
}
|
||||
else if (st == "reboot-hard")
|
||||
{
|
||||
action = REBOOT_HARD_ACTION;
|
||||
}
|
||||
else if (st == "resched")
|
||||
{
|
||||
action = RESCHED_ACTION;
|
||||
}
|
||||
else if (st == "unresched")
|
||||
{
|
||||
action = UNRESCHED_ACTION;
|
||||
}
|
||||
else if (st == "poweroff")
|
||||
{
|
||||
action = POWEROFF_ACTION;
|
||||
}
|
||||
else if (st == "poweroff-hard")
|
||||
{
|
||||
action = POWEROFF_HARD_ACTION;
|
||||
}
|
||||
else
|
||||
{
|
||||
action = NONE_ACTION;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
History(int oid, int _seq = -1);
|
||||
@@ -109,7 +297,9 @@ private:
|
||||
time_t epilog_stime;
|
||||
time_t epilog_etime;
|
||||
|
||||
MigrationReason reason;
|
||||
EndReason reason;
|
||||
|
||||
VMAction action;
|
||||
|
||||
string vm_info;
|
||||
|
||||
|
||||
@@ -84,7 +84,10 @@ public:
|
||||
MIGRATE, /**< Sent by the DM to migrate a VM to other host */
|
||||
LIVE_MIGRATE, /**< Sent by the DM to live-migrate a VM */
|
||||
SHUTDOWN, /**< Sent by the DM to shutdown a running VM */
|
||||
UNDEPLOY, /**< Sent by the DM to undeploy a running VM */
|
||||
UNDEPLOY_HARD, /**< Sent by the DM to force undeploy a running VM */
|
||||
POWEROFF, /**< Sent by the DM to power off a running VM */
|
||||
POWEROFF_HARD, /**< Sent by the DM to power off hard a running VM */
|
||||
RESTART, /**< Sent by the DM to restart a deployed VM */
|
||||
DELETE, /**< Sent by the DM to delete a VM */
|
||||
CLEAN, /**< Sent by the DM to cleanup a VM for resubmission*/
|
||||
@@ -247,8 +250,14 @@ private:
|
||||
|
||||
void shutdown_action(int vid);
|
||||
|
||||
void undeploy_action(int vid, bool hard);
|
||||
|
||||
void poweroff_action(int vid);
|
||||
|
||||
void poweroff_hard_action(int vid);
|
||||
|
||||
void poweroff_action(int vid, bool hard);
|
||||
|
||||
void failure_action(VirtualMachine * vm);
|
||||
|
||||
void restart_action(int vid);
|
||||
|
||||
+43
-11
@@ -58,7 +58,8 @@ public:
|
||||
SUSPENDED = 5,
|
||||
DONE = 6,
|
||||
FAILED = 7,
|
||||
POWEROFF = 8
|
||||
POWEROFF = 8,
|
||||
UNDEPLOYED = 9
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -94,7 +95,11 @@ public:
|
||||
HOTPLUG_NIC = 25,
|
||||
HOTPLUG_SAVEAS = 26,
|
||||
HOTPLUG_SAVEAS_POWEROFF = 27,
|
||||
HOTPLUG_SAVEAS_SUSPENDED = 28
|
||||
HOTPLUG_SAVEAS_SUSPENDED = 28,
|
||||
SHUTDOWN_UNDEPLOY = 29,
|
||||
EPILOG_UNDEPLOY = 30,
|
||||
PROLOG_UNDEPLOY = 31,
|
||||
BOOT_UNDEPLOY = 32
|
||||
};
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -493,14 +498,23 @@ public:
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the reason that originated the VM migration in the previous host
|
||||
* @return the migration reason to leave this host
|
||||
* Returns the reason that closed the history record in the previous host
|
||||
* @return the reason to close the history record in the previous host
|
||||
*/
|
||||
const History::MigrationReason get_previous_reason() const
|
||||
const History::EndReason get_previous_reason() const
|
||||
{
|
||||
return previous_history->reason;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the action that closed the history record in the previous host
|
||||
* @return the action that closed the history record in the previous host
|
||||
*/
|
||||
const History::VMAction get_previous_action() const
|
||||
{
|
||||
return previous_history->action;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get host id where the VM is or is going to execute. The hasHistory()
|
||||
* function MUST be called before this one.
|
||||
@@ -626,23 +640,41 @@ public:
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the reason that originated the VM migration
|
||||
* @param _reason migration reason to leave this host
|
||||
* Sets the reason that closed the history record
|
||||
* @param _reason reason to close the history record
|
||||
*/
|
||||
void set_reason(History::MigrationReason _reason)
|
||||
void set_reason(History::EndReason _reason)
|
||||
{
|
||||
history->reason=_reason;
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the reason that originated the VM migration in the previous host
|
||||
* @param _reason migration reason to leave this host
|
||||
* Sets the reason that closed the history record in the previous host
|
||||
* @param _reason reason to close the history record in the previous host
|
||||
*/
|
||||
void set_previous_reason(History::MigrationReason _reason)
|
||||
void set_previous_reason(History::EndReason _reason)
|
||||
{
|
||||
previous_history->reason=_reason;
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the action that closed the history record
|
||||
* @param action that closed the history record
|
||||
*/
|
||||
void set_action(History::VMAction action)
|
||||
{
|
||||
history->action = action;
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the action that closed the history record in the previous host
|
||||
* @param action that closed the history record in the previous host
|
||||
*/
|
||||
void set_previous_action(History::VMAction action)
|
||||
{
|
||||
previous_history->action = action;
|
||||
};
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Template
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
@@ -1026,6 +1026,7 @@ ONEDB_MIGRATOR_FILES="src/onedb/2.0_to_2.9.80.rb \
|
||||
src/onedb/3.8.2_to_3.8.3.rb \
|
||||
src/onedb/3.8.3_to_3.8.4.rb \
|
||||
src/onedb/3.8.4_to_3.9.80.rb \
|
||||
src/onedb/3.9.80_to_4.0.0.rb \
|
||||
src/onedb/fsck.rb \
|
||||
src/onedb/onedb.rb \
|
||||
src/onedb/onedb_backend.rb"
|
||||
@@ -1523,6 +1524,7 @@ SUNSTONE_PUBLIC_IMAGES_FILES="src/sunstone/public/images/ajax-loader.gif \
|
||||
src/sunstone/public/images/opennebula-sunstone-big.png \
|
||||
src/sunstone/public/images/opennebula-sunstone-small.png \
|
||||
src/sunstone/public/images/opennebula-sunstone-v4.0.png \
|
||||
src/sunstone/public/images/opennebula-sunstone-v4.0-small.png \
|
||||
src/sunstone/public/images/panel.png \
|
||||
src/sunstone/public/images/panel_short.png \
|
||||
src/sunstone/public/images/pbar.gif \
|
||||
|
||||
@@ -19,14 +19,13 @@ digraph OpenNebula {
|
||||
"ANY \\ {suspended,poweroff,done}" [ shape="box" ];
|
||||
|
||||
subgraph { rank = min; user}
|
||||
subgraph { rank = same; boot; boot_stopped boot_suspended; boot_unknown; boot_poweroff; unknown; color="white"}
|
||||
subgraph { rank = same; boot; boot_stopped; boot_undeploy; boot_suspended; boot_unknown; boot_poweroff; unknown; color="white"}
|
||||
subgraph { rank = same; pending; hold; color="white"}
|
||||
subgraph { rank = same; prolog; prolog_resume; prolog_migrate; color="white" }
|
||||
// subgraph { rank = same; prolog; prolog_resume; prolog_migrate; save_migrate; color="white" }
|
||||
|
||||
subgraph { rank = max; suspended; done; failure;
|
||||
stopped; poweroff; ANY; color="white" }
|
||||
// stopped; poweroff; color="white" }
|
||||
stopped; undeployed; poweroff; ANY; color="white" }
|
||||
|
||||
# create
|
||||
user -> pending [label="create"];
|
||||
@@ -35,6 +34,9 @@ digraph OpenNebula {
|
||||
pending -> prolog_resume [label="deploy\n(from stopped)"];
|
||||
prolog_resume -> boot_stopped [style="dashed"];
|
||||
|
||||
pending -> prolog_undeploy [label="deploy\n(from undeployed)"];
|
||||
prolog_undeploy -> boot_undeploy [style="dashed"];
|
||||
|
||||
pending -> prolog [label="deploy"];
|
||||
prolog -> boot [style="dashed"];
|
||||
boot -> running [style="dashed"];
|
||||
@@ -46,14 +48,19 @@ digraph OpenNebula {
|
||||
|
||||
shutdown -> running [style="dotted"];
|
||||
|
||||
# shutdown --hard
|
||||
running -> cancel [label="shutdown --hard"];
|
||||
cancel -> epilog [style="dashed"];
|
||||
cancel -> running [style="dotted"];
|
||||
|
||||
# poweroff
|
||||
running -> shutdown_poweroff [label="poweroff"];
|
||||
running -> shutdown_poweroff [label="poweroff [--hard]"];
|
||||
shutdown_poweroff -> poweroff [style="dashed"];
|
||||
|
||||
shutdown_poweroff -> running [style="dotted"];
|
||||
|
||||
# livemigrate
|
||||
running -> migrate [label="livemigrate"];
|
||||
running -> migrate [label="migrate --live"];
|
||||
migrate -> running [style="dashed"];
|
||||
|
||||
# migrate
|
||||
@@ -74,10 +81,11 @@ digraph OpenNebula {
|
||||
save_stop -> running [style="dotted"];
|
||||
epilog_stop -> stopped [style="dashed"];
|
||||
|
||||
# cancel
|
||||
running -> cancel [label="cancel"];
|
||||
cancel -> epilog [style="dashed"];
|
||||
cancel -> running [style="dotted"];
|
||||
# undeploy
|
||||
running -> shutdown_undeploy [label="undeploy [--hard]"];
|
||||
shutdown_undeploy -> epilog_undeploy [style="dashed"];
|
||||
shutdown_undeploy -> running [style="dotted"];
|
||||
epilog_undeploy -> undeployed [style="dashed"];
|
||||
|
||||
# suspend
|
||||
running -> save_suspend [label="suspend"];
|
||||
@@ -88,48 +96,73 @@ digraph OpenNebula {
|
||||
stopped -> pending [label="resume"];
|
||||
boot_stopped -> running [style="dashed"];
|
||||
|
||||
undeployed -> pending [label="resume"];
|
||||
boot_undeploy -> running [style="dashed"];
|
||||
|
||||
suspended -> boot_suspended [label="resume"];
|
||||
boot_suspended -> running [style="dashed"];
|
||||
|
||||
# delete
|
||||
ANY -> done [label="delete"];
|
||||
|
||||
# restart
|
||||
boot -> boot [label="restart"];
|
||||
boot_suspended -> boot_suspended [label="restart"];
|
||||
boot_stopped -> boot_stopped [label="restart"];
|
||||
|
||||
poweroff -> boot_poweroff [label="restart"];
|
||||
boot_poweroff -> boot_poweroff [label="restart"];
|
||||
poweroff -> boot_poweroff [label="resume"];
|
||||
boot_poweroff -> running [style="dashed"];
|
||||
|
||||
unknown -> boot_unknown [label="restart"];
|
||||
boot_unknown -> boot_unknown [label="restart"];
|
||||
boot_unknown -> running [style="dashed"];
|
||||
|
||||
# reboot, reset
|
||||
running -> running [label="reboot / reset"];
|
||||
|
||||
# attachdisk
|
||||
running -> hotplug [label="attachdisk /\ndetachdisk"]
|
||||
hotplug -> running [style="dashed"];
|
||||
# destroy
|
||||
ANY -> done [label="destroy"];
|
||||
|
||||
# resubmit
|
||||
"ANY \\ {suspended,poweroff,done}" -> pending [label="resubmit"];
|
||||
"ANY \\ {suspended,poweroff,done}" -> pending [label="destroy --recreate"];
|
||||
|
||||
# boot
|
||||
boot -> boot [label="boot"];
|
||||
boot_suspended -> boot_suspended [label="boot"];
|
||||
boot_stopped -> boot_stopped [label="boot"];
|
||||
boot_poweroff -> boot_poweroff [label="boot"];
|
||||
boot_undeploy -> boot_undeploy [label="boot"];
|
||||
|
||||
unknown -> boot_unknown [label="boot"];
|
||||
boot_unknown -> boot_unknown [label="boot"];
|
||||
boot_unknown -> running [style="dashed"];
|
||||
|
||||
# reboot
|
||||
running -> running [label="reboot"];
|
||||
|
||||
# disk-attach
|
||||
running -> hotplug [label="disk-attach /\n-detach"]
|
||||
hotplug -> running [style="dashed"];
|
||||
|
||||
# nic-attach
|
||||
running -> hotplug_nic [label="nic-attach /\n-detach"]
|
||||
hotplug_nic -> running [style="dashed"];
|
||||
|
||||
# snapshot
|
||||
running -> hotplug_snapshot [label="snapshot-create /\n-revert /\n-delete"]
|
||||
hotplug_snapshot -> running [style="dashed"];
|
||||
|
||||
# disk-snapshot
|
||||
running -> hotplug_saveas [label="disk-snapshot"]
|
||||
hotplug_saveas -> running [style="dashed"];
|
||||
|
||||
poweroff -> hotplug_saveas_poweroff [label="disk-snapshot"]
|
||||
hotplug_saveas_poweroff -> poweroff [style="dashed"];
|
||||
|
||||
suspended -> hotplug_saveas_suspended [label="disk-snapshot"]
|
||||
hotplug_saveas_suspended -> suspended [style="dashed"];
|
||||
|
||||
# failures and misc.
|
||||
epilog_stop -> failure [style="dotted"];
|
||||
epilog -> failure [style="dotted"];
|
||||
epilog_undeploy -> failure [style="dotted"];
|
||||
|
||||
prolog -> failure [style="dotted"];
|
||||
prolog_migrate -> failure [style="dotted"];
|
||||
prolog_resume -> stopped [style="dotted"];
|
||||
prolog_undeploy -> undeployed [style="dotted"];
|
||||
|
||||
boot -> failure [style="dotted"];
|
||||
boot_poweroff -> poweroff [style="dotted"];
|
||||
boot_unknown -> unknown [style="dotted"];
|
||||
boot_suspended -> suspended [style="dotted"];
|
||||
boot_stopped -> epilog_stop [style="dotted"];
|
||||
boot_undeploy -> epilog_undeploy [style="dotted"];
|
||||
|
||||
running -> failure [style="dotted"];
|
||||
unknown -> failure [style="dotted"];
|
||||
|
||||
@@ -19,11 +19,11 @@ digraph OpenNebula {
|
||||
"ANY \\ {suspended,poweroff,done}" [ shape="box" ];
|
||||
|
||||
subgraph { rank = min; user}
|
||||
# subgraph { rank = same; pending; hold; color="white"}
|
||||
subgraph { rank = same; prolog; boot; color="white" }
|
||||
subgraph { rank = same; pending; hold; color="white"}
|
||||
# subgraph { rank = same; prolog; boot; color="white" }
|
||||
subgraph { rank = same; migrate; save; shutdown; unknown; hotplug; snapshot;
|
||||
color="white" }
|
||||
subgraph { rank = max; suspended; done; failure; stopped; poweroff; color="white" }
|
||||
subgraph { rank = max; suspended; done; failure; stopped; poweroff; undeployed; color="white" }
|
||||
|
||||
# create
|
||||
user -> pending [label="create"];
|
||||
@@ -36,7 +36,7 @@ digraph OpenNebula {
|
||||
# shutdown
|
||||
running -> shutdown [label="shutdown"];
|
||||
shutdown -> epilog [label="shutdown", style="dashed"];
|
||||
epilog -> done [style="dashed"];
|
||||
epilog -> done [label="shutdown", style="dashed"];
|
||||
|
||||
# poweroff
|
||||
running -> shutdown [label="poweroff"];
|
||||
@@ -62,13 +62,20 @@ digraph OpenNebula {
|
||||
save -> epilog [label="stop", style="dashed"];
|
||||
epilog -> stopped [label="stop", style="dashed"];
|
||||
|
||||
# undeploy
|
||||
running -> shutdown [label="undeploy"];
|
||||
shutdown -> epilog [label="undeploy", style="dashed"];
|
||||
epilog -> undeployed [label="undeploy", style="dashed"];
|
||||
|
||||
# suspend
|
||||
running -> save [label="suspend"];
|
||||
save -> suspended [label="suspend", style="dashed"];
|
||||
|
||||
# resume
|
||||
stopped -> pending [label="resume"];
|
||||
undeployed -> pending [label="resume"];
|
||||
suspended -> boot [label="resume"];
|
||||
poweroff -> boot [label="resume"];
|
||||
|
||||
# delete
|
||||
ANY -> done [label="destroy"];
|
||||
@@ -76,7 +83,6 @@ digraph OpenNebula {
|
||||
# restart
|
||||
unknown -> boot [label="boot"];
|
||||
boot -> boot [label="boot"];
|
||||
poweroff -> boot [label="boot"];
|
||||
|
||||
# reboot
|
||||
running -> running [label="reboot"];
|
||||
|
||||
+36
-6
@@ -22,6 +22,7 @@
|
||||
<xs:element name="VMMMAD" type="xs:string"/>
|
||||
<xs:element name="VNMMAD" type="xs:string"/>
|
||||
<xs:element name="TMMAD" type="xs:string"/>
|
||||
<xs:element name="DS_LOCATION" type="xs:string"/>
|
||||
<xs:element name="DS_ID" type="xs:integer"/>
|
||||
<xs:element name="PSTIME" type="xs:integer"/>
|
||||
<xs:element name="PETIME" type="xs:integer"/>
|
||||
@@ -31,14 +32,37 @@
|
||||
<xs:element name="EETIME" type="xs:integer"/>
|
||||
|
||||
<!-- REASON values:
|
||||
NONE = 0 Normal termination
|
||||
ERROR = 1 The VM ended in error
|
||||
STOP_RESUME = 2 Stop/resume request
|
||||
USER = 3 Migration request
|
||||
CANCEL = 4 Cancel request
|
||||
NONE = 0 History record is not closed yet
|
||||
ERROR = 1 History record was closed because of an error
|
||||
USER = 2 History record was closed because of a user action
|
||||
-->
|
||||
<xs:element name="REASON" type="xs:integer"/>
|
||||
|
||||
<!-- ACTION values:
|
||||
NONE_ACTION = 0
|
||||
MIGRATE_ACTION = 1
|
||||
LIVE_MIGRATE_ACTION = 2
|
||||
SHUTDOWN_ACTION = 3
|
||||
SHUTDOWN_HARD_ACTION = 4
|
||||
UNDEPLOY_ACTION = 5
|
||||
UNDEPLOY_HARD_ACTION = 6
|
||||
HOLD_ACTION = 7
|
||||
RELEASE_ACTION = 8
|
||||
STOP_ACTION = 9
|
||||
SUSPEND_ACTION = 10
|
||||
RESUME_ACTION = 11
|
||||
BOOT_ACTION = 12
|
||||
DESTROY_ACTION = 13
|
||||
DESTROY_RECREATE_ACTION = 14
|
||||
REBOOT_ACTION = 15
|
||||
REBOOT_HARD_ACTION = 16
|
||||
RESCHED_ACTION = 17
|
||||
UNRESCHED_ACTION = 18
|
||||
POWEROFF_ACTION = 19
|
||||
POWEROFF_HARD_ACTION = 20
|
||||
-->
|
||||
<xs:element name="ACTION" type="xs:integer"/>
|
||||
|
||||
<xs:element name="VM">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
@@ -77,6 +101,7 @@
|
||||
DONE = 6
|
||||
FAILED = 7
|
||||
POWEROFF = 8
|
||||
UNDEPLOYED = 9
|
||||
-->
|
||||
<xs:element name="STATE" type="xs:integer"/>
|
||||
|
||||
@@ -111,7 +136,11 @@
|
||||
HOTPLUG_NIC = 25,
|
||||
HOTPLUG_SAVEAS = 26,
|
||||
HOTPLUG_SAVEAS_POWEROFF = 27,
|
||||
HOTPLUG_SAVEAS_SUSPENDED = 28
|
||||
HOTPLUG_SAVEAS_SUSPENDED = 28,
|
||||
SHUTDOWN_UNDEPLOY = 29,
|
||||
EPILOG_UNDEPLOY = 30,
|
||||
PROLOG_UNDEPLOY = 31,
|
||||
BOOT_UNDEPLOY = 32
|
||||
-->
|
||||
<xs:element name="LCM_STATE" type="xs:integer"/>
|
||||
<xs:element name="RESCHED" type="xs:integer"/>
|
||||
@@ -131,6 +160,7 @@
|
||||
<!-- NET_RX: Received bytes from the network -->
|
||||
<xs:element name="NET_RX" type="xs:integer"/>
|
||||
<xs:element name="TEMPLATE" type="xs:anyType"/>
|
||||
<xs:element name="USER_TEMPLATE" type="xs:anyType"/>
|
||||
<xs:element name="HISTORY_RECORDS">
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:integer"/>
|
||||
<xs:element name="NAME" type="xs:string"/>
|
||||
<xs:element name="SYSTEM_DS" type="xs:integer"/>
|
||||
<xs:element name="HOSTS">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<xs:element name="DS_MAD" type="xs:string"/>
|
||||
<xs:element name="TM_MAD" type="xs:string"/>
|
||||
<xs:element name="BASE_PATH" type="xs:string"/>
|
||||
<xs:element name="SYSTEM" type="xs:integer"/>
|
||||
<xs:element name="TYPE" type="xs:integer"/>
|
||||
<xs:element name="DISK_TYPE" type="xs:integer"/>
|
||||
<xs:element name="CLUSTER_ID" type="xs:integer"/>
|
||||
<xs:element name="CLUSTER" type="xs:string"/>
|
||||
|
||||
@@ -78,6 +78,77 @@
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="DEFAULT_GROUP_QUOTAS">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="DATASTORE_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="DATASTORE" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:string"/>
|
||||
<xs:element name="IMAGES" type="xs:string"/>
|
||||
<xs:element name="IMAGES_USED" type="xs:string"/>
|
||||
<xs:element name="SIZE" type="xs:string"/>
|
||||
<xs:element name="SIZE_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="NETWORK_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="NETWORK" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:string"/>
|
||||
<xs:element name="LEASES" type="xs:string"/>
|
||||
<xs:element name="LEASES_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="VM_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="VM" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="CPU" type="xs:string"/>
|
||||
<xs:element name="CPU_USED" type="xs:string"/>
|
||||
<xs:element name="MEMORY" type="xs:string"/>
|
||||
<xs:element name="MEMORY_USED" type="xs:string"/>
|
||||
<xs:element name="VMS" type="xs:string"/>
|
||||
<xs:element name="VMS_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="IMAGE_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="IMAGE" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:string"/>
|
||||
<xs:element name="RVMS" type="xs:string"/>
|
||||
<xs:element name="RVMS_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
@@ -1,11 +1,160 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
|
||||
targetNamespace="http://opennebula.org/XMLSchema" xmlns="http://opennebula.org/XMLSchema">
|
||||
<xs:include schemaLocation="group.xsd"/>
|
||||
<xs:element name="GROUP_POOL">
|
||||
<xs:complexType>
|
||||
<xs:sequence maxOccurs="1" minOccurs="1">
|
||||
<xs:element ref="GROUP" maxOccurs="unbounded" minOccurs="0"/>
|
||||
<xs:element name="GROUP" maxOccurs="unbounded" minOccurs="0">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:integer"/>
|
||||
<xs:element name="NAME" type="xs:string"/>
|
||||
<xs:element name="USERS">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="DATASTORE_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="DATASTORE" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:string"/>
|
||||
<xs:element name="IMAGES" type="xs:string"/>
|
||||
<xs:element name="IMAGES_USED" type="xs:string"/>
|
||||
<xs:element name="SIZE" type="xs:string"/>
|
||||
<xs:element name="SIZE_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="NETWORK_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="NETWORK" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:string"/>
|
||||
<xs:element name="LEASES" type="xs:string"/>
|
||||
<xs:element name="LEASES_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="VM_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="VM" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="CPU" type="xs:string"/>
|
||||
<xs:element name="CPU_USED" type="xs:string"/>
|
||||
<xs:element name="MEMORY" type="xs:string"/>
|
||||
<xs:element name="MEMORY_USED" type="xs:string"/>
|
||||
<xs:element name="VMS" type="xs:string"/>
|
||||
<xs:element name="VMS_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="IMAGE_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="IMAGE" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:string"/>
|
||||
<xs:element name="RVMS" type="xs:string"/>
|
||||
<xs:element name="RVMS_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="DEFAULT_GROUP_QUOTAS" minOccurs="1" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="DATASTORE_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="DATASTORE" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:string"/>
|
||||
<xs:element name="IMAGES" type="xs:string"/>
|
||||
<xs:element name="IMAGES_USED" type="xs:string"/>
|
||||
<xs:element name="SIZE" type="xs:string"/>
|
||||
<xs:element name="SIZE_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="NETWORK_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="NETWORK" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:string"/>
|
||||
<xs:element name="LEASES" type="xs:string"/>
|
||||
<xs:element name="LEASES_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="VM_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="VM" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="CPU" type="xs:string"/>
|
||||
<xs:element name="CPU_USED" type="xs:string"/>
|
||||
<xs:element name="MEMORY" type="xs:string"/>
|
||||
<xs:element name="MEMORY_USED" type="xs:string"/>
|
||||
<xs:element name="VMS" type="xs:string"/>
|
||||
<xs:element name="VMS_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="IMAGE_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="IMAGE" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:string"/>
|
||||
<xs:element name="RVMS" type="xs:string"/>
|
||||
<xs:element name="RVMS_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
@@ -0,0 +1,516 @@
|
||||
#*******************************************************************************
|
||||
# OpenNebula Configuration file
|
||||
#*******************************************************************************
|
||||
|
||||
#*******************************************************************************
|
||||
# Daemon configuration attributes
|
||||
#-------------------------------------------------------------------------------
|
||||
# MANAGER_TIMER: Time in seconds the core uses to evaluate periodical functions.
|
||||
# MONITORING_INTERVAL cannot have a smaller value than MANAGER_TIMER.
|
||||
#
|
||||
# MONITORING_INTERVAL: Time in seconds between host and VM monitorization.
|
||||
#
|
||||
# HOST_PER_INTERVAL: Number of hosts monitored in each interval.
|
||||
# HOST_MONITORING_EXPIRATION_TIME: Time, in seconds, to expire monitoring
|
||||
# information. Use 0 to disable HOST monitoring recording.
|
||||
#
|
||||
# VM_PER_INTERVAL: Number of VMs monitored in each interval.
|
||||
# VM_MONITORING_EXPIRATION_TIME: Time, in seconds, to expire monitoring
|
||||
# information. Use 0 to disable VM monitoring recording.
|
||||
#
|
||||
# SCRIPTS_REMOTE_DIR: Remote path to store the monitoring and VM management
|
||||
# scripts.
|
||||
#
|
||||
# PORT: Port where oned will listen for xmlrpc calls.
|
||||
#
|
||||
# DB: Configuration attributes for the database backend
|
||||
# backend : can be sqlite or mysql (default is sqlite)
|
||||
# server : (mysql) host name or an IP address for the MySQL server
|
||||
# port : (mysql) port for the connection to the server.
|
||||
# If set to 0, the default port is used.
|
||||
# user : (mysql) user's MySQL login ID
|
||||
# passwd : (mysql) the password for user
|
||||
# db_name : (mysql) the database name
|
||||
#
|
||||
# VNC_BASE_PORT: VNC ports for VMs can be automatically set to VNC_BASE_PORT +
|
||||
# VMID
|
||||
#
|
||||
# LOG: Configuration for the logging system
|
||||
# system: defines the logging system:
|
||||
# file to log in the oned.log file
|
||||
# syslog to use the syslog facilities
|
||||
# debug_level: 0 = ERROR, 1 = WARNING, 2 = INFO, 3 = DEBUG
|
||||
#
|
||||
# VM_SUBMIT_ON_HOLD: Forces VMs to be created on hold state instead of pending.
|
||||
# Values: YES or NO.
|
||||
#*******************************************************************************
|
||||
|
||||
LOG = [
|
||||
system = "file",
|
||||
debug_level = 3
|
||||
]
|
||||
|
||||
MANAGER_TIMER = 2
|
||||
|
||||
MONITORING_INTERVAL = 2
|
||||
|
||||
#HOST_PER_INTERVAL = 15
|
||||
#HOST_MONITORING_EXPIRATION_TIME = 86400
|
||||
|
||||
#VM_PER_INTERVAL = 5
|
||||
#VM_MONITORING_EXPIRATION_TIME = 86400
|
||||
|
||||
SCRIPTS_REMOTE_DIR=/var/tmp/one
|
||||
|
||||
PORT = 2633
|
||||
|
||||
DB = [ backend = "sqlite" ]
|
||||
|
||||
# Sample configuration for MySQL
|
||||
# DB = [ backend = "mysql",
|
||||
# server = "localhost",
|
||||
# port = 0,
|
||||
# user = "oneadmin",
|
||||
# passwd = "oneadmin",
|
||||
# db_name = "opennebula" ]
|
||||
|
||||
VNC_BASE_PORT = 5900
|
||||
|
||||
#VM_SUBMIT_ON_HOLD = "NO"
|
||||
|
||||
#*******************************************************************************
|
||||
# Physical Networks configuration
|
||||
#*******************************************************************************
|
||||
# NETWORK_SIZE: Here you can define the default size for the virtual networks
|
||||
#
|
||||
# MAC_PREFIX: Default MAC prefix to be used to create the auto-generated MAC
|
||||
# addresses is defined here (this can be overrided by the Virtual Network
|
||||
# template)
|
||||
#*******************************************************************************
|
||||
|
||||
NETWORK_SIZE = 254
|
||||
|
||||
MAC_PREFIX = "02:00"
|
||||
|
||||
#*******************************************************************************
|
||||
# DataStore Configuration
|
||||
#*******************************************************************************
|
||||
# DATASTORE_LOCATION: *Default* Path for Datastores in the hosts. It IS the
|
||||
# same for all the hosts in the cluster. DATASTORE_LOCATION IS ONLY FOR THE
|
||||
# HOSTS AND *NOT* THE FRONT-END. It defaults to /var/lib/one/datastores (or
|
||||
# $ONE_LOCATION/var/datastores in self-contained mode)
|
||||
#
|
||||
# You can define a different DATASTORE_LOCATION in each cluster by updating
|
||||
# its properties with onecluster update.
|
||||
#
|
||||
# DEFAULT_IMAGE_TYPE: This can take values
|
||||
# OS Image file holding an operating system
|
||||
# CDROM Image file holding a CDROM
|
||||
# DATABLOCK Image file holding a datablock,
|
||||
# always created as an empty block
|
||||
# DEFAULT_DEVICE_PREFIX: This can be set to
|
||||
# hd IDE prefix
|
||||
# sd SCSI
|
||||
# xvd XEN Virtual Disk
|
||||
# vd KVM virtual disk
|
||||
#*******************************************************************************
|
||||
|
||||
#DATASTORE_LOCATION = /var/lib/one/datastores
|
||||
|
||||
DEFAULT_IMAGE_TYPE = "OS"
|
||||
DEFAULT_DEVICE_PREFIX = "hd"
|
||||
|
||||
#*******************************************************************************
|
||||
# Information Driver Configuration
|
||||
#*******************************************************************************
|
||||
# You can add more information managers with different configurations but make
|
||||
# sure it has different names.
|
||||
#
|
||||
# name : name for this information manager
|
||||
#
|
||||
# executable: path of the information driver executable, can be an
|
||||
# absolute path or relative to $ONE_LOCATION/lib/mads (or
|
||||
# /usr/lib/one/mads/ if OpenNebula was installed in /)
|
||||
#
|
||||
# arguments : for the driver executable, usually a probe configuration file,
|
||||
# can be an absolute path or relative to $ONE_LOCATION/etc (or
|
||||
# /etc/one/ if OpenNebula was installed in /)
|
||||
#*******************************************************************************
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# KVM Information Driver Manager Configuration
|
||||
# -r number of retries when monitoring a host
|
||||
# -t number of threads, i.e. number of hosts monitored at the same time
|
||||
#-------------------------------------------------------------------------------
|
||||
IM_MAD = [
|
||||
name = "kvm",
|
||||
executable = "one_im_ssh",
|
||||
arguments = "-r 0 -t 15 kvm" ]
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# XEN Information Driver Manager Configuration
|
||||
# -r number of retries when monitoring a host
|
||||
# -t number of threads, i.e. number of hosts monitored at the same time
|
||||
#-------------------------------------------------------------------------------
|
||||
#IM_MAD = [
|
||||
# name = "xen",
|
||||
# executable = "one_im_ssh",
|
||||
# arguments = "xen" ]
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# VMware Information Driver Manager Configuration
|
||||
# -r number of retries when monitoring a host
|
||||
# -t number of threads, i.e. number of hosts monitored at the same time
|
||||
#-------------------------------------------------------------------------------
|
||||
#IM_MAD = [
|
||||
# name = "vmware",
|
||||
# executable = "one_im_sh",
|
||||
# arguments = "-c -t 15 -r 0 vmware" ]
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# EC2 Information Driver Manager Configuration
|
||||
#-------------------------------------------------------------------------------
|
||||
#IM_MAD = [
|
||||
# name = "ec2",
|
||||
# executable = "one_im_ec2",
|
||||
# arguments = "im_ec2/im_ec2.conf" ]
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Ganglia Information Driver Manager Configuration
|
||||
#-----------------------------------------------------------------------------
|
||||
#IM_MAD = [
|
||||
# name = "ganglia",
|
||||
# executable = "one_im_sh",
|
||||
# arguments = "ganglia" ]
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Dummy Information Driver Manager Configuration
|
||||
#-------------------------------------------------------------------------------
|
||||
IM_MAD = [ name="dummy", executable="one_im_dummy"]
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
#*******************************************************************************
|
||||
# Virtualization Driver Configuration
|
||||
#*******************************************************************************
|
||||
# You can add more virtualization managers with different configurations but
|
||||
# make sure it has different names.
|
||||
#
|
||||
# name : name of the virtual machine manager driver
|
||||
#
|
||||
# executable: path of the virtualization driver executable, can be an
|
||||
# absolute path or relative to $ONE_LOCATION/lib/mads (or
|
||||
# /usr/lib/one/mads/ if OpenNebula was installed in /)
|
||||
#
|
||||
# arguments : for the driver executable
|
||||
#
|
||||
# default : default values and configuration parameters for the driver, can
|
||||
# be an absolute path or relative to $ONE_LOCATION/etc (or
|
||||
# /etc/one/ if OpenNebula was installed in /)
|
||||
#
|
||||
# type : driver type, supported drivers: xen, kvm, xml
|
||||
#*******************************************************************************
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# KVM Virtualization Driver Manager Configuration
|
||||
# -r number of retries when monitoring a host
|
||||
# -t number of threads, i.e. number of hosts monitored at the same time
|
||||
# -l <actions[=command_name]> actions executed locally, command can be
|
||||
# overridden for each action.
|
||||
# Valid actions: deploy, shutdown, cancel, save, restore, migrate, poll
|
||||
# An example: "-l migrate,poll=poll_ganglia,save"
|
||||
#-------------------------------------------------------------------------------
|
||||
VM_MAD = [
|
||||
name = "kvm",
|
||||
executable = "one_vmm_exec",
|
||||
arguments = "-t 15 -r 0 kvm",
|
||||
default = "vmm_exec/vmm_exec_kvm.conf",
|
||||
type = "kvm" ]
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# XEN Virtualization Driver Manager Configuration
|
||||
# -r number of retries when monitoring a host
|
||||
# -t number of threads, i.e. number of hosts monitored at the same time
|
||||
# -l <actions[=command_name]> actions executed locally, command can be
|
||||
# overridden for each action.
|
||||
# Valid actions: deploy, shutdown, cancel, save, restore, migrate, poll
|
||||
# An example: "-l migrate,poll=poll_ganglia,save"
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
# Driver for Xen 3.x
|
||||
#VM_MAD = [
|
||||
# name = "xen",
|
||||
# executable = "one_vmm_exec",
|
||||
# arguments = "-t 15 -r 0 xen3",
|
||||
# default = "vmm_exec/vmm_exec_xen3.conf",
|
||||
# type = "xen" ]
|
||||
|
||||
# Driver for Xen 4.x
|
||||
#VM_MAD = [
|
||||
# name = "xen",
|
||||
# executable = "one_vmm_exec",
|
||||
# arguments = "-t 15 -r 0 xen4",
|
||||
# default = "vmm_exec/vmm_exec_xen4.conf",
|
||||
# type = "xen" ]
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# VMware Virtualization Driver Manager Configuration
|
||||
# -r number of retries when monitoring a host
|
||||
# -t number of threads, i.e. number of hosts monitored at the same time
|
||||
#-------------------------------------------------------------------------------
|
||||
#VM_MAD = [
|
||||
# name = "vmware",
|
||||
# executable = "one_vmm_sh",
|
||||
# arguments = "-t 15 -r 0 vmware -s sh",
|
||||
# default = "vmm_exec/vmm_exec_vmware.conf",
|
||||
# type = "vmware" ]
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# EC2 Virtualization Driver Manager Configuration
|
||||
# arguments: default values for the EC2 driver, can be an absolute path or
|
||||
# relative to $ONE_LOCATION/etc (or /etc/one/ if OpenNebula was
|
||||
# installed in /).
|
||||
#-------------------------------------------------------------------------------
|
||||
#VM_MAD = [
|
||||
# name = "ec2",
|
||||
# executable = "one_vmm_ec2",
|
||||
# arguments = "vmm_ec2/vmm_ec2.conf",
|
||||
# type = "xml" ]
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Dummy Virtualization Driver Configuration
|
||||
#-------------------------------------------------------------------------------
|
||||
VM_MAD = [ name="dummy", executable="one_vmm_dummy", type="xml" ]
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
#*******************************************************************************
|
||||
# Transfer Manager Driver Configuration
|
||||
#*******************************************************************************
|
||||
# You can add more transfer managers with different configurations but make
|
||||
# sure it has different names.
|
||||
# name : name for this transfer driver
|
||||
#
|
||||
# executable: path of the transfer driver executable, can be an
|
||||
# absolute path or relative to $ONE_LOCATION/lib/mads (or
|
||||
# /usr/lib/one/mads/ if OpenNebula was installed in /)
|
||||
# arguments :
|
||||
# -t: number of threads, i.e. number of transfers made at the same time
|
||||
# -d: list of transfer drivers separated by commas, if not defined all the
|
||||
# drivers available will be enabled
|
||||
#*******************************************************************************
|
||||
|
||||
TM_MAD = [
|
||||
executable = "one_tm",
|
||||
arguments = "-t 15 -d dummy,lvm,shared,qcow2,ssh,vmfs,iscsi,ceph" ]
|
||||
|
||||
#*******************************************************************************
|
||||
# Datastore Driver Configuration
|
||||
#*******************************************************************************
|
||||
# Drivers to manage the datastores, specialized for the storage backend
|
||||
# executable: path of the transfer driver executable, can be an
|
||||
# absolute path or relative to $ONE_LOCATION/lib/mads (or
|
||||
# /usr/lib/one/mads/ if OpenNebula was installed in /)
|
||||
#
|
||||
# arguments : for the driver executable
|
||||
# -t number of threads, i.e. number of repo operations at the same time
|
||||
# -d datastore mads separated by commas
|
||||
#*******************************************************************************
|
||||
|
||||
DATASTORE_MAD = [
|
||||
executable = "one_datastore",
|
||||
arguments = "-t 15 -d fs,vmware,vmfs,iscsi,lvm,ceph"
|
||||
]
|
||||
|
||||
#*******************************************************************************
|
||||
# Hook Manager Configuration
|
||||
#*******************************************************************************
|
||||
# The Driver (HM_MAD)
|
||||
# -----------------------------------------------
|
||||
#
|
||||
# Used to execute the Hooks:
|
||||
# executable: path of the hook driver executable, can be an
|
||||
# absolute path or relative to $ONE_LOCATION/lib/mads (or
|
||||
# /usr/lib/one/mads/ if OpenNebula was installed in /)
|
||||
#
|
||||
# arguments : for the driver executable, can be an absolute path or relative
|
||||
# to $ONE_LOCATION/etc (or /etc/one/ if OpenNebula was installed
|
||||
# in /)
|
||||
#
|
||||
# Virtual Machine Hooks (VM_HOOK)
|
||||
# -------------------------------
|
||||
#
|
||||
# Defined by:
|
||||
# name : for the hook, useful to track the hook (OPTIONAL)
|
||||
# on : when the hook should be executed,
|
||||
# - CREATE, when the VM is created (onevm create)
|
||||
# - PROLOG, when the VM is in the prolog state
|
||||
# - RUNNING, after the VM is successfully booted
|
||||
# - UNKNOWN, when the VM is in the unknown state
|
||||
# - SHUTDOWN, after the VM is shutdown
|
||||
# - STOP, after the VM is stopped (including VM image transfers)
|
||||
# - DONE, after the VM is deleted or shutdown
|
||||
# - FAILED, when the VM enters the failed state
|
||||
# command : path is relative to $ONE_LOCATION/var/remotes/hook
|
||||
# (self-contained) or to /var/lib/one/remotes/hook (system-wide).
|
||||
# That directory will be copied on the hosts under
|
||||
# SCRIPTS_REMOTE_DIR. It can be an absolute path that must exist
|
||||
# on the target host
|
||||
# arguments : for the hook. You can access to VM information with $
|
||||
# - $ID, the ID of the virtual machine
|
||||
# - $TEMPLATE, the VM template in xml and base64 encoded
|
||||
# remote : values,
|
||||
# - YES, The hook is executed in the host where the VM was
|
||||
# allocated
|
||||
# - NO, The hook is executed in the OpenNebula server (default)
|
||||
#
|
||||
# Host Hooks (HOST_HOOK)
|
||||
# -------------------------------
|
||||
#
|
||||
# Defined by:
|
||||
# name : for the hook, useful to track the hook (OPTIONAL)
|
||||
# on : when the hook should be executed,
|
||||
# - CREATE, when the Host is created (onehost create)
|
||||
# - ERROR, when the Host enters the error state
|
||||
# - DISABLE, when the Host is disabled
|
||||
# command : path is relative to $ONE_LOCATION/var/remotes/hook
|
||||
# (self-contained) or to /var/lib/one/remotes/hook (system-wide).
|
||||
# That directory will be copied on the hosts under
|
||||
# SCRIPTS_REMOTE_DIR. It can be an absolute path that must exist
|
||||
# on the target host.
|
||||
# arguments : for the hook. You can use the following Host information:
|
||||
# - $ID, the ID of the host
|
||||
# - $TEMPLATE, the Host template in xml and base64 encoded
|
||||
# remote : values,
|
||||
# - YES, The hook is executed in the host
|
||||
# - NO, The hook is executed in the OpenNebula server (default)
|
||||
#
|
||||
# Virtual Network (VNET_HOOK)
|
||||
# User (USER_HOOK)
|
||||
# Group (GROUP_HOOK)
|
||||
# Image (IMAGE_HOOK)
|
||||
# -------------------------------
|
||||
#
|
||||
# These hooks are executed when one of the referring entities are created or
|
||||
# removed. Each hook is defined by:
|
||||
# name : for the hook, useful to track the hook (OPTIONAL)
|
||||
# on : when the hook should be executed,
|
||||
# - CREATE, when the vnet is created
|
||||
# - REMOVE, when the vnet is removed
|
||||
# command : path is relative to $ONE_LOCATION/var/remotes/hook
|
||||
# (self-contained) or to /var/lib/one/remotes/hook (system-wide).
|
||||
# That directory will be copied on the hosts under
|
||||
# SCRIPTS_REMOTE_DIR. It can be an absolute path that must exist
|
||||
# on the target host.
|
||||
# arguments : for the hook. You can use the following Host information:
|
||||
# - $ID, the ID of the host
|
||||
# - $TEMPLATE, the vnet template in xml and base64 encoded
|
||||
#-------------------------------------------------------------------------------
|
||||
HM_MAD = [
|
||||
executable = "one_hm" ]
|
||||
|
||||
#*******************************************************************************
|
||||
# Fault Tolerance Hooks
|
||||
#*******************************************************************************
|
||||
# This hook is used to perform recovery actions when a host fails.
|
||||
# Script to implement host failure tolerance
|
||||
# It can be set to
|
||||
# -r recreate VMs running in the host
|
||||
# -d delete VMs running in the host
|
||||
# Additional flags
|
||||
# -f force resubmission of suspended VMs
|
||||
# -p <n> avoid resubmission if host comes
|
||||
# back after n monitoring cycles
|
||||
#*******************************************************************************
|
||||
#
|
||||
#HOST_HOOK = [
|
||||
# name = "error",
|
||||
# on = "ERROR",
|
||||
# command = "ft/host_error.rb",
|
||||
# arguments = "$ID -r",
|
||||
# remote = "no" ]
|
||||
#-------------------------------------------------------------------------------
|
||||
# These two hooks can be used to automatically delete or resubmit VMs that reach
|
||||
# the "failed" state. This way, the administrator doesn't have to interact
|
||||
# manually to release its resources or retry the deployment.
|
||||
#
|
||||
#
|
||||
# Only one of them should be uncommented.
|
||||
#-------------------------------------------------------------------------------
|
||||
#
|
||||
#VM_HOOK = [
|
||||
# name = "on_failure_delete",
|
||||
# on = "FAILED",
|
||||
# command = "/usr/bin/env onevm destroy",
|
||||
# arguments = "$ID" ]
|
||||
#
|
||||
#VM_HOOK = [
|
||||
# name = "on_failure_recreate",
|
||||
# on = "FAILED",
|
||||
# command = "/usr/bin/env onevm destroy --recreate",
|
||||
# arguments = "$ID" ]
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
#*******************************************************************************
|
||||
# Auth Manager Configuration
|
||||
#*******************************************************************************
|
||||
# AUTH_MAD: The Driver that will be used to authenticate (authn) and
|
||||
# authorize (authz) OpenNebula requests. If defined OpenNebula will use the
|
||||
# built-in auth policies.
|
||||
#
|
||||
# executable: path of the auth driver executable, can be an
|
||||
# absolute path or relative to $ONE_LOCATION/lib/mads (or
|
||||
# /usr/lib/one/mads/ if OpenNebula was installed in /)
|
||||
#
|
||||
# authn : list of authentication modules separated by commas, if not
|
||||
# defined all the modules available will be enabled
|
||||
# authz : list of authentication modules separated by commas
|
||||
#
|
||||
# SESSION_EXPIRATION_TIME: Time in seconds to keep an authenticated token as
|
||||
# valid. During this time, the driver is not used. Use 0 to disable session
|
||||
# caching
|
||||
#
|
||||
# ENABLE_OTHER_PERMISSIONS: Whether or not users can set the permissions for
|
||||
# 'other', so publishing or sharing resources with others. Users in the oneadmin
|
||||
# group will still be able to change these permissions. Values: YES or NO.
|
||||
#
|
||||
# DEFAULT_UMASK: Similar to Unix umask, sets the default resources permissions.
|
||||
# Its format must be 3 octal digits. For example a umask of 137 will set
|
||||
# the new object's permissions to 640 "um- u-- ---"
|
||||
#*******************************************************************************
|
||||
|
||||
AUTH_MAD = [
|
||||
executable = "one_auth_mad",
|
||||
authn = "ssh,x509,ldap,server_cipher,server_x509"
|
||||
]
|
||||
|
||||
SESSION_EXPIRATION_TIME = 900
|
||||
|
||||
#ENABLE_OTHER_PERMISSIONS = "YES"
|
||||
|
||||
DEFAULT_UMASK = 177
|
||||
|
||||
#*******************************************************************************
|
||||
# Restricted Attributes Configuration
|
||||
#*******************************************************************************
|
||||
# The following attributes are restricted to users outside the oneadmin group
|
||||
#*******************************************************************************
|
||||
|
||||
VM_RESTRICTED_ATTR = "CONTEXT/FILES"
|
||||
VM_RESTRICTED_ATTR = "NIC/MAC"
|
||||
VM_RESTRICTED_ATTR = "NIC/VLAN_ID"
|
||||
|
||||
#VM_RESTRICTED_ATTR = "RANK"
|
||||
#VM_RESTRICTED_ATTR = "SCHED_RANK"
|
||||
#VM_RESTRICTED_ATTR = "REQUIREMENTS"
|
||||
#VM_RESTRICTED_ATTR = "SCHED_REQUIREMENTS"
|
||||
|
||||
IMAGE_RESTRICTED_ATTR = "SOURCE"
|
||||
+30
-5
@@ -25,6 +25,7 @@ mkdir -p samples/vmtemplate samples/vmtemplate_pool
|
||||
mkdir -p samples/user samples/user_pool
|
||||
mkdir -p samples/vm samples/vm_pool
|
||||
mkdir -p samples/vnet samples/vnet_pool
|
||||
mkdir -p samples/vnet samples/acct
|
||||
|
||||
|
||||
|
||||
@@ -33,8 +34,8 @@ onegroup create newgroup
|
||||
|
||||
|
||||
# Host
|
||||
onehost create host01 --im im_dummy --vm vmm_dummy --net dummy
|
||||
onehost create host02 --im im_dummy --vm vmm_dummy --net dummy
|
||||
onehost create host01 --im dummy --vm dummy --net dummy
|
||||
onehost create host02 --im dummy --vm dummy --net dummy
|
||||
|
||||
onecluster addhost newcluster host02
|
||||
|
||||
@@ -79,7 +80,25 @@ onetemplate list -x > samples/vmtemplate_pool/2.xml
|
||||
|
||||
|
||||
# VM
|
||||
onetemplate instantiate 0
|
||||
onetemplate instantiate 0 -m 2
|
||||
onetemplate instantiate 1 -m 2
|
||||
|
||||
for i in `onevm list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
|
||||
onevm deploy $i host01
|
||||
done
|
||||
|
||||
sleep 5
|
||||
|
||||
onevm migrate --live 0 0
|
||||
onevm destroy 1
|
||||
onevm poweroff 2
|
||||
|
||||
sleep 5
|
||||
|
||||
onevm suspend 0
|
||||
onevm resume 2
|
||||
|
||||
sleep 5
|
||||
|
||||
for i in `onevm list | tail -n +2 | tr -s ' ' | cut -f2 -d ' '`; do
|
||||
onevm show $i -x > samples/vm/$i.xml
|
||||
@@ -144,8 +163,6 @@ done
|
||||
|
||||
onegroup list -x > samples/group_pool/0.xml
|
||||
|
||||
|
||||
|
||||
for i in cluster datastore group host image vmtemplate user vm vnet
|
||||
do
|
||||
POOL_NAME="$i""_pool"
|
||||
@@ -158,4 +175,12 @@ do
|
||||
xmllint --noout --schema $POOL_NAME.xsd samples/$POOL_NAME/*
|
||||
done
|
||||
|
||||
|
||||
# Accounting
|
||||
oneacct -x > samples/acct/0.xml
|
||||
|
||||
sed -i "s%<HISTORY_RECORDS>%<HISTORY_RECORDS xmlns='http://opennebula.org/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://opennebula.org/XMLSchema ../../acct.xsd'>%" samples/acct/*.xml
|
||||
|
||||
xmllint --noout --schema acct.xsd samples/acct/*
|
||||
|
||||
exit 0
|
||||
@@ -1 +1,4 @@
|
||||
NAME = template1
|
||||
NAME = template1
|
||||
CPU = 0.45
|
||||
VCPU = 1
|
||||
MEMORY = 512
|
||||
@@ -77,6 +77,77 @@
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="DEFAULT_USER_QUOTAS">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="DATASTORE_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="DATASTORE" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:string"/>
|
||||
<xs:element name="IMAGES" type="xs:string"/>
|
||||
<xs:element name="IMAGES_USED" type="xs:string"/>
|
||||
<xs:element name="SIZE" type="xs:string"/>
|
||||
<xs:element name="SIZE_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="NETWORK_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="NETWORK" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:string"/>
|
||||
<xs:element name="LEASES" type="xs:string"/>
|
||||
<xs:element name="LEASES_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="VM_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="VM" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="CPU" type="xs:string"/>
|
||||
<xs:element name="CPU_USED" type="xs:string"/>
|
||||
<xs:element name="MEMORY" type="xs:string"/>
|
||||
<xs:element name="MEMORY_USED" type="xs:string"/>
|
||||
<xs:element name="VMS" type="xs:string"/>
|
||||
<xs:element name="VMS_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="IMAGE_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="IMAGE" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:string"/>
|
||||
<xs:element name="RVMS" type="xs:string"/>
|
||||
<xs:element name="RVMS_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
+150
-1
@@ -5,7 +5,156 @@
|
||||
<xs:element name="USER_POOL">
|
||||
<xs:complexType>
|
||||
<xs:sequence maxOccurs="1" minOccurs="1">
|
||||
<xs:element ref="USER" maxOccurs="unbounded" minOccurs="0"/>
|
||||
<xs:element name="USER" maxOccurs="unbounded" minOccurs="0">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:integer"/>
|
||||
<xs:element name="GID" type="xs:integer"/>
|
||||
<xs:element name="GNAME" type="xs:string"/>
|
||||
<xs:element name="NAME" type="xs:string"/>
|
||||
<xs:element name="PASSWORD" type="xs:string"/>
|
||||
<xs:element name="AUTH_DRIVER" type="xs:string"/>
|
||||
<xs:element name="ENABLED" type="xs:integer"/>
|
||||
<xs:element name="TEMPLATE" type="xs:anyType"/>
|
||||
<xs:element name="DATASTORE_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="DATASTORE" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:string"/>
|
||||
<xs:element name="IMAGES" type="xs:string"/>
|
||||
<xs:element name="IMAGES_USED" type="xs:string"/>
|
||||
<xs:element name="SIZE" type="xs:string"/>
|
||||
<xs:element name="SIZE_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="NETWORK_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="NETWORK" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:string"/>
|
||||
<xs:element name="LEASES" type="xs:string"/>
|
||||
<xs:element name="LEASES_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="VM_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="VM" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="CPU" type="xs:string"/>
|
||||
<xs:element name="CPU_USED" type="xs:string"/>
|
||||
<xs:element name="MEMORY" type="xs:string"/>
|
||||
<xs:element name="MEMORY_USED" type="xs:string"/>
|
||||
<xs:element name="VMS" type="xs:string"/>
|
||||
<xs:element name="VMS_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="IMAGE_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="IMAGE" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:string"/>
|
||||
<xs:element name="RVMS" type="xs:string"/>
|
||||
<xs:element name="RVMS_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="DEFAULT_USER_QUOTAS">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="DATASTORE_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="DATASTORE" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:string"/>
|
||||
<xs:element name="IMAGES" type="xs:string"/>
|
||||
<xs:element name="IMAGES_USED" type="xs:string"/>
|
||||
<xs:element name="SIZE" type="xs:string"/>
|
||||
<xs:element name="SIZE_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="NETWORK_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="NETWORK" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:string"/>
|
||||
<xs:element name="LEASES" type="xs:string"/>
|
||||
<xs:element name="LEASES_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="VM_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="VM" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="CPU" type="xs:string"/>
|
||||
<xs:element name="CPU_USED" type="xs:string"/>
|
||||
<xs:element name="MEMORY" type="xs:string"/>
|
||||
<xs:element name="MEMORY_USED" type="xs:string"/>
|
||||
<xs:element name="VMS" type="xs:string"/>
|
||||
<xs:element name="VMS_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="IMAGE_QUOTA" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="IMAGE" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="xs:string"/>
|
||||
<xs:element name="RVMS" type="xs:string"/>
|
||||
<xs:element name="RVMS_USED" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
+35
-6
@@ -39,6 +39,7 @@
|
||||
DONE = 6
|
||||
FAILED = 7
|
||||
POWEROFF = 8
|
||||
UNDEPLOYED = 9
|
||||
-->
|
||||
<xs:element name="STATE" type="xs:integer"/>
|
||||
|
||||
@@ -73,7 +74,11 @@
|
||||
HOTPLUG_NIC = 25,
|
||||
HOTPLUG_SAVEAS = 26,
|
||||
HOTPLUG_SAVEAS_POWEROFF = 27,
|
||||
HOTPLUG_SAVEAS_SUSPENDED = 28
|
||||
HOTPLUG_SAVEAS_SUSPENDED = 28,
|
||||
SHUTDOWN_UNDEPLOY = 29,
|
||||
EPILOG_UNDEPLOY = 30,
|
||||
PROLOG_UNDEPLOY = 31,
|
||||
BOOT_UNDEPLOY = 32
|
||||
-->
|
||||
<xs:element name="LCM_STATE" type="xs:integer"/>
|
||||
<xs:element name="RESCHED" type="xs:integer"/>
|
||||
@@ -109,6 +114,7 @@
|
||||
<xs:element name="VMMMAD" type="xs:string"/>
|
||||
<xs:element name="VNMMAD" type="xs:string"/>
|
||||
<xs:element name="TMMAD" type="xs:string"/>
|
||||
<xs:element name="DS_LOCATION" type="xs:string"/>
|
||||
<xs:element name="DS_ID" type="xs:integer"/>
|
||||
<xs:element name="PSTIME" type="xs:integer"/>
|
||||
<xs:element name="PETIME" type="xs:integer"/>
|
||||
@@ -118,13 +124,36 @@
|
||||
<xs:element name="EETIME" type="xs:integer"/>
|
||||
|
||||
<!-- REASON values:
|
||||
NONE = 0 Normal termination
|
||||
ERROR = 1 The VM ended in error
|
||||
STOP_RESUME = 2 Stop/resume request
|
||||
USER = 3 Migration request
|
||||
CANCEL = 4 Cancel request
|
||||
NONE = 0 History record is not closed yet
|
||||
ERROR = 1 History record was closed because of an error
|
||||
USER = 2 History record was closed because of a user action
|
||||
-->
|
||||
<xs:element name="REASON" type="xs:integer"/>
|
||||
|
||||
<!-- ACTION values:
|
||||
NONE_ACTION = 0
|
||||
MIGRATE_ACTION = 1
|
||||
LIVE_MIGRATE_ACTION = 2
|
||||
SHUTDOWN_ACTION = 3
|
||||
SHUTDOWN_HARD_ACTION = 4
|
||||
UNDEPLOY_ACTION = 5
|
||||
UNDEPLOY_HARD_ACTION = 6
|
||||
HOLD_ACTION = 7
|
||||
RELEASE_ACTION = 8
|
||||
STOP_ACTION = 9
|
||||
SUSPEND_ACTION = 10
|
||||
RESUME_ACTION = 11
|
||||
BOOT_ACTION = 12
|
||||
DESTROY_ACTION = 13
|
||||
DESTROY_RECREATE_ACTION = 14
|
||||
REBOOT_ACTION = 15
|
||||
REBOOT_HARD_ACTION = 16
|
||||
RESCHED_ACTION = 17
|
||||
UNRESCHED_ACTION = 18
|
||||
POWEROFF_ACTION = 19
|
||||
POWEROFF_HARD_ACTION = 20
|
||||
-->
|
||||
<xs:element name="ACTION" type="xs:integer"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
@@ -50,8 +50,11 @@
|
||||
<xs:element name="LEASE" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="IP" type="xs:string"/>
|
||||
<xs:element name="MAC" type="xs:string"/>
|
||||
<xs:element name="IP" type="xs:string"/>
|
||||
<xs:element name="IP6_LINK" type="xs:string"/>
|
||||
<xs:element name="IP6_SITE" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
||||
<xs:element name="IP6_GLOBAL" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
||||
<xs:element name="USED" type="xs:integer"/>
|
||||
<xs:element name="VID" type="xs:integer"/>
|
||||
</xs:sequence>
|
||||
|
||||
@@ -63,11 +63,41 @@ stop() {
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
start-sched() {
|
||||
echo -n $"Starting OpenNebula scheduler: "
|
||||
daemon --user oneadmin $ONE_BIN start-sched
|
||||
RETVAL=$?
|
||||
|
||||
[ $RETVAL -eq 0 ] && success || failure
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && rm -f $LOCKFILE
|
||||
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
stop-sched() {
|
||||
echo -n $"Stopping OpenNebula scheduler: "
|
||||
daemon --user oneadmin $ONE_BIN stop-sched
|
||||
RETVAL=$?
|
||||
|
||||
[ $RETVAL -eq 0 ] && success || failure
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && rm -f $LOCKFILE
|
||||
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
restart-sched() {
|
||||
stop-sched
|
||||
sleep 1
|
||||
start-sched
|
||||
}
|
||||
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
@@ -79,6 +109,9 @@ stop)
|
||||
restart)
|
||||
restart
|
||||
;;
|
||||
restart-sched)
|
||||
restart-sched
|
||||
;;
|
||||
status)
|
||||
status $prog
|
||||
RETVAL=$?
|
||||
|
||||
@@ -47,6 +47,16 @@ do_stop()
|
||||
su oneadmin -s /bin/sh -c 'one stop'
|
||||
}
|
||||
|
||||
do_start_sched()
|
||||
{
|
||||
su oneadmin -s /bin/sh -c 'one start-sched'
|
||||
}
|
||||
|
||||
do_stop_sched()
|
||||
{
|
||||
su oneadmin -s /bin/sh -c 'one stop-sched'
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
|
||||
@@ -87,6 +97,22 @@ case "$1" in
|
||||
# Failed to stop
|
||||
log_end_msg 1
|
||||
;;
|
||||
restart-sched)
|
||||
log_daemon_msg "Restarting scheduler"
|
||||
do_stop_sched
|
||||
case "$?" in
|
||||
0|1)
|
||||
do_start
|
||||
case "$?" in
|
||||
0) log_end_msg 0 ;;
|
||||
1) log_end_msg 1 ;; # Old process is still running
|
||||
*) log_end_msg 1 ;; # Failed to start
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
# Failed to stop
|
||||
log_end_msg 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
|
||||
@@ -47,6 +47,16 @@ do_stop()
|
||||
su oneadmin -s /bin/sh -c 'one stop'
|
||||
}
|
||||
|
||||
do_start_sched()
|
||||
{
|
||||
su oneadmin -s /bin/sh -c 'one start-sched'
|
||||
}
|
||||
|
||||
do_stop_sched()
|
||||
{
|
||||
su oneadmin -s /bin/sh -c 'one stop-sched'
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
|
||||
@@ -87,6 +97,22 @@ case "$1" in
|
||||
# Failed to stop
|
||||
log_end_msg 1
|
||||
;;
|
||||
restart-sched)
|
||||
log_daemon_msg "Restarting scheduler"
|
||||
do_stop_sched
|
||||
case "$?" in
|
||||
0|1)
|
||||
do_start
|
||||
case "$?" in
|
||||
0) log_end_msg 0 ;;
|
||||
1) log_end_msg 1 ;; # Old process is still running
|
||||
*) log_end_msg 1 ;; # Failed to start
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
# Failed to stop
|
||||
log_end_msg 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
This gem is deprecated, use "opennebula" gem instead.
|
||||
+18
-6
@@ -21,7 +21,7 @@ require 'tmpdir'
|
||||
|
||||
|
||||
DEFAULTS={
|
||||
:version => "3.9.0.beta",
|
||||
:version => "3.9.80.beta",
|
||||
:date => Time.now.strftime("%Y-%m-%d"),
|
||||
:dependencies => []
|
||||
}
|
||||
@@ -30,7 +30,7 @@ TEMPLATE=<<EOT
|
||||
# This file is automatically generated
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
s.name = 'opennebula-$(NAME)'
|
||||
s.name = '$(NAME)'
|
||||
s.version = '$(VERSION)'
|
||||
s.date = '$(DATE)'
|
||||
s.summary = "$(SUMMARY)"
|
||||
@@ -49,7 +49,7 @@ EOT
|
||||
|
||||
GEM_DESCRIPTION={
|
||||
:oca => {
|
||||
:name => 'oca',
|
||||
:name => 'opennebula',
|
||||
:files => [
|
||||
['src/oca/ruby/opennebula.rb', '/lib'],
|
||||
['src/oca/ruby/opennebula/*.rb', '/lib/opennebula'],
|
||||
@@ -66,7 +66,7 @@ GEM_DESCRIPTION={
|
||||
},
|
||||
|
||||
:cli => {
|
||||
:name => 'cli',
|
||||
:name => 'opennebula-cli',
|
||||
:files => [
|
||||
['src/cli/one[a-z]*', '/bin'],
|
||||
['src/cli/*.rb', '/lib'],
|
||||
@@ -74,10 +74,22 @@ GEM_DESCRIPTION={
|
||||
['NOTICE', ''],
|
||||
['LICENSE', '']
|
||||
],
|
||||
:summary => 'OpenNebula Client API',
|
||||
:summary => 'OpenNebula Command Line Interface',
|
||||
:description => 'Commands used to talk to OpenNebula',
|
||||
:dependencies => [
|
||||
['opennebula-oca', "= #{DEFAULTS[:version]}"]
|
||||
['opennebula', "= #{DEFAULTS[:version]}"]
|
||||
]
|
||||
},
|
||||
|
||||
:oca_deprecated => {
|
||||
:name => 'opennebula-oca',
|
||||
:files => [
|
||||
['share/rubygems/deprecated/README', '']
|
||||
],
|
||||
:summary => 'OpenNebula Client API (deprecated)',
|
||||
:description => 'Use opennebula gem instead',
|
||||
:dependencies => [
|
||||
['opennebula', "= #{DEFAULTS[:version]}"]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
if RUBY_VERSION =~ /1.9/
|
||||
if RUBY_VERSION >= "1.9"
|
||||
Encoding.default_external = Encoding::UTF_8
|
||||
Encoding.default_internal = Encoding::UTF_8
|
||||
end
|
||||
|
||||
@@ -103,7 +103,6 @@ upcase() {
|
||||
|
||||
gen_iface_conf() {
|
||||
cat <<EOT
|
||||
auto $DEV
|
||||
iface $DEV inet static
|
||||
address $IP
|
||||
network $NETWORK
|
||||
@@ -117,6 +116,20 @@ EOT
|
||||
echo ""
|
||||
}
|
||||
|
||||
gen_iface6_conf() {
|
||||
cat <<EOT
|
||||
iface $DEV inet6 static
|
||||
address $IPV6
|
||||
netmask 64
|
||||
EOT
|
||||
|
||||
if [ -n "$GATEWAY6" ]; then
|
||||
echo " gateway $GATEWAY6"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
}
|
||||
|
||||
gen_network_configuration()
|
||||
{
|
||||
cat <<EOT
|
||||
@@ -137,7 +150,14 @@ EOT
|
||||
MASK=$(get_mask)
|
||||
GATEWAY=$(get_gateway)
|
||||
|
||||
gen_iface_conf
|
||||
IPV6=$(get_iface_var "IPV6")
|
||||
GATEWAY6=$(get_iface_var "GATEWAY6")
|
||||
CONTEXT_FORCE_IPV4=$(get_iface_var "CONTEXT_FORCE_IPV4")
|
||||
|
||||
echo "auto $DEV"
|
||||
|
||||
[[ -z $IPV6 || -n $CONTEXT_FORCE_IPV4 ]] && gen_iface_conf
|
||||
[[ -n $IPV6 ]] && gen_iface6_conf
|
||||
|
||||
done
|
||||
}
|
||||
|
||||
@@ -103,10 +103,6 @@ upcase() {
|
||||
|
||||
gen_iface_conf() {
|
||||
cat <<EOT
|
||||
DEVICE=$DEV
|
||||
BOOTPROTO=none
|
||||
ONBOOT=yes
|
||||
TYPE=Ethernet
|
||||
NETMASK=$MASK
|
||||
IPADDR=$IP
|
||||
EOT
|
||||
@@ -118,6 +114,19 @@ EOT
|
||||
echo ""
|
||||
}
|
||||
|
||||
gen_iface6_conf() {
|
||||
cat <<EOT
|
||||
IPV6INIT=yes
|
||||
IPV6ADDR=$IPV6
|
||||
EOT
|
||||
|
||||
if [ -n "$GATEWAY6" ]; then
|
||||
echo "IPV6_DEFAULTGW=$GATEWAY6"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
}
|
||||
|
||||
gen_network_configuration()
|
||||
{
|
||||
IFACES=`get_interfaces`
|
||||
@@ -132,7 +141,21 @@ gen_network_configuration()
|
||||
MASK=$(get_mask)
|
||||
GATEWAY=$(get_gateway)
|
||||
|
||||
gen_iface_conf > /etc/sysconfig/network-scripts/ifcfg-${DEV}
|
||||
IPV6=$(get_iface_var "IPV6")
|
||||
GATEWAY6=$(get_iface_var "GATEWAY6")
|
||||
CONTEXT_FORCE_IPV4=$(get_iface_var "CONTEXT_FORCE_IPV4")
|
||||
|
||||
(
|
||||
cat <<EOT
|
||||
DEVICE=$DEV
|
||||
BOOTPROTO=none
|
||||
ONBOOT=yes
|
||||
TYPE=Ethernet
|
||||
EOT
|
||||
[[ -z $IPV6 || -n $CONTEXT_FORCE_IPV4 ]] && gen_iface_conf
|
||||
[[ -n $IPV6 ]] && gen_iface6_conf
|
||||
|
||||
) > /etc/sysconfig/network-scripts/ifcfg-${DEV}
|
||||
|
||||
done
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
restorecon -R -v /root/.ssh
|
||||
@@ -16,7 +16,7 @@
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
VERSION=${VERSION:-3.8.1}
|
||||
VERSION=${VERSION:-3.9.80}
|
||||
MAINTAINER=${MAINTAINER:-C12G Labs <support@c12g.com>}
|
||||
LICENSE=${LICENSE:-Apache 2.0}
|
||||
PACKAGE_NAME=${PACKAGE_NAME:-one-context}
|
||||
|
||||
+53
-22
@@ -74,6 +74,13 @@ setup()
|
||||
# Function that stops the daemons
|
||||
#------------------------------------------------------------------------------
|
||||
stop()
|
||||
{
|
||||
stop_oned
|
||||
|
||||
stop_sched
|
||||
}
|
||||
|
||||
stop_oned()
|
||||
{
|
||||
if [ -f $ONE_PID ]; then
|
||||
PID=$(cat $ONE_PID)
|
||||
@@ -91,7 +98,10 @@ stop()
|
||||
|
||||
rm -f $ONE_PID > /dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
stop_sched()
|
||||
{
|
||||
if [ -f $ONE_SCHEDPID ]; then
|
||||
kill `cat $ONE_SCHEDPID` > /dev/null 2>&1
|
||||
rm -f $ONE_SCHEDPID > /dev/null 2>&1
|
||||
@@ -130,30 +140,10 @@ start()
|
||||
fi
|
||||
|
||||
# Start the one daemon
|
||||
$ONED -f 2>&1 &
|
||||
|
||||
LASTRC=$?
|
||||
LASTPID=$!
|
||||
|
||||
if [ $LASTRC -ne 0 ]; then
|
||||
echo "Error executing $ONED"
|
||||
exit 1
|
||||
else
|
||||
echo $LASTPID > $ONE_PID
|
||||
fi
|
||||
start_oned
|
||||
|
||||
# Start the scheduler
|
||||
$ONE_SCHEDULER&
|
||||
|
||||
LASTRC=$?
|
||||
LASTPID=$!
|
||||
|
||||
if [ $LASTRC -ne 0 ]; then
|
||||
echo "Error executing $ONE_SCHEDULER"
|
||||
exit 1
|
||||
else
|
||||
echo $LASTPID > $ONE_SCHEDPID
|
||||
fi
|
||||
start_sched
|
||||
|
||||
# Wait for the daemons to warm up
|
||||
sleep 2
|
||||
@@ -180,6 +170,36 @@ start()
|
||||
fi
|
||||
}
|
||||
|
||||
start_oned()
|
||||
{
|
||||
$ONED -f 2>&1 &
|
||||
|
||||
LASTRC=$?
|
||||
LASTPID=$!
|
||||
|
||||
if [ $LASTRC -ne 0 ]; then
|
||||
echo "Error executing $ONED"
|
||||
exit 1
|
||||
else
|
||||
echo $LASTPID > $ONE_PID
|
||||
fi
|
||||
}
|
||||
|
||||
start_sched()
|
||||
{
|
||||
$ONE_SCHEDULER&
|
||||
|
||||
LASTRC=$?
|
||||
LASTPID=$!
|
||||
|
||||
if [ $LASTRC -ne 0 ]; then
|
||||
echo "Error executing $ONE_SCHEDULER"
|
||||
exit 1
|
||||
else
|
||||
echo $LASTPID > $ONE_SCHEDPID
|
||||
fi
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@@ -197,6 +217,17 @@ case "$1" in
|
||||
stop
|
||||
echo "oned and scheduler stopped"
|
||||
;;
|
||||
start-sched)
|
||||
start_sched
|
||||
;;
|
||||
stop-sched)
|
||||
stop_sched
|
||||
;;
|
||||
restart-sched)
|
||||
stop_sched
|
||||
sleep 1
|
||||
start_sched
|
||||
;;
|
||||
*)
|
||||
echo "Usage: one [-f] {start|stop}" >&2
|
||||
echo "Options:" >&2
|
||||
|
||||
@@ -43,6 +43,9 @@ server 1:
|
||||
# for Active Directory use this user_field instead
|
||||
#:user_field: 'sAMAccountName'
|
||||
|
||||
# field name for group membership, by default it is 'member'
|
||||
#:group_field: 'member'
|
||||
|
||||
# this example server wont be called as it is not in the :order list
|
||||
server 2:
|
||||
:auth_method: :simple
|
||||
|
||||
@@ -28,7 +28,8 @@ class OpenNebula::LdapAuth
|
||||
:password => nil,
|
||||
:base => nil,
|
||||
:auth_method => :simple,
|
||||
:user_field => 'cn'
|
||||
:user_field => 'cn',
|
||||
:group_field => 'member'
|
||||
}.merge(options)
|
||||
|
||||
ops={}
|
||||
@@ -71,7 +72,8 @@ class OpenNebula::LdapAuth
|
||||
end
|
||||
|
||||
def is_in_group?(user, group)
|
||||
result=@ldap.search(:base => group, :filter => "(member=#{user})")
|
||||
result=@ldap.search(:base => group,
|
||||
:filter => "(#{@options[:group_field]}=#{user})")
|
||||
|
||||
if result && result.first
|
||||
true
|
||||
|
||||
@@ -226,7 +226,7 @@ module CLIHelper
|
||||
|
||||
str
|
||||
}.join(' ')
|
||||
}.join("\n")
|
||||
}.join("\n").gsub(/ *$/, '')
|
||||
rescue Errno::EPIPE
|
||||
end
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ module CommandParser
|
||||
def initialize(args=[], &block)
|
||||
@available_options = Array.new
|
||||
@commands = Hash.new
|
||||
@command_list = Array.new
|
||||
@formats = Hash.new
|
||||
|
||||
@main = nil
|
||||
@@ -288,6 +289,21 @@ module CommandParser
|
||||
end
|
||||
}
|
||||
cmd[:proc] = block
|
||||
@command_list << name.to_sym
|
||||
@commands[name.to_sym] = cmd
|
||||
end
|
||||
|
||||
def deprecated_command(name, new_command)
|
||||
cmd = Hash.new
|
||||
cmd[:desc] = "Deprecated, use #{new_command} instead"
|
||||
cmd[:arity] = 0
|
||||
cmd[:options] = []
|
||||
cmd[:args_format] = [[:string, nil]] * 20
|
||||
cmd[:deprecated] = new_command
|
||||
cmd[:proc] = lambda do
|
||||
print_deprecated(new_command)
|
||||
end
|
||||
|
||||
@commands[name.to_sym] = cmd
|
||||
end
|
||||
|
||||
@@ -418,6 +434,10 @@ module CommandParser
|
||||
exit -1
|
||||
end
|
||||
|
||||
if comm[:deprecated]
|
||||
print_deprecated(comm[:deprecated])
|
||||
end
|
||||
|
||||
extra_options = comm[:options] if comm
|
||||
parse(extra_options)
|
||||
|
||||
@@ -617,7 +637,9 @@ module CommandParser
|
||||
puts "## OPTIONS"
|
||||
|
||||
shown_opts = Array.new
|
||||
@commands.each do |key,value|
|
||||
@command_list.each do |key|
|
||||
value = @commands[key]
|
||||
|
||||
value[:options].flatten.each do |o|
|
||||
if shown_opts.include?(o[:name])
|
||||
next
|
||||
@@ -659,11 +681,12 @@ module CommandParser
|
||||
else
|
||||
puts "## COMMANDS"
|
||||
|
||||
@commands.each{ |key,value|
|
||||
@command_list.each do |key|
|
||||
value = @commands[key]
|
||||
printf cmd_format5, "* #{key} "
|
||||
|
||||
print_command(value)
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -713,6 +736,12 @@ module CommandParser
|
||||
}
|
||||
end
|
||||
|
||||
def print_deprecated(new_command)
|
||||
puts "This command is deprecated, use instead:"
|
||||
puts " $ #{File.basename $0} #{new_command}"
|
||||
exit(-1)
|
||||
end
|
||||
|
||||
def word_wrap(size, text, first_size=nil)
|
||||
output=[]
|
||||
line=""
|
||||
|
||||
@@ -12,6 +12,11 @@
|
||||
:size: 15
|
||||
:left: true
|
||||
|
||||
:ACTION:
|
||||
:desc: VM state change action
|
||||
:size: 16
|
||||
:left: true
|
||||
|
||||
:REASON:
|
||||
:desc: VM state change reason
|
||||
:size: 4
|
||||
|
||||
+22
-5
@@ -130,7 +130,9 @@ EOT
|
||||
{
|
||||
:name => 'memory',
|
||||
:large => '--memory memory',
|
||||
:description => 'Memory ammount given to the VM',
|
||||
:description => 'Memory amount given to the VM. By default the '<<
|
||||
"unit is megabytes. To use gigabytes add a 'g', floats "<<
|
||||
"can be used: 8g=8192, 0.5g=512",
|
||||
:format => String,
|
||||
:proc => lambda do |o,options|
|
||||
m=o.strip.match(/^(\d+(?:\.\d+)?)(m|mb|g|gb)?$/i)
|
||||
@@ -608,6 +610,18 @@ EOT
|
||||
end
|
||||
end
|
||||
|
||||
def OpenNebulaHelper.short_period_to_str(time, print_seconds=true)
|
||||
seconds=time.to_i
|
||||
minutes, seconds=seconds.divmod(60)
|
||||
hours, minutes=minutes.divmod(60)
|
||||
|
||||
if print_seconds
|
||||
"%3dh%02dm%02ds" % [hours, minutes, seconds]
|
||||
else
|
||||
"%3dh%02dm" % [hours, minutes]
|
||||
end
|
||||
end
|
||||
|
||||
BinarySufix = ["K", "M", "G", "T" ]
|
||||
|
||||
def OpenNebulaHelper.unit_to_str(value, options, unit="K")
|
||||
@@ -729,8 +743,8 @@ EOT
|
||||
end
|
||||
end
|
||||
|
||||
if options[:net_context] && options[:network]
|
||||
nets=options[:network].map {|n| parse_user_object(n).last }
|
||||
if options[:net_context] && options[:nic]
|
||||
nets=options[:nic].map {|n| parse_user_object(n).last }
|
||||
|
||||
if nets!=nets.uniq
|
||||
STDERR.puts "Network context generation from command "<<
|
||||
@@ -745,6 +759,9 @@ EOT
|
||||
lines<<"ETH#{index}_MASK = \"$NETWORK[NETWORK_MASK, NETWORK=\\\"#{name}\\\"]\""
|
||||
lines<<"ETH#{index}_GATEWAY = \"$NETWORK[GATEWAY, NETWORK=\\\"#{name}\\\"]\""
|
||||
lines<<"ETH#{index}_DNS = \"$NETWORK[DNS, NETWORK=\\\"#{name}\\\"]\""
|
||||
lines<<"ETH#{index}_IPV6 = \"$NIC[IP6_GLOBAL, NETWORK=\\\"#{name}\\\"]\""
|
||||
lines<<"ETH#{index}_GATEWAY6 = \"$NETWORK[GATEWAY6, NETWORK=\\\"#{name}\\\"]\""
|
||||
lines<<"ETH#{index}_CONTEXT_FORCE_IPV4 = \"$NETWORK[CONTEXT_FORCE_IPV4, NETWORK=\\\"#{name}\\\"]\""
|
||||
end
|
||||
end
|
||||
|
||||
@@ -789,8 +806,8 @@ EOT
|
||||
template<<res.last
|
||||
end
|
||||
|
||||
if options[:network]
|
||||
res=create_disk_net(options[:network], 'NIC', 'NETWORK')
|
||||
if options[:nic]
|
||||
res=create_disk_net(options[:nic], 'NIC', 'NETWORK')
|
||||
return res if res.first!=0
|
||||
|
||||
template<<res.last
|
||||
|
||||
@@ -112,6 +112,10 @@ class AcctHelper < OpenNebulaHelper::OneHelper
|
||||
d["HOSTNAME"]
|
||||
end
|
||||
|
||||
column :"ACTION", "VM state change action", :left, :size=>16 do |d|
|
||||
VirtualMachine.get_history_action d["ACTION"]
|
||||
end
|
||||
|
||||
column :REASON, "VM state change reason", :left, :size=>4 do |d|
|
||||
VirtualMachine.get_reason d["REASON"]
|
||||
end
|
||||
@@ -142,7 +146,7 @@ class AcctHelper < OpenNebulaHelper::OneHelper
|
||||
OpenNebulaHelper.unit_to_str(d["VM"]["NET_TX"].to_i / 1024.0, {})
|
||||
end
|
||||
|
||||
default :VID, :HOSTNAME, :REASON, :START_TIME, :END_TIME, :MEMORY, :CPU, :NET_RX, :NET_TX
|
||||
default :VID, :HOSTNAME, :ACTION, :REASON, :START_TIME, :END_TIME, :MEMORY, :CPU, :NET_RX, :NET_TX
|
||||
end
|
||||
|
||||
def self.print_start_end_time_header(start_time, end_time)
|
||||
|
||||
@@ -247,7 +247,7 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
|
||||
puts str % ["RESCHED", OpenNebulaHelper.boolean_to_str(vm['RESCHED'])]
|
||||
puts str % ["HOST",
|
||||
vm['/VM/HISTORY_RECORDS/HISTORY[last()]/HOSTNAME']] if
|
||||
%w{ACTIVE SUSPENDED}.include? vm.state_str
|
||||
%w{ACTIVE SUSPENDED POWEROFF}.include? vm.state_str
|
||||
puts str % ["START TIME",
|
||||
OpenNebulaHelper.time_to_str(vm['/VM/STIME'])]
|
||||
puts str % ["END TIME",
|
||||
@@ -531,15 +531,19 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
|
||||
|
||||
def format_history(vm)
|
||||
table=CLIHelper::ShowTable.new(nil, self) do
|
||||
column :SEQ, "Sequence number", :size=>4 do |d|
|
||||
column :SEQ, "Sequence number", :size=>3 do |d|
|
||||
d["SEQ"]
|
||||
end
|
||||
|
||||
column :HOST, "Host name of the VM container", :left, :size=>20 do |d|
|
||||
column :HOST, "Host name of the VM container", :left, :size=>15 do |d|
|
||||
d["HOSTNAME"]
|
||||
end
|
||||
|
||||
column :REASON, "VM state change reason", :left, :size=>6 do |d|
|
||||
column :"ACTION", "VM state change action", :left, :size=>16 do |d|
|
||||
VirtualMachine.get_history_action d["ACTION"]
|
||||
end
|
||||
|
||||
column :REASON, "VM state change reason", :left, :size=>4 do |d|
|
||||
VirtualMachine.get_reason d["REASON"]
|
||||
end
|
||||
|
||||
@@ -547,14 +551,14 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
|
||||
OpenNebulaHelper.time_to_str(d['STIME'])
|
||||
end
|
||||
|
||||
column :TIME, "Total time in this state", :size=>15 do |d|
|
||||
column :TIME, "Total time in this state", :size=>11 do |d|
|
||||
stime = d["STIME"].to_i
|
||||
etime = d["ETIME"]=="0" ? Time.now.to_i : d["ETIME"].to_i
|
||||
dtime = etime-stime
|
||||
OpenNebulaHelper.period_to_str(dtime)
|
||||
OpenNebulaHelper.period_to_str(dtime, false)
|
||||
end
|
||||
|
||||
column :PROLOG_TIME, "Prolog time for this state", :size=>15 do |d|
|
||||
column :PROLOG, "Prolog time for this state", :size=>10 do |d|
|
||||
stime = d["PSTIME"].to_i
|
||||
if d["PSTIME"]=="0"
|
||||
etime=0
|
||||
@@ -562,10 +566,10 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
|
||||
etime = d["PETIME"]=="0" ? Time.now.to_i: d["PETIME"].to_i
|
||||
end
|
||||
dtime = etime-stime
|
||||
OpenNebulaHelper.period_to_str(dtime)
|
||||
OpenNebulaHelper.short_period_to_str(dtime)
|
||||
end
|
||||
|
||||
default :SEQ, :HOST, :REASON, :START, :TIME, :PROLOG_TIME
|
||||
default :SEQ, :HOST, :ACTION, :REASON, :START, :TIME, :PROLOG
|
||||
end
|
||||
|
||||
vm_hash=vm.to_hash
|
||||
|
||||
+44
-5
@@ -319,20 +319,47 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
||||
end
|
||||
end
|
||||
|
||||
undeploy_desc = <<-EOT.unindent
|
||||
Shuts down the given VM. The VM is saved in the system Datastore.
|
||||
|
||||
With --hard it unplugs the VM.
|
||||
|
||||
States: RUNNING
|
||||
EOT
|
||||
|
||||
command :undeploy, undeploy_desc, [:range,:vmid_list],
|
||||
:options => [OneVMHelper::SCHEDULE, OneVMHelper::HARD] do
|
||||
|
||||
command_name='undeploy'
|
||||
command_name<<'-hard' if options[:hard]
|
||||
|
||||
if (!options[:schedule].nil?)
|
||||
helper.schedule_actions(args[0], options, command_name)
|
||||
else
|
||||
helper.perform_actions(args[0],options,"shutting down") do |vm|
|
||||
vm.undeploy(options[:hard]==true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
poweroff_desc = <<-EOT.unindent
|
||||
Powers off the given VM. The VM will remain in the poweroff state, and
|
||||
can be powered on with the 'onevm boot' command.
|
||||
can be powered on with the 'onevm resume' command.
|
||||
|
||||
States: RUNNING
|
||||
EOT
|
||||
|
||||
command :poweroff, poweroff_desc, [:range,:vmid_list],
|
||||
:options => [OneVMHelper::SCHEDULE] do
|
||||
:options => [OneVMHelper::SCHEDULE, OneVMHelper::HARD] do
|
||||
|
||||
command_name='poweroff'
|
||||
command_name<<'-hard' if options[:hard]
|
||||
|
||||
if (!options[:schedule].nil?)
|
||||
helper.schedule_actions(args[0], options, @comm_name)
|
||||
else
|
||||
helper.perform_actions(args[0],options,"shutting down") do |vm|
|
||||
vm.poweroff
|
||||
vm.poweroff(options[:hard]==true)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -405,7 +432,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
||||
boot_desc = <<-EOT.unindent
|
||||
Boots the given VM.
|
||||
|
||||
States: UNKNOWN, BOOT, POWEROFF
|
||||
States: UNKNOWN, BOOT
|
||||
EOT
|
||||
|
||||
command :boot, boot_desc, [:range,:vmid_list],
|
||||
@@ -460,7 +487,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
||||
resume_desc = <<-EOT.unindent
|
||||
Resumes the execution of the a saved VM
|
||||
|
||||
States: STOPPED, SUSPENDED
|
||||
States: STOPPED, SUSPENDED, UNDEPLOYED, POWEROFF
|
||||
EOT
|
||||
|
||||
command :resume, resume_desc, [:range,:vmid_list],
|
||||
@@ -746,4 +773,16 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
||||
vm.resize(template, enforce)
|
||||
end
|
||||
end
|
||||
|
||||
# Deprecated commands
|
||||
|
||||
deprecated_command(:attachdisk, 'disk-attach')
|
||||
deprecated_command(:detachdisk, 'disk-detach')
|
||||
deprecated_command(:saveas, 'disk-snapshot')
|
||||
deprecated_command(:livemigrate, 'migrate --live')
|
||||
deprecated_command(:cancel, 'shutdown --hard')
|
||||
deprecated_command(:reset, 'reboot --hard')
|
||||
deprecated_command(:restart, 'boot')
|
||||
deprecated_command(:delete, 'destroy')
|
||||
deprecated_command(:resubmit, 'destroy --recreate')
|
||||
end
|
||||
@@ -72,11 +72,6 @@ class CloudAuth
|
||||
rescue => e
|
||||
raise e.message
|
||||
end
|
||||
|
||||
@user_pool = OpenNebula::UserPool.new(client)
|
||||
|
||||
rc = @user_pool.info
|
||||
raise rc.message if OpenNebula.is_error?(rc)
|
||||
end
|
||||
|
||||
# Generate a new OpenNebula client for the target User, if the username
|
||||
@@ -103,7 +98,10 @@ class CloudAuth
|
||||
#
|
||||
#
|
||||
def auth(env, params={})
|
||||
username = do_auth(env, params)
|
||||
begin
|
||||
username = do_auth(env, params)
|
||||
rescue
|
||||
end
|
||||
|
||||
if username.nil?
|
||||
update_userpool_cache
|
||||
|
||||
@@ -110,7 +110,7 @@ http://*|https://*)
|
||||
;;
|
||||
esac
|
||||
|
||||
exec_and_log "eval $DUMP | $SSH $DST_HOST $SUDO $DD of=$TMP_DST bs=64k" \
|
||||
exec_and_log "eval $DUMP | $SSH $DST_HOST $DD of=$TMP_DST bs=64k" \
|
||||
"Error dumping $SRC to $DST_HOST:$TMP_DST"
|
||||
|
||||
REGISTER_CMD=$(cat <<EOF
|
||||
|
||||
@@ -77,6 +77,10 @@ void DispatchManager::trigger(Actions action, int _vid)
|
||||
aname = "STOP_SUCCESS";
|
||||
break;
|
||||
|
||||
case UNDEPLOY_SUCCESS:
|
||||
aname = "UNDEPLOY_SUCCESS";
|
||||
break;
|
||||
|
||||
case POWEROFF_SUCCESS:
|
||||
aname = "POWEROFF_SUCCESS";
|
||||
break;
|
||||
@@ -130,6 +134,10 @@ void DispatchManager::do_action(const string &action, void * arg)
|
||||
{
|
||||
stop_success_action(vid);
|
||||
}
|
||||
else if (action == "UNDEPLOY_SUCCESS")
|
||||
{
|
||||
undeploy_success_action(vid);
|
||||
}
|
||||
else if (action == "POWEROFF_SUCCESS")
|
||||
{
|
||||
poweroff_success_action(vid);
|
||||
|
||||
@@ -209,8 +209,62 @@ error:
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
int DispatchManager::undeploy(
|
||||
int vid,
|
||||
bool hard)
|
||||
{
|
||||
VirtualMachine * vm;
|
||||
ostringstream oss;
|
||||
|
||||
vm = vmpool->get(vid,true);
|
||||
|
||||
if ( vm == 0 )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
oss << "Undeploying VM " << vid;
|
||||
NebulaLog::log("DiM",Log::DEBUG,oss);
|
||||
|
||||
if (vm->get_state() == VirtualMachine::ACTIVE &&
|
||||
vm->get_lcm_state() == VirtualMachine::RUNNING )
|
||||
{
|
||||
Nebula& nd = Nebula::instance();
|
||||
LifeCycleManager * lcm = nd.get_lcm();
|
||||
|
||||
if (hard)
|
||||
{
|
||||
lcm->trigger(LifeCycleManager::UNDEPLOY_HARD,vid);
|
||||
}
|
||||
else
|
||||
{
|
||||
lcm->trigger(LifeCycleManager::UNDEPLOY,vid);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
goto error;
|
||||
}
|
||||
|
||||
vm->unlock();
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
oss.str("");
|
||||
oss << "Could not undeploy VM " << vid << ", wrong state.";
|
||||
NebulaLog::log("DiM",Log::ERROR,oss);
|
||||
|
||||
vm->unlock();
|
||||
return -2;
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
int DispatchManager::poweroff (
|
||||
int vid)
|
||||
int vid,
|
||||
bool hard)
|
||||
{
|
||||
ostringstream oss;
|
||||
VirtualMachine * vm;
|
||||
@@ -231,7 +285,14 @@ int DispatchManager::poweroff (
|
||||
Nebula& nd = Nebula::instance();
|
||||
LifeCycleManager * lcm = nd.get_lcm();
|
||||
|
||||
lcm->trigger(LifeCycleManager::POWEROFF,vid);
|
||||
if (hard)
|
||||
{
|
||||
lcm->trigger(LifeCycleManager::POWEROFF_HARD,vid);
|
||||
}
|
||||
else
|
||||
{
|
||||
lcm->trigger(LifeCycleManager::POWEROFF,vid);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -497,7 +558,8 @@ int DispatchManager::resume(
|
||||
oss << "Resuming VM " << vid;
|
||||
NebulaLog::log("DiM",Log::DEBUG,oss);
|
||||
|
||||
if (vm->get_state() == VirtualMachine::STOPPED )
|
||||
if (vm->get_state() == VirtualMachine::STOPPED ||
|
||||
vm->get_state() == VirtualMachine::UNDEPLOYED )
|
||||
{
|
||||
vm->set_state(VirtualMachine::PENDING);
|
||||
|
||||
@@ -510,12 +572,19 @@ int DispatchManager::resume(
|
||||
Nebula& nd = Nebula::instance();
|
||||
LifeCycleManager * lcm = nd.get_lcm();
|
||||
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->log("DiM", Log::INFO, "New VM state is ACTIVE.");
|
||||
|
||||
lcm->trigger(LifeCycleManager::RESTORE,vid);
|
||||
}
|
||||
else if (vm->get_state() == VirtualMachine::POWEROFF)
|
||||
{
|
||||
Nebula& nd = Nebula::instance();
|
||||
LifeCycleManager * lcm = nd.get_lcm();
|
||||
|
||||
vm->log("DiM", Log::INFO, "New VM state is ACTIVE.");
|
||||
|
||||
lcm->trigger(LifeCycleManager::RESTART,vid);
|
||||
}
|
||||
else
|
||||
{
|
||||
goto error;
|
||||
@@ -552,14 +621,14 @@ int DispatchManager::restart(int vid)
|
||||
oss << "Restarting VM " << vid;
|
||||
NebulaLog::log("DiM",Log::DEBUG,oss);
|
||||
|
||||
if ((vm->get_state() == VirtualMachine::ACTIVE &&
|
||||
if (vm->get_state() == VirtualMachine::ACTIVE &&
|
||||
(vm->get_lcm_state() == VirtualMachine::UNKNOWN ||
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT ||
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_UNKNOWN ||
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_POWEROFF ||
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_SUSPENDED ||
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_STOPPED))
|
||||
|| vm->get_state() == VirtualMachine::POWEROFF )
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_STOPPED ||
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_UNDEPLOY))
|
||||
{
|
||||
Nebula& nd = Nebula::instance();
|
||||
LifeCycleManager * lcm = nd.get_lcm();
|
||||
@@ -804,6 +873,7 @@ int DispatchManager::finalize(
|
||||
break;
|
||||
|
||||
case VirtualMachine::STOPPED:
|
||||
case VirtualMachine::UNDEPLOYED:
|
||||
tm->trigger(TransferManager::EPILOG_DELETE_STOP,vid);
|
||||
finalize_cleanup(vm);
|
||||
break;
|
||||
@@ -851,7 +921,7 @@ int DispatchManager::resubmit(int vid)
|
||||
{
|
||||
case VirtualMachine::POWEROFF:
|
||||
NebulaLog::log("DiM",Log::ERROR,
|
||||
"Cannot resubmit a powered off VM. Restart it first");
|
||||
"Cannot resubmit a powered off VM. Resume it first");
|
||||
rc = -2;
|
||||
break;
|
||||
|
||||
@@ -878,6 +948,7 @@ int DispatchManager::resubmit(int vid)
|
||||
|
||||
case VirtualMachine::HOLD: // Move the VM to PENDING in any of these
|
||||
case VirtualMachine::STOPPED:
|
||||
case VirtualMachine::UNDEPLOYED:
|
||||
vm->set_state(VirtualMachine::LCM_INIT);
|
||||
vm->set_state(VirtualMachine::PENDING);
|
||||
|
||||
|
||||
@@ -98,6 +98,46 @@ void DispatchManager::stop_success_action(int vid)
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
void DispatchManager::undeploy_success_action(int vid)
|
||||
{
|
||||
VirtualMachine * vm;
|
||||
|
||||
vm = vmpool->get(vid,true);
|
||||
|
||||
if ( vm == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ((vm->get_state() == VirtualMachine::ACTIVE) &&
|
||||
(vm->get_lcm_state() == VirtualMachine::EPILOG_UNDEPLOY ||
|
||||
vm->get_lcm_state() == VirtualMachine::PROLOG_UNDEPLOY))
|
||||
{
|
||||
vm->set_state(VirtualMachine::UNDEPLOYED);
|
||||
|
||||
vm->set_state(VirtualMachine::LCM_INIT);
|
||||
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->log("DiM", Log::INFO, "New VM state is UNDEPLOYED");
|
||||
}
|
||||
else
|
||||
{
|
||||
ostringstream oss;
|
||||
|
||||
oss << "undeploy_success action received but VM " << vid
|
||||
<< " not in ACTIVE state";
|
||||
NebulaLog::log("DiM",Log::ERROR,oss);
|
||||
}
|
||||
|
||||
vm->unlock();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
void DispatchManager::poweroff_success_action(int vid)
|
||||
{
|
||||
VirtualMachine * vm;
|
||||
|
||||
+126
-4
@@ -48,11 +48,17 @@ void LifeCycleManager::deploy_action(int vid)
|
||||
|
||||
if (vm->hasPreviousHistory())
|
||||
{
|
||||
if (vm->get_previous_reason() == History::STOP_RESUME)
|
||||
if (vm->get_previous_action() == History::STOP_ACTION)
|
||||
{
|
||||
vm_state = VirtualMachine::PROLOG_RESUME;
|
||||
tm_action = TransferManager::PROLOG_RESUME;
|
||||
}
|
||||
else if (vm->get_previous_action() == History::UNDEPLOY_ACTION ||
|
||||
vm->get_previous_action() == History::UNDEPLOY_HARD_ACTION)
|
||||
{
|
||||
vm_state = VirtualMachine::PROLOG_UNDEPLOY;
|
||||
tm_action = TransferManager::PROLOG_RESUME;
|
||||
}
|
||||
}
|
||||
|
||||
vm->set_state(vm_state);
|
||||
@@ -115,6 +121,10 @@ void LifeCycleManager::suspend_action(int vid)
|
||||
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->set_action(History::SUSPEND_ACTION);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
vm->log("LCM", Log::INFO, "New VM state is SAVE_SUSPEND");
|
||||
|
||||
//----------------------------------------------------
|
||||
@@ -161,6 +171,10 @@ void LifeCycleManager::stop_action(int vid)
|
||||
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->set_action(History::STOP_ACTION);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
vm->log("LCM", Log::INFO, "New VM state is SAVE_STOP");
|
||||
|
||||
//----------------------------------------------------
|
||||
@@ -210,6 +224,8 @@ void LifeCycleManager::migrate_action(int vid)
|
||||
|
||||
vm->set_stime(time(0));
|
||||
|
||||
vm->set_previous_action(History::MIGRATE_ACTION);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
vm->get_requirements(cpu,mem,disk);
|
||||
@@ -266,6 +282,8 @@ void LifeCycleManager::live_migrate_action(int vid)
|
||||
|
||||
vm->set_stime(time(0));
|
||||
|
||||
vm->set_previous_action(History::LIVE_MIGRATE_ACTION);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
vm->get_requirements(cpu,mem,disk);
|
||||
@@ -318,6 +336,10 @@ void LifeCycleManager::shutdown_action(int vid)
|
||||
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->set_action(History::SHUTDOWN_ACTION);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
vm->log("LCM",Log::INFO,"New VM state is SHUTDOWN");
|
||||
|
||||
//----------------------------------------------------
|
||||
@@ -334,10 +356,86 @@ void LifeCycleManager::shutdown_action(int vid)
|
||||
return;
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
void LifeCycleManager::undeploy_action(int vid, bool hard)
|
||||
{
|
||||
VirtualMachine * vm;
|
||||
|
||||
vm = vmpool->get(vid,true);
|
||||
|
||||
if ( vm == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (vm->get_state() == VirtualMachine::ACTIVE &&
|
||||
vm->get_lcm_state() == VirtualMachine::RUNNING)
|
||||
{
|
||||
Nebula& nd = Nebula::instance();
|
||||
VirtualMachineManager * vmm = nd.get_vmm();
|
||||
|
||||
//----------------------------------------------------
|
||||
// SHUTDOWN_UNDEPLOY STATE
|
||||
//----------------------------------------------------
|
||||
|
||||
vm->set_state(VirtualMachine::SHUTDOWN_UNDEPLOY);
|
||||
|
||||
vm->set_resched(false);
|
||||
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->log("LCM",Log::INFO,"New VM state is SHUTDOWN_UNDEPLOY");
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
if (hard)
|
||||
{
|
||||
vm->set_action(History::UNDEPLOY_HARD_ACTION);
|
||||
|
||||
vmm->trigger(VirtualMachineManager::CANCEL,vid);
|
||||
}
|
||||
else
|
||||
{
|
||||
vm->set_action(History::UNDEPLOY_ACTION);
|
||||
|
||||
vmm->trigger(VirtualMachineManager::SHUTDOWN,vid);
|
||||
}
|
||||
|
||||
vmpool->update_history(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
vm->log("LCM", Log::ERROR, "undeploy_action, VM in a wrong state.");
|
||||
}
|
||||
|
||||
vm->unlock();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
void LifeCycleManager::poweroff_action(int vid)
|
||||
{
|
||||
poweroff_action(vid, false);
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
void LifeCycleManager::poweroff_hard_action(int vid)
|
||||
{
|
||||
poweroff_action(vid, true);
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
void LifeCycleManager::poweroff_action(int vid, bool hard)
|
||||
{
|
||||
VirtualMachine * vm;
|
||||
|
||||
@@ -368,7 +466,20 @@ void LifeCycleManager::poweroff_action(int vid)
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
vmm->trigger(VirtualMachineManager::SHUTDOWN,vid);
|
||||
if (hard)
|
||||
{
|
||||
vm->set_action(History::POWEROFF_HARD_ACTION);
|
||||
|
||||
vmm->trigger(VirtualMachineManager::CANCEL,vid);
|
||||
}
|
||||
else
|
||||
{
|
||||
vm->set_action(History::POWEROFF_ACTION);
|
||||
|
||||
vmm->trigger(VirtualMachineManager::SHUTDOWN,vid);
|
||||
}
|
||||
|
||||
vmpool->update_history(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -466,6 +577,10 @@ void LifeCycleManager::cancel_action(int vid)
|
||||
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->set_action(History::SHUTDOWN_HARD_ACTION);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
vm->log("LCM", Log::INFO, "New state is CANCEL");
|
||||
|
||||
//----------------------------------------------------
|
||||
@@ -502,7 +617,8 @@ void LifeCycleManager::restart_action(int vid)
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_UNKNOWN ||
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_POWEROFF ||
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_SUSPENDED ||
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_STOPPED))
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_STOPPED ||
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_UNDEPLOY))
|
||||
||vm->get_state() == VirtualMachine::POWEROFF)
|
||||
{
|
||||
Nebula& nd = Nebula::instance();
|
||||
@@ -517,7 +633,8 @@ void LifeCycleManager::restart_action(int vid)
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_UNKNOWN ||
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_POWEROFF ||
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_SUSPENDED ||
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_STOPPED))
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_STOPPED ||
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_UNDEPLOY))
|
||||
{
|
||||
vm->log("LCM", Log::INFO, "Sending BOOT command to VM again");
|
||||
}
|
||||
@@ -727,10 +844,12 @@ void LifeCycleManager::clean_up_vm(VirtualMachine * vm, bool dispose, int& imag
|
||||
if (dispose)
|
||||
{
|
||||
vm->set_state(VirtualMachine::CLEANUP_DELETE);
|
||||
vm->set_action(History::DESTROY_ACTION);
|
||||
}
|
||||
else
|
||||
{
|
||||
vm->set_state(VirtualMachine::CLEANUP_RESUBMIT);
|
||||
vm->set_action(History::DESTROY_RECREATE_ACTION);
|
||||
}
|
||||
|
||||
vm->set_resched(false);
|
||||
@@ -750,6 +869,7 @@ void LifeCycleManager::clean_up_vm(VirtualMachine * vm, bool dispose, int& imag
|
||||
{
|
||||
case VirtualMachine::PROLOG:
|
||||
case VirtualMachine::PROLOG_RESUME:
|
||||
case VirtualMachine::PROLOG_UNDEPLOY:
|
||||
vm->set_prolog_etime(the_time);
|
||||
vmpool->update_history(vm);
|
||||
|
||||
@@ -762,6 +882,7 @@ void LifeCycleManager::clean_up_vm(VirtualMachine * vm, bool dispose, int& imag
|
||||
case VirtualMachine::BOOT_POWEROFF:
|
||||
case VirtualMachine::BOOT_SUSPENDED:
|
||||
case VirtualMachine::BOOT_STOPPED:
|
||||
case VirtualMachine::BOOT_UNDEPLOY:
|
||||
case VirtualMachine::RUNNING:
|
||||
case VirtualMachine::UNKNOWN:
|
||||
case VirtualMachine::SHUTDOWN:
|
||||
@@ -859,6 +980,7 @@ void LifeCycleManager::clean_up_vm(VirtualMachine * vm, bool dispose, int& imag
|
||||
break;
|
||||
|
||||
case VirtualMachine::EPILOG_STOP:
|
||||
case VirtualMachine::EPILOG_UNDEPLOY:
|
||||
case VirtualMachine::EPILOG:
|
||||
vm->set_epilog_etime(the_time);
|
||||
vmpool->update_history(vm);
|
||||
|
||||
@@ -232,6 +232,14 @@ void LifeCycleManager::trigger(Actions action, int _vid)
|
||||
aname = "SHUTDOWN";
|
||||
break;
|
||||
|
||||
case UNDEPLOY:
|
||||
aname = "UNDEPLOY";
|
||||
break;
|
||||
|
||||
case UNDEPLOY_HARD:
|
||||
aname = "UNDEPLOY_HARD";
|
||||
break;
|
||||
|
||||
case RESTART:
|
||||
aname = "RESTART";
|
||||
break;
|
||||
@@ -252,6 +260,10 @@ void LifeCycleManager::trigger(Actions action, int _vid)
|
||||
aname = "POWEROFF";
|
||||
break;
|
||||
|
||||
case POWEROFF_HARD:
|
||||
aname = "POWEROFF_HARD";
|
||||
break;
|
||||
|
||||
default:
|
||||
delete vid;
|
||||
return;
|
||||
@@ -441,6 +453,14 @@ void LifeCycleManager::do_action(const string &action, void * arg)
|
||||
{
|
||||
shutdown_action(vid);
|
||||
}
|
||||
else if (action == "UNDEPLOY")
|
||||
{
|
||||
undeploy_action(vid, false);
|
||||
}
|
||||
else if (action == "UNDEPLOY_HARD")
|
||||
{
|
||||
undeploy_action(vid, true);
|
||||
}
|
||||
else if (action == "RESTART")
|
||||
{
|
||||
restart_action(vid);
|
||||
@@ -457,6 +477,10 @@ void LifeCycleManager::do_action(const string &action, void * arg)
|
||||
{
|
||||
poweroff_action(vid);
|
||||
}
|
||||
else if (action == "POWEROFF_HARD")
|
||||
{
|
||||
poweroff_hard_action(vid);
|
||||
}
|
||||
else if (action == ACTION_FINALIZE)
|
||||
{
|
||||
NebulaLog::log("LCM",Log::INFO,"Stopping Life-cycle Manager...");
|
||||
|
||||
+178
-14
@@ -93,7 +93,7 @@ void LifeCycleManager::save_success_action(int vid)
|
||||
|
||||
vm->set_vm_info();
|
||||
|
||||
vm->set_reason(History::STOP_RESUME);
|
||||
vm->set_reason(History::USER);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
@@ -121,7 +121,7 @@ void LifeCycleManager::save_success_action(int vid)
|
||||
|
||||
vm->set_running_etime(the_time);
|
||||
|
||||
vm->set_reason(History::STOP_RESUME);
|
||||
vm->set_reason(History::USER);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
@@ -222,6 +222,10 @@ void LifeCycleManager::save_failure_action(int vid)
|
||||
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->set_action(History::NONE_ACTION);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
vm->log("LCM", Log::INFO, "Fail to save VM state."
|
||||
" Assuming that the VM is still RUNNING (will poll VM).");
|
||||
|
||||
@@ -290,7 +294,8 @@ void LifeCycleManager::deploy_success_action(int vid)
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_POWEROFF ||
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_UNKNOWN ||
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_SUSPENDED||
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_STOPPED )
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_STOPPED ||
|
||||
vm->get_lcm_state() == VirtualMachine::BOOT_UNDEPLOY )
|
||||
{
|
||||
vm->set_state(VirtualMachine::RUNNING);
|
||||
|
||||
@@ -430,7 +435,7 @@ void LifeCycleManager::deploy_failure_action(int vid)
|
||||
|
||||
vm->set_running_etime(the_time);
|
||||
|
||||
vm->set_reason(History::STOP_RESUME);
|
||||
vm->set_reason(History::ERROR);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
@@ -440,6 +445,34 @@ void LifeCycleManager::deploy_failure_action(int vid)
|
||||
|
||||
tm->trigger(TransferManager::EPILOG_STOP,vid);
|
||||
}
|
||||
else if (vm->get_lcm_state() == VirtualMachine::BOOT_UNDEPLOY)
|
||||
{
|
||||
Nebula& nd = Nebula::instance();
|
||||
TransferManager * tm = nd.get_tm();
|
||||
time_t the_time = time(0);
|
||||
|
||||
//----------------------------------------------------
|
||||
// EPILOG_UNDEPLOY STATE FROM BOOT
|
||||
//----------------------------------------------------
|
||||
|
||||
vm->set_state(VirtualMachine::EPILOG_UNDEPLOY);
|
||||
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->set_epilog_stime(the_time);
|
||||
|
||||
vm->set_running_etime(the_time);
|
||||
|
||||
vm->set_reason(History::ERROR);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
vm->log("LCM", Log::INFO, "Fail to boot VM. New VM state is EPILOG_UNDEPLOY");
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
tm->trigger(TransferManager::EPILOG_STOP,vid);
|
||||
}
|
||||
else
|
||||
{
|
||||
vm->log("LCM",Log::ERROR,"deploy_failure_action, VM in a wrong state");
|
||||
@@ -506,7 +539,7 @@ void LifeCycleManager::shutdown_success_action(int vid)
|
||||
|
||||
vm->set_vm_info();
|
||||
|
||||
vm->set_reason(History::STOP_RESUME);
|
||||
vm->set_reason(History::USER);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
@@ -514,6 +547,32 @@ void LifeCycleManager::shutdown_success_action(int vid)
|
||||
|
||||
dm->trigger(DispatchManager::POWEROFF_SUCCESS,vid);
|
||||
}
|
||||
else if (vm->get_lcm_state() == VirtualMachine::SHUTDOWN_UNDEPLOY)
|
||||
{
|
||||
//----------------------------------------------------
|
||||
// EPILOG_UNDEPLOY STATE
|
||||
//----------------------------------------------------
|
||||
|
||||
vm->set_state(VirtualMachine::EPILOG_UNDEPLOY);
|
||||
|
||||
vm->delete_snapshots();
|
||||
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->set_epilog_stime(the_time);
|
||||
|
||||
vm->set_running_etime(the_time);
|
||||
|
||||
vm->set_reason(History::USER);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
vm->log("LCM", Log::INFO, "New VM state is EPILOG_UNDEPLOY");
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
tm->trigger(TransferManager::EPILOG_STOP,vid);
|
||||
}
|
||||
else
|
||||
{
|
||||
vm->log("LCM",Log::ERROR,"shutdown_success_action, VM in a wrong state");
|
||||
@@ -540,7 +599,8 @@ void LifeCycleManager::shutdown_failure_action(int vid)
|
||||
}
|
||||
|
||||
if ( vm->get_lcm_state() == VirtualMachine::SHUTDOWN ||
|
||||
vm->get_lcm_state() == VirtualMachine::SHUTDOWN_POWEROFF )
|
||||
vm->get_lcm_state() == VirtualMachine::SHUTDOWN_POWEROFF ||
|
||||
vm->get_lcm_state() == VirtualMachine::SHUTDOWN_UNDEPLOY )
|
||||
{
|
||||
//----------------------------------------------------
|
||||
// RUNNING STATE FROM SHUTDOWN
|
||||
@@ -550,6 +610,10 @@ void LifeCycleManager::shutdown_failure_action(int vid)
|
||||
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->set_action(History::NONE_ACTION);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
vm->log("LCM", Log::INFO, "Fail to shutdown VM."
|
||||
" Assuming that the VM is still RUNNING (will poll VM).");
|
||||
|
||||
@@ -588,7 +652,8 @@ void LifeCycleManager::prolog_success_action(int vid)
|
||||
|
||||
lcm_state = vm->get_lcm_state();
|
||||
|
||||
if (lcm_state == VirtualMachine::PROLOG)
|
||||
if (lcm_state == VirtualMachine::PROLOG ||
|
||||
lcm_state == VirtualMachine::PROLOG_UNDEPLOY )
|
||||
{
|
||||
action = VirtualMachineManager::DEPLOY;
|
||||
}
|
||||
@@ -613,6 +678,10 @@ void LifeCycleManager::prolog_success_action(int vid)
|
||||
{
|
||||
vm->set_state(VirtualMachine::BOOT_STOPPED);
|
||||
}
|
||||
else if ( lcm_state == VirtualMachine::PROLOG_UNDEPLOY )
|
||||
{
|
||||
vm->set_state(VirtualMachine::BOOT_UNDEPLOY);
|
||||
}
|
||||
else // PROLOG || PROLOG_MIGRATE
|
||||
{
|
||||
vm->set_state(VirtualMachine::BOOT);
|
||||
@@ -684,7 +753,7 @@ void LifeCycleManager::prolog_failure_action(int vid)
|
||||
|
||||
vm->set_vm_info();
|
||||
|
||||
vm->set_reason(History::STOP_RESUME);
|
||||
vm->set_reason(History::ERROR);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
@@ -696,6 +765,39 @@ void LifeCycleManager::prolog_failure_action(int vid)
|
||||
|
||||
dm->trigger(DispatchManager::STOP_SUCCESS,vid);
|
||||
}
|
||||
else if ( state == VirtualMachine::PROLOG_UNDEPLOY )
|
||||
{
|
||||
//----------------------------------------------------
|
||||
// UNDEPLOY STATE FROM PROLOG_UNDEPLOY
|
||||
//----------------------------------------------------
|
||||
|
||||
Nebula& nd = Nebula::instance();
|
||||
DispatchManager * dm = nd.get_dm();
|
||||
|
||||
int cpu,mem,disk;
|
||||
|
||||
vm->set_prolog_etime(the_time);
|
||||
|
||||
vm->set_resched(false);
|
||||
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->set_etime(the_time);
|
||||
|
||||
vm->set_vm_info();
|
||||
|
||||
vm->set_reason(History::ERROR);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
vm->get_requirements(cpu,mem,disk);
|
||||
|
||||
hpool->del_capacity(vm->get_hid(), vm->get_oid(), cpu, mem, disk);
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
dm->trigger(DispatchManager::UNDEPLOY_SUCCESS,vid);
|
||||
}
|
||||
else
|
||||
{
|
||||
vm->log("LCM",Log::ERROR,"prolog_failure_action, VM in a wrong state");
|
||||
@@ -734,6 +836,10 @@ void LifeCycleManager::epilog_success_action(int vid)
|
||||
{
|
||||
action = DispatchManager::STOP_SUCCESS;
|
||||
}
|
||||
else if ( state == VirtualMachine::EPILOG_UNDEPLOY )
|
||||
{
|
||||
action = DispatchManager::UNDEPLOY_SUCCESS;
|
||||
}
|
||||
else if ( state == VirtualMachine::EPILOG )
|
||||
{
|
||||
action = DispatchManager::DONE;
|
||||
@@ -834,6 +940,7 @@ void LifeCycleManager::epilog_failure_action(int vid)
|
||||
dm->trigger(DispatchManager::RESUBMIT, vid);
|
||||
}
|
||||
else if ( vm->get_lcm_state() == VirtualMachine::EPILOG_STOP ||
|
||||
vm->get_lcm_state() == VirtualMachine::EPILOG_UNDEPLOY ||
|
||||
vm->get_lcm_state() == VirtualMachine::EPILOG )
|
||||
{
|
||||
vm->set_epilog_etime(the_time);
|
||||
@@ -857,6 +964,7 @@ void LifeCycleManager::cancel_success_action(int vid)
|
||||
{
|
||||
Nebula& nd = Nebula::instance();
|
||||
TransferManager * tm = nd.get_tm();
|
||||
DispatchManager * dm = nd.get_dm();
|
||||
VirtualMachine * vm;
|
||||
time_t the_time = time(0);
|
||||
|
||||
@@ -879,7 +987,7 @@ void LifeCycleManager::cancel_success_action(int vid)
|
||||
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->set_reason(History::CANCEL);
|
||||
vm->set_reason(History::USER);
|
||||
|
||||
vm->set_epilog_stime(the_time);
|
||||
|
||||
@@ -893,6 +1001,56 @@ void LifeCycleManager::cancel_success_action(int vid)
|
||||
|
||||
tm->trigger(TransferManager::EPILOG,vid);
|
||||
}
|
||||
else if (vm->get_lcm_state() == VirtualMachine::SHUTDOWN_UNDEPLOY)
|
||||
{
|
||||
//----------------------------------------------------
|
||||
// EPILOG_UNDEPLOY STATE
|
||||
//----------------------------------------------------
|
||||
|
||||
vm->set_state(VirtualMachine::EPILOG_UNDEPLOY);
|
||||
|
||||
vm->delete_snapshots();
|
||||
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->set_epilog_stime(the_time);
|
||||
|
||||
vm->set_running_etime(the_time);
|
||||
|
||||
vm->set_reason(History::USER);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
vm->log("LCM", Log::INFO, "New VM state is EPILOG_UNDEPLOY");
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
tm->trigger(TransferManager::EPILOG_STOP,vid);
|
||||
}
|
||||
else if (vm->get_lcm_state() == VirtualMachine::SHUTDOWN_POWEROFF)
|
||||
{
|
||||
//----------------------------------------------------
|
||||
// POWEROFF STATE
|
||||
//----------------------------------------------------
|
||||
|
||||
vm->delete_snapshots();
|
||||
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->set_running_etime(the_time);
|
||||
|
||||
vm->set_etime(the_time);
|
||||
|
||||
vm->set_vm_info();
|
||||
|
||||
vm->set_reason(History::USER);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
//----------------------------------------------------
|
||||
|
||||
dm->trigger(DispatchManager::POWEROFF_SUCCESS,vid);
|
||||
}
|
||||
else
|
||||
{
|
||||
vm->log("LCM",Log::ERROR,"cancel_success_action, VM in a wrong state");
|
||||
@@ -918,16 +1076,22 @@ void LifeCycleManager::cancel_failure_action(int vid)
|
||||
return;
|
||||
}
|
||||
|
||||
if ( vm->get_lcm_state() == VirtualMachine::CANCEL )
|
||||
if ( vm->get_lcm_state() == VirtualMachine::CANCEL ||
|
||||
vm->get_lcm_state() == VirtualMachine::SHUTDOWN_UNDEPLOY ||
|
||||
vm->get_lcm_state() == VirtualMachine::SHUTDOWN_POWEROFF)
|
||||
{
|
||||
//----------------------------------------------------
|
||||
// RUNNING STATE FROM CANCEL
|
||||
//----------------------------------------------------
|
||||
//------------------------------------------------------------------
|
||||
// RUNNING STATE FROM CANCEL, SHUTDOWN_POWEROFF OR SHUTDOWN_UNDEPLOY
|
||||
//------------------------------------------------------------------
|
||||
|
||||
vm->set_state(VirtualMachine::RUNNING);
|
||||
|
||||
vmpool->update(vm);
|
||||
|
||||
vm->set_action(History::NONE_ACTION);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
vm->log("LCM", Log::INFO, "Fail to cancel VM."
|
||||
" Assuming that the VM is still RUNNING (will poll VM).");
|
||||
|
||||
@@ -1014,7 +1178,7 @@ void LifeCycleManager::monitor_suspend_action(int vid)
|
||||
|
||||
vm->set_vm_info();
|
||||
|
||||
vm->set_reason(History::STOP_RESUME);
|
||||
vm->set_reason(History::ERROR);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
|
||||
@@ -144,6 +144,28 @@ function exec_and_log
|
||||
fi
|
||||
}
|
||||
|
||||
# Like exec_and_log but does not exit on failure. Just sets the variable
|
||||
# ERROR to the error message.
|
||||
function exec_and_set_error
|
||||
{
|
||||
message=$2
|
||||
|
||||
EXEC_LOG_ERR=`$1 2>&1 1>/dev/null`
|
||||
EXEC_LOG_RC=$?
|
||||
|
||||
export ERROR=""
|
||||
|
||||
if [ $EXEC_LOG_RC -ne 0 ]; then
|
||||
log_error "Command \"$1\" failed: $EXEC_LOG_ERR"
|
||||
|
||||
if [ -n "$2" ]; then
|
||||
export ERROR="$2"
|
||||
else
|
||||
export ERROR="Error executing $1: $EXEC_LOG_ERR"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Like exec_and_log but the first argument is the number of seconds
|
||||
# before here is timeout and kills the command
|
||||
#
|
||||
|
||||
@@ -58,7 +58,8 @@ public class VirtualMachine extends PoolElement{
|
||||
"SUSPENDED",
|
||||
"DONE",
|
||||
"FAILED",
|
||||
"POWEROFF" };
|
||||
"POWEROFF",
|
||||
"UNDEPLOYED" };
|
||||
|
||||
private static final String[] SHORT_VM_STATES =
|
||||
{
|
||||
@@ -70,7 +71,8 @@ public class VirtualMachine extends PoolElement{
|
||||
"susp",
|
||||
"done",
|
||||
"fail",
|
||||
"poff" };
|
||||
"poff",
|
||||
"unde" };
|
||||
|
||||
private static final String[] LCM_STATE =
|
||||
{
|
||||
@@ -102,7 +104,11 @@ public class VirtualMachine extends PoolElement{
|
||||
"HOTPLUG_NIC",
|
||||
"HOTPLUG_SAVEAS",
|
||||
"HOTPLUG_SAVEAS_POWEROFF",
|
||||
"HOTPLUG_SAVEAS_SUSPENDED" };
|
||||
"HOTPLUG_SAVEAS_SUSPENDED",
|
||||
"SHUTDOWN_UNDEPLOY",
|
||||
"EPILOG_UNDEPLOY",
|
||||
"PROLOG_UNDEPLOY",
|
||||
"BOOT_UNDEPLOY" };
|
||||
|
||||
private static final String[] SHORT_LCM_STATES =
|
||||
{
|
||||
@@ -134,7 +140,11 @@ public class VirtualMachine extends PoolElement{
|
||||
"hotp",
|
||||
"hotp",
|
||||
"hotp",
|
||||
"hotp" };
|
||||
"hotp",
|
||||
"shut",
|
||||
"epil",
|
||||
"prol",
|
||||
"boot" };
|
||||
|
||||
/**
|
||||
* Creates a new VM representation.
|
||||
@@ -501,12 +511,13 @@ public class VirtualMachine extends PoolElement{
|
||||
* <li>{@link VirtualMachine#poweroff()}</li>
|
||||
* <li>{@link VirtualMachine#resched()}</li>
|
||||
* <li>{@link VirtualMachine#unresched()}</li>
|
||||
* <li>{@link VirtualMachine#undeploy(boolean)}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param action The action name to be performed, can be:<br/>
|
||||
* "shutdown", "hold", "release", "stop", "shutdown-hard", "suspend",
|
||||
* "resume", "boot", "destroy", "destroy-recreate", "reboot", "resched",
|
||||
* "unresched", "reboot-hard", "poweroff"
|
||||
* "unresched", "reboot-hard", "poweroff", "undeploy", "undeploy-hard"
|
||||
* @return If an error occurs the error message contains the reason.
|
||||
*/
|
||||
protected OneResponse action(String action)
|
||||
@@ -832,13 +843,39 @@ public class VirtualMachine extends PoolElement{
|
||||
return action(actionSt);
|
||||
}
|
||||
|
||||
/**
|
||||
* Undeploy a running VM, it preserve its resources and disk modifications.
|
||||
* @param hard True to perform a hard (no acpi) shutdown, false for a
|
||||
* graceful shutdown
|
||||
* @return If an error occurs the error message contains the reason.
|
||||
*/
|
||||
public OneResponse undeploy(boolean hard)
|
||||
{
|
||||
String actionSt = hard ? "undeploy-hard" : "undeploy";
|
||||
|
||||
return action(actionSt);
|
||||
}
|
||||
|
||||
/**
|
||||
* Powers off a running VM.
|
||||
* @return If an error occurs the error message contains the reason.
|
||||
*/
|
||||
public OneResponse poweroff()
|
||||
{
|
||||
return action("poweroff");
|
||||
return poweroff(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Powers off a running VM.
|
||||
* @param hard True to perform a hard (no acpi) shutdown, false for a
|
||||
* graceful shutdown
|
||||
* @return If an error occurs the error message contains the reason.
|
||||
*/
|
||||
public OneResponse poweroff(boolean hard)
|
||||
{
|
||||
String actionSt = hard ? "poweroff-hard" : "poweroff";
|
||||
|
||||
return action(actionSt);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -47,14 +47,15 @@ module OpenNebula
|
||||
}
|
||||
|
||||
VM_STATE=%w{INIT PENDING HOLD ACTIVE STOPPED SUSPENDED DONE FAILED
|
||||
POWEROFF}
|
||||
POWEROFF UNDEPLOYED}
|
||||
|
||||
LCM_STATE=%w{LCM_INIT PROLOG BOOT RUNNING MIGRATE SAVE_STOP SAVE_SUSPEND
|
||||
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_NIC HOTPLUG_SAVEAS HOTPLUG_SAVEAS_POWEROFF
|
||||
HOTPLUG_SAVEAS_SUSPENDED}
|
||||
HOTPLUG_SAVEAS_SUSPENDED SHUTDOWN_UNDEPLOY EPILOG_UNDEPLOY
|
||||
PROLOG_UNDEPLOY BOOT_UNDEPLOY}
|
||||
|
||||
SHORT_VM_STATES={
|
||||
"INIT" => "init",
|
||||
@@ -65,7 +66,8 @@ module OpenNebula
|
||||
"SUSPENDED" => "susp",
|
||||
"DONE" => "done",
|
||||
"FAILED" => "fail",
|
||||
"POWEROFF" => "poff"
|
||||
"POWEROFF" => "poff",
|
||||
"UNDEPLOYED"=> "unde"
|
||||
}
|
||||
|
||||
SHORT_LCM_STATES={
|
||||
@@ -96,19 +98,26 @@ module OpenNebula
|
||||
"HOTPLUG_NIC" => "hotp",
|
||||
"HOTPLUG_SAVEAS" => "hotp",
|
||||
"HOTPLUG_SAVEAS_POWEROFF" => "hotp",
|
||||
"HOTPLUG_SAVEAS_SUSPENDED" => "hotp"
|
||||
"HOTPLUG_SAVEAS_SUSPENDED" => "hotp",
|
||||
"SHUTDOWN_UNDEPLOY" => "shut",
|
||||
"EPILOG_UNDEPLOY" => "epil",
|
||||
"PROLOG_UNDEPLOY" => "prol",
|
||||
"BOOT_UNDEPLOY" => "boot"
|
||||
}
|
||||
|
||||
MIGRATE_REASON=%w{NONE ERROR STOP_RESUME USER CANCEL}
|
||||
MIGRATE_REASON=%w{NONE ERROR USER}
|
||||
|
||||
SHORT_MIGRATE_REASON={
|
||||
"NONE" => "none",
|
||||
"ERROR" => "erro",
|
||||
"STOP_RESUME" => "stop",
|
||||
"USER" => "user",
|
||||
"CANCEL" => "canc"
|
||||
"USER" => "user"
|
||||
}
|
||||
|
||||
HISTORY_ACTION=%w{none migrate live-migrate shutdown shutdown-hard
|
||||
undeploy undeploy-hard hold release stop suspend resume boot destroy
|
||||
destroy-recreate reboot reboot-hard resched unresched poweroff
|
||||
poweroff-hard}
|
||||
|
||||
# Creates a VirtualMachine description with just its identifier
|
||||
# this method should be used to create plain VirtualMachine objects.
|
||||
# +id+ the id of the vm
|
||||
@@ -133,6 +142,10 @@ module OpenNebula
|
||||
reason_str
|
||||
end
|
||||
|
||||
def VirtualMachine.get_history_action(action)
|
||||
return HISTORY_ACTION[action.to_i]
|
||||
end
|
||||
|
||||
# Class constructor
|
||||
def initialize(xml, client)
|
||||
super(xml,client)
|
||||
@@ -210,9 +223,14 @@ module OpenNebula
|
||||
action(hard ? 'shutdown-hard' : 'shutdown')
|
||||
end
|
||||
|
||||
# Shuts down an already deployed VM, saving its state in the system DS
|
||||
def undeploy(hard=false)
|
||||
action(hard ? 'undeploy-hard' : 'undeploy')
|
||||
end
|
||||
|
||||
# Powers off a running VM
|
||||
def poweroff
|
||||
action('poweroff')
|
||||
def poweroff(hard=false)
|
||||
action(hard ? 'poweroff-hard' : 'poweroff')
|
||||
end
|
||||
|
||||
# Reboots an already deployed VM
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Copyright 2002-2013, OpenNebula Project (OpenNebula.org), C12G Labs #
|
||||
# #
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
||||
# not use this file except in compliance with the License. You may obtain #
|
||||
# a copy of the License at #
|
||||
# #
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 #
|
||||
# #
|
||||
# Unless required by applicable law or agreed to in writing, software #
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, #
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
||||
# See the License for the specific language governing permissions and #
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
require "rexml/document"
|
||||
include REXML
|
||||
|
||||
module Migrator
|
||||
def db_version
|
||||
"4.0.0"
|
||||
end
|
||||
|
||||
def one_version
|
||||
"OpenNebula 4.0.0"
|
||||
end
|
||||
|
||||
def up
|
||||
|
||||
########################################################################
|
||||
# Feature #1631: Add ACTION to history entries
|
||||
########################################################################
|
||||
|
||||
@db.run "ALTER TABLE vm_pool RENAME TO old_vm_pool;"
|
||||
@db.run "CREATE TABLE vm_pool (oid INTEGER PRIMARY KEY, name VARCHAR(128), body MEDIUMTEXT, uid INTEGER, gid INTEGER, last_poll INTEGER, state INTEGER, lcm_state INTEGER, owner_u INTEGER, group_u INTEGER, other_u INTEGER);"
|
||||
|
||||
@db.fetch("SELECT * FROM old_vm_pool") do |row|
|
||||
doc = Document.new(row[:body])
|
||||
|
||||
doc.root.each_element("HISTORY_RECORDS/HISTORY") do |e|
|
||||
update_history(e)
|
||||
end
|
||||
|
||||
@db[:vm_pool].insert(
|
||||
:oid => row[:oid],
|
||||
:name => row[:name],
|
||||
:body => doc.root.to_s,
|
||||
:uid => row[:uid],
|
||||
:gid => row[:gid],
|
||||
:last_poll => row[:last_poll],
|
||||
:state => row[:state],
|
||||
:lcm_state => row[:lcm_state],
|
||||
:owner_u => row[:owner_u],
|
||||
:group_u => row[:group_u],
|
||||
:other_u => row[:other_u])
|
||||
end
|
||||
|
||||
@db.run "DROP TABLE old_vm_pool;"
|
||||
|
||||
@db.run "ALTER TABLE history RENAME TO old_history;"
|
||||
@db.run "CREATE TABLE history (vid INTEGER, seq INTEGER, body MEDIUMTEXT, stime INTEGER, etime INTEGER,PRIMARY KEY(vid,seq));"
|
||||
|
||||
@db.fetch("SELECT * FROM old_history") do |row|
|
||||
doc = Document.new(row[:body])
|
||||
|
||||
doc.root.each_element("/HISTORY") do |e|
|
||||
update_history(e)
|
||||
end
|
||||
|
||||
@db[:history].insert(
|
||||
:vid => row[:vid],
|
||||
:seq => row[:seq],
|
||||
:body => doc.root.to_s,
|
||||
:stime => row[:stime],
|
||||
:etime => row[:etime])
|
||||
end
|
||||
|
||||
@db.run "DROP TABLE old_history;"
|
||||
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
def update_history(history_elem)
|
||||
history_elem.add_element("ACTION").text = "0" # NONE_ACTION
|
||||
|
||||
# History reason enum has changed from
|
||||
# NONE, ERROR, STOP_RESUME, USER, CANCEL to
|
||||
# NONE, ERROR, USER
|
||||
history_elem.each_element("REASON") do |reason_e|
|
||||
reason = reason_e.text.to_i
|
||||
|
||||
if reason > 1 # STOP_RESUME, USER, CANCEL
|
||||
reason_e.text = "2" # USER
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -125,9 +125,7 @@ var oZones = {
|
||||
case "vm_migrate_reason":
|
||||
state = tr(["NONE",
|
||||
"ERROR",
|
||||
"STOP_RESUME",
|
||||
"USER",
|
||||
"CANCEL"][value]);
|
||||
"USER"][value]);
|
||||
break;
|
||||
default:
|
||||
return value;
|
||||
|
||||
@@ -299,10 +299,10 @@ int RequestManagerVirtualMachine::add_history(VirtualMachine * vm,
|
||||
void VirtualMachineAction::request_execute(xmlrpc_c::paramList const& paramList,
|
||||
RequestAttributes& att)
|
||||
{
|
||||
string action = xmlrpc_c::value_string(paramList.getString(1));
|
||||
int id = xmlrpc_c::value_int(paramList.getInt(2));
|
||||
string action_st = xmlrpc_c::value_string(paramList.getString(1));
|
||||
int id = xmlrpc_c::value_int(paramList.getInt(2));
|
||||
|
||||
int rc = -3;
|
||||
int rc;
|
||||
|
||||
Nebula& nd = Nebula::instance();
|
||||
DispatchManager * dm = nd.get_dm();
|
||||
@@ -310,8 +310,33 @@ void VirtualMachineAction::request_execute(xmlrpc_c::paramList const& paramList,
|
||||
ostringstream oss;
|
||||
|
||||
AuthRequest::Operation op = auth_op;
|
||||
History::VMAction action;
|
||||
|
||||
if (action == "resched" || action == "unresched")
|
||||
// Compatibility with 3.8
|
||||
if (action_st == "cancel")
|
||||
{
|
||||
action_st = "shutdown-hard";
|
||||
}
|
||||
else if (action_st == "restart")
|
||||
{
|
||||
action_st = "boot";
|
||||
}
|
||||
else if (action_st == "finalize")
|
||||
{
|
||||
action_st = "destroy";
|
||||
}
|
||||
else if (action_st == "resubmit")
|
||||
{
|
||||
action_st = "destroy-recreate";
|
||||
}
|
||||
else if (action_st == "reset")
|
||||
{
|
||||
action_st = "reboot-hard";
|
||||
}
|
||||
|
||||
History::action_from_str(action_st, action);
|
||||
|
||||
if (action == History::RESCHED_ACTION || action == History::UNRESCHED_ACTION)
|
||||
{
|
||||
op = AuthRequest::ADMIN;
|
||||
}
|
||||
@@ -321,65 +346,65 @@ void VirtualMachineAction::request_execute(xmlrpc_c::paramList const& paramList,
|
||||
return;
|
||||
}
|
||||
|
||||
if (action == "shutdown")
|
||||
switch (action)
|
||||
{
|
||||
rc = dm->shutdown(id);
|
||||
}
|
||||
else if (action == "hold")
|
||||
{
|
||||
rc = dm->hold(id);
|
||||
}
|
||||
else if (action == "release")
|
||||
{
|
||||
rc = dm->release(id);
|
||||
}
|
||||
else if (action == "stop")
|
||||
{
|
||||
rc = dm->stop(id);
|
||||
}
|
||||
else if (action == "shutdown-hard" || action == "cancel")
|
||||
{
|
||||
rc = dm->cancel(id);
|
||||
}
|
||||
else if (action == "suspend")
|
||||
{
|
||||
rc = dm->suspend(id);
|
||||
}
|
||||
else if (action == "resume")
|
||||
{
|
||||
rc = dm->resume(id);
|
||||
}
|
||||
else if (action == "boot" || action == "restart")
|
||||
{
|
||||
rc = dm->restart(id);
|
||||
}
|
||||
else if (action == "destroy" || action == "finalize")
|
||||
{
|
||||
rc = dm->finalize(id);
|
||||
}
|
||||
else if (action == "destroy-recreate" || action == "resubmit")
|
||||
{
|
||||
rc = dm->resubmit(id);
|
||||
}
|
||||
else if (action == "reboot")
|
||||
{
|
||||
rc = dm->reboot(id);
|
||||
}
|
||||
else if (action == "resched")
|
||||
{
|
||||
rc = dm->resched(id, true);
|
||||
}
|
||||
else if (action == "unresched")
|
||||
{
|
||||
rc = dm->resched(id, false);
|
||||
}
|
||||
else if (action == "reboot-hard" || action == "reset")
|
||||
{
|
||||
rc = dm->reset(id);
|
||||
}
|
||||
else if (action == "poweroff")
|
||||
{
|
||||
rc = dm->poweroff(id);
|
||||
case History::SHUTDOWN_ACTION:
|
||||
rc = dm->shutdown(id);
|
||||
break;
|
||||
case History::HOLD_ACTION:
|
||||
rc = dm->hold(id);
|
||||
break;
|
||||
case History::RELEASE_ACTION:
|
||||
rc = dm->release(id);
|
||||
break;
|
||||
case History::STOP_ACTION:
|
||||
rc = dm->stop(id);
|
||||
break;
|
||||
case History::SHUTDOWN_HARD_ACTION:
|
||||
rc = dm->cancel(id);
|
||||
break;
|
||||
case History::SUSPEND_ACTION:
|
||||
rc = dm->suspend(id);
|
||||
break;
|
||||
case History::RESUME_ACTION:
|
||||
rc = dm->resume(id);
|
||||
break;
|
||||
case History::BOOT_ACTION:
|
||||
rc = dm->restart(id);
|
||||
break;
|
||||
case History::DESTROY_ACTION:
|
||||
rc = dm->finalize(id);
|
||||
break;
|
||||
case History::DESTROY_RECREATE_ACTION:
|
||||
rc = dm->resubmit(id);
|
||||
break;
|
||||
case History::REBOOT_ACTION:
|
||||
rc = dm->reboot(id);
|
||||
break;
|
||||
case History::RESCHED_ACTION:
|
||||
rc = dm->resched(id, true);
|
||||
break;
|
||||
case History::UNRESCHED_ACTION:
|
||||
rc = dm->resched(id, false);
|
||||
break;
|
||||
case History::REBOOT_HARD_ACTION:
|
||||
rc = dm->reset(id);
|
||||
break;
|
||||
case History::POWEROFF_ACTION:
|
||||
rc = dm->poweroff(id, false);
|
||||
break;
|
||||
case History::POWEROFF_HARD_ACTION:
|
||||
rc = dm->poweroff(id, true);
|
||||
break;
|
||||
case History::UNDEPLOY_ACTION:
|
||||
rc = dm->undeploy(id, false);
|
||||
break;
|
||||
case History::UNDEPLOY_HARD_ACTION:
|
||||
rc = dm->undeploy(id, true);
|
||||
break;
|
||||
default:
|
||||
rc = -3;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (rc)
|
||||
@@ -393,14 +418,14 @@ void VirtualMachineAction::request_execute(xmlrpc_c::paramList const& paramList,
|
||||
att);
|
||||
break;
|
||||
case -2:
|
||||
oss << "Wrong state to perform action \"" << action << "\"";
|
||||
oss << "Wrong state to perform action \"" << action_st << "\"";
|
||||
|
||||
failure_response(ACTION,
|
||||
request_error(oss.str(),""),
|
||||
att);
|
||||
break;
|
||||
case -3:
|
||||
oss << "Virtual machine action \"" << action
|
||||
oss << "Virtual machine action \"" << action_st
|
||||
<< "\" is not supported";
|
||||
|
||||
failure_response(ACTION,
|
||||
@@ -1246,6 +1271,7 @@ void VirtualMachineResize::request_execute(xmlrpc_c::paramList const& paramList,
|
||||
case VirtualMachine::PENDING:
|
||||
case VirtualMachine::HOLD:
|
||||
case VirtualMachine::FAILED:
|
||||
case VirtualMachine::UNDEPLOYED:
|
||||
break;
|
||||
|
||||
case VirtualMachine::STOPPED:
|
||||
@@ -1423,6 +1449,7 @@ void VirtualMachineResize::request_execute(xmlrpc_c::paramList const& paramList,
|
||||
case VirtualMachine::HOLD:
|
||||
case VirtualMachine::FAILED:
|
||||
case VirtualMachine::POWEROFF:
|
||||
case VirtualMachine::UNDEPLOYED:
|
||||
ret = vm->resize(ncpu, nmemory, nvcpu, error_str);
|
||||
|
||||
if (ret != 0)
|
||||
|
||||
@@ -295,10 +295,12 @@ int VirtualMachineXML::parse_action_name(string& action_st)
|
||||
one_util::tolower(action_st);
|
||||
|
||||
if ( action_st != "shutdown"
|
||||
&& action_st != "shutdown-hard"
|
||||
&& action_st != "undeploy"
|
||||
&& action_st != "undeploy-hard"
|
||||
&& action_st != "hold"
|
||||
&& action_st != "release"
|
||||
&& action_st != "stop"
|
||||
&& action_st != "shutdown-hard"
|
||||
&& action_st != "suspend"
|
||||
&& action_st != "resume"
|
||||
&& action_st != "boot"
|
||||
@@ -307,6 +309,7 @@ int VirtualMachineXML::parse_action_name(string& action_st)
|
||||
&& action_st != "reboot"
|
||||
&& action_st != "reboot-hard"
|
||||
&& action_st != "poweroff"
|
||||
&& action_st != "poweroff-hard"
|
||||
&& action_st != "snapshot-create")
|
||||
{
|
||||
return -1;
|
||||
|
||||
@@ -24,6 +24,42 @@ require 'opennebula'
|
||||
|
||||
TOKEN_EXPIRE_SECONDS = 4
|
||||
|
||||
VNC_STATES = [
|
||||
#0, #LCM_INIT
|
||||
#1, #PROLOG
|
||||
#2, #BOOT
|
||||
3, #RUNNING
|
||||
4, #MIGRATE
|
||||
#5, #SAVE_STOP
|
||||
#6, #SAVE_SUSPEND
|
||||
#7, #SAVE_MIGRATE
|
||||
#8, #PROLOG_MIGRATE
|
||||
#9, #PROLOG_RESUME
|
||||
#10, #EPILOG_STOP
|
||||
#11, #EPILOG
|
||||
12, #SHUTDOWN
|
||||
13, #CANCEL
|
||||
#14, #FAILURE
|
||||
#15, #CLEANUP_RESUBMIT
|
||||
16, #UNKNOWN
|
||||
17, #HOTPLUG
|
||||
18, #SHUTDOWN_POWEROFF
|
||||
#19, #BOOT_UNKNOWN
|
||||
#20, #BOOT_POWEROFF
|
||||
#21, #BOOT_SUSPENDED
|
||||
#22, #BOOT_STOPPED
|
||||
#23, #CLEANUP_DELETE
|
||||
24, #HOTPLUG_SNAPSHOT
|
||||
25, #HOTPLUG_NIC
|
||||
26, #HOTPLUG_SAVEAS
|
||||
27, #HOTPLUG_SAVEAS_POWEROFF
|
||||
28, #HOTPLUG_SAVEAS_SUSPENDED
|
||||
29 #SHUTDOWN_UNDEPLOY
|
||||
#30, #EPILOG_UNDEPLOY
|
||||
#31, #PROLOG_UNDEPLOY
|
||||
#32 #BOOT_UNDEPLOY
|
||||
]
|
||||
|
||||
class OpenNebulaVNC
|
||||
|
||||
attr_reader :proxy_port
|
||||
@@ -103,6 +139,8 @@ class OpenNebulaVNC
|
||||
return false
|
||||
end
|
||||
|
||||
STDOUT.puts "VNC proxy started"
|
||||
|
||||
true
|
||||
end
|
||||
|
||||
|
||||
@@ -70,9 +70,9 @@ if ARGV[0]
|
||||
when :start
|
||||
vnc.start
|
||||
when :stop
|
||||
vnc.stop(ARGV[1]=='--force')
|
||||
vnc.stop(true)
|
||||
when :restart
|
||||
vnc.stop
|
||||
vnc.stop(true)
|
||||
sleep 1
|
||||
vnc.start
|
||||
when :status
|
||||
|
||||
+2960
-2639
File diff suppressed because it is too large.
Load diff
@@ -47,8 +47,8 @@ module OpenNebulaJSON
|
||||
when "deploy" then self.deploy(action_hash['params'])
|
||||
when "finalize" then self.finalize
|
||||
when "hold" then self.hold
|
||||
when "livemigrate" then self.live_migrate(action_hash['params'])
|
||||
when "migrate" then self.migrate(action_hash['params'])
|
||||
when "livemigrate" then self.migrate(action_hash['params'], true)
|
||||
when "migrate" then self.migrate(action_hash['params'], false)
|
||||
when "resume" then self.resume
|
||||
when "release" then self.release
|
||||
when "stop" then self.stop
|
||||
@@ -61,7 +61,7 @@ module OpenNebulaJSON
|
||||
when "snapshot_delete" then self.snapshot_delete(action_hash['params'])
|
||||
when "shutdown" then self.shutdown
|
||||
when "reboot" then self.reboot
|
||||
when "poweroff" then self.poweroff
|
||||
when "poweroff" then self.poweroff(action_hash['params'])
|
||||
when "resubmit" then self.resubmit
|
||||
when "chown" then self.chown(action_hash['params'])
|
||||
when "chmod" then self.chmod_octet(action_hash['params'])
|
||||
@@ -72,6 +72,7 @@ module OpenNebulaJSON
|
||||
when "detachnic" then self.detachnic(action_hash['params'])
|
||||
when "update" then self.update(action_hash['params'])
|
||||
when "rename" then self.rename(action_hash['params'])
|
||||
when "undeploy" then self.undeploy(action_hash['params'])
|
||||
else
|
||||
error_msg = "#{action_hash['perform']} action not " <<
|
||||
" available for this resource"
|
||||
@@ -87,12 +88,17 @@ module OpenNebulaJSON
|
||||
super(params['host_id'])
|
||||
end
|
||||
|
||||
def live_migrate(params=Hash.new)
|
||||
super(params['host_id'])
|
||||
def undeploy(params=Hash.new)
|
||||
super(params['hard'])
|
||||
end
|
||||
|
||||
def migrate(params=Hash.new)
|
||||
super(params['host_id'])
|
||||
def poweroff(params=Hash.new)
|
||||
super(params['hard'])
|
||||
end
|
||||
|
||||
def migrate(params=Hash.new, live=false, enforce=false)
|
||||
# TODO add enforce parameter
|
||||
super(params['host_id'], live)
|
||||
end
|
||||
|
||||
def save_as(params=Hash.new)
|
||||
|
||||
+191
-125
@@ -6147,12 +6147,11 @@ div.button-bar {
|
||||
/* line 158, ../sass/app.scss */
|
||||
#logo {
|
||||
font-weight: bold;
|
||||
margin: 10%;
|
||||
margin-top: 15%;
|
||||
margin-bottom: 10%;
|
||||
}
|
||||
|
||||
/* line 165, ../sass/app.scss */
|
||||
/* line 164, ../sass/app.scss */
|
||||
#login-info {
|
||||
text-align: center;
|
||||
overflow: visible;
|
||||
@@ -6169,42 +6168,42 @@ div.button-bar {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
/* line 186, ../sass/app.scss */
|
||||
/* line 185, ../sass/app.scss */
|
||||
#links {
|
||||
padding-top: 4px;
|
||||
margin-right: 40px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* line 192, ../sass/app.scss */
|
||||
/* line 191, ../sass/app.scss */
|
||||
#login-info, #login-info a, #links, #links a {
|
||||
color: #555;
|
||||
}
|
||||
|
||||
/* line 196, ../sass/app.scss */
|
||||
/* line 195, ../sass/app.scss */
|
||||
#login-info, #login-info a {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* line 199, ../sass/app.scss */
|
||||
/* line 198, ../sass/app.scss */
|
||||
.sunstone-color {
|
||||
color: #2ba6cb;
|
||||
}
|
||||
|
||||
/* line 203, ../sass/app.scss */
|
||||
/* line 202, ../sass/app.scss */
|
||||
#logo-wrapper {
|
||||
float: right;
|
||||
margin-top: 0px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
/* line 209, ../sass/app.scss */
|
||||
/* line 208, ../sass/app.scss */
|
||||
.menu-nav {
|
||||
height: 70%;
|
||||
overflow: overlay;
|
||||
}
|
||||
|
||||
/* line 214, ../sass/app.scss */
|
||||
/* line 213, ../sass/app.scss */
|
||||
#menu {
|
||||
padding-right: 0;
|
||||
padding-left: 0;
|
||||
@@ -6212,29 +6211,29 @@ div.button-bar {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* line 221, ../sass/app.scss */
|
||||
/* line 220, ../sass/app.scss */
|
||||
#tabs_content {
|
||||
box-shadow: -8px -8px 11px -11px black;
|
||||
z-index: 2 !important;
|
||||
}
|
||||
|
||||
/* line 226, ../sass/app.scss */
|
||||
/* line 225, ../sass/app.scss */
|
||||
#navigation {
|
||||
margin: 8%;
|
||||
margin: 0 8%;
|
||||
box-shadow: 0 0 1px 0px black;
|
||||
}
|
||||
|
||||
/* line 231, ../sass/app.scss */
|
||||
/* line 230, ../sass/app.scss */
|
||||
.tabs.vertical li {
|
||||
border-left: none;
|
||||
}
|
||||
|
||||
/* line 235, ../sass/app.scss */
|
||||
/* line 234, ../sass/app.scss */
|
||||
.tabs.vertical li.active {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
/* line 240, ../sass/app.scss */
|
||||
/* line 239, ../sass/app.scss */
|
||||
#navigation > li:not(.subTab).navigation-active-li > a,
|
||||
#navigation > li:not(.subTab).active > a {
|
||||
background: #f2f2f2;
|
||||
@@ -6242,12 +6241,12 @@ div.button-bar {
|
||||
color: #555;
|
||||
}
|
||||
|
||||
/* line 250, ../sass/app.scss */
|
||||
/* line 249, ../sass/app.scss */
|
||||
#navigation i {
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
/* line 255, ../sass/app.scss */
|
||||
/* line 254, ../sass/app.scss */
|
||||
#navigation li.subTab > a {
|
||||
background: #fdfdfd;
|
||||
color: #555;
|
||||
@@ -6255,33 +6254,43 @@ div.button-bar {
|
||||
padding: 7px 11px 7px 25px;
|
||||
}
|
||||
|
||||
/* line 262, ../sass/app.scss */
|
||||
/* line 261, ../sass/app.scss */
|
||||
#navigation li.subsubTab {
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
/* line 266, ../sass/app.scss */
|
||||
/* line 265, ../sass/app.scss */
|
||||
#navigation li:not(subTab) {
|
||||
border-left: 5px solid #f2f2f2 !important;
|
||||
border-left: 5px solid #f2f2f2;
|
||||
}
|
||||
|
||||
/* line 270, ../sass/app.scss */
|
||||
/* line 269, ../sass/app.scss */
|
||||
#navigation li:not(subTab):hover {
|
||||
border-left: 5px solid #e2e2e2;
|
||||
}
|
||||
|
||||
/* line 273, ../sass/app.scss */
|
||||
#navigation li.subTab:not(.navigation-active-li) {
|
||||
border-left: 5px solid #fdfdfd !important;
|
||||
border-left: 5px solid #fdfdfd;
|
||||
}
|
||||
|
||||
/* line 274, ../sass/app.scss */
|
||||
#navigation li:hover {
|
||||
font-weight: bold;
|
||||
/* line 277, ../sass/app.scss */
|
||||
#navigation li.subTab:not(.navigation-active-li):hover {
|
||||
border-left: 5px solid #e2e2e2;
|
||||
}
|
||||
|
||||
/* line 278, ../sass/app.scss */
|
||||
/* line 281, ../sass/app.scss */
|
||||
#navigation a:hover {
|
||||
background: #e2e2e2 !important;
|
||||
}
|
||||
|
||||
/* line 285, ../sass/app.scss */
|
||||
#navigation .navigation-active-li {
|
||||
border-left: 5px solid #555 !important;
|
||||
}
|
||||
|
||||
/* top menu css */
|
||||
/* line 285, ../sass/app.scss */
|
||||
/* line 293, ../sass/app.scss */
|
||||
#menutop_container {
|
||||
margin: 0px 171px;
|
||||
color: #FFFFFF;
|
||||
@@ -6289,14 +6298,14 @@ div.button-bar {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* line 291, ../sass/app.scss */
|
||||
/* line 299, ../sass/app.scss */
|
||||
#menutop_navbar {
|
||||
float: left;
|
||||
height: 25px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/* line 296, ../sass/app.scss */
|
||||
/* line 304, ../sass/app.scss */
|
||||
#menutop_navbar ul {
|
||||
float: left;
|
||||
height: 25px;
|
||||
@@ -6305,12 +6314,12 @@ div.button-bar {
|
||||
padding-left: 1px;
|
||||
}
|
||||
|
||||
/* line 303, ../sass/app.scss */
|
||||
/* line 311, ../sass/app.scss */
|
||||
#menutop_navbar ul {
|
||||
background-color: #4d4d4d;
|
||||
}
|
||||
|
||||
/* line 306, ../sass/app.scss */
|
||||
/* line 314, ../sass/app.scss */
|
||||
#menutop_navbar ul li {
|
||||
float: left;
|
||||
min-width: 72px;
|
||||
@@ -6327,255 +6336,255 @@ div.button-bar {
|
||||
color: white;
|
||||
}
|
||||
|
||||
/* line 322, ../sass/app.scss */
|
||||
/* line 330, ../sass/app.scss */
|
||||
#menutop_navbar ul li:hover {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
/* end top menu css */
|
||||
/* line 333, ../sass/app.scss */
|
||||
/* line 341, ../sass/app.scss */
|
||||
.ui-layout-pane {
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* line 338, ../sass/app.scss */
|
||||
/* line 346, ../sass/app.scss */
|
||||
.button.small {
|
||||
font-size: 12px;
|
||||
box-shadow: none;
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
/* line 344, ../sass/app.scss */
|
||||
/* line 352, ../sass/app.scss */
|
||||
.button {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/* line 348, ../sass/app.scss */
|
||||
/* line 356, ../sass/app.scss */
|
||||
.button.tiny {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/* line 352, ../sass/app.scss */
|
||||
/* line 360, ../sass/app.scss */
|
||||
.panel {
|
||||
padding: 0px;
|
||||
background: #f2f2f2;
|
||||
}
|
||||
|
||||
/* line 357, ../sass/app.scss */
|
||||
/* line 365, ../sass/app.scss */
|
||||
.tabs.vertical li a {
|
||||
padding: 15px 11px;
|
||||
}
|
||||
|
||||
/* line 361, ../sass/app.scss */
|
||||
/* line 369, ../sass/app.scss */
|
||||
input[type="text"] {
|
||||
height: 28px !important;
|
||||
}
|
||||
|
||||
/* line 365, ../sass/app.scss */
|
||||
/* line 373, ../sass/app.scss */
|
||||
.right {
|
||||
float: right !important;
|
||||
}
|
||||
|
||||
/* line 369, ../sass/app.scss */
|
||||
/* line 377, ../sass/app.scss */
|
||||
.ui-layout-pane {
|
||||
background: #fdfdfd;
|
||||
}
|
||||
|
||||
/* line 376, ../sass/app.scss */
|
||||
/* line 384, ../sass/app.scss */
|
||||
tr.odd:hover td {
|
||||
background-color: #2ba6cb !important;
|
||||
cursor: pointer;
|
||||
color: #FFF !important;
|
||||
}
|
||||
|
||||
/* line 382, ../sass/app.scss */
|
||||
/* line 390, ../sass/app.scss */
|
||||
tr.even:hover td {
|
||||
background-color: #2ba6cb !important;
|
||||
cursor: pointer;
|
||||
color: #FFF !important;
|
||||
}
|
||||
|
||||
/* line 388, ../sass/app.scss */
|
||||
/* line 396, ../sass/app.scss */
|
||||
tr {
|
||||
border-bottom: 1px solid #e6e6e6;
|
||||
}
|
||||
|
||||
/* line 394, ../sass/app.scss */
|
||||
/* line 402, ../sass/app.scss */
|
||||
table thead tr th, table tfoot tr td {
|
||||
padding: 5px 10px 5px;
|
||||
line-height: 16px;
|
||||
}
|
||||
|
||||
/* line 399, ../sass/app.scss */
|
||||
/* line 407, ../sass/app.scss */
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
/* Growl */
|
||||
/* line 405, ../sass/app.scss */
|
||||
/* line 413, ../sass/app.scss */
|
||||
.jGrowl-notification h1 {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
/* line 409, ../sass/app.scss */
|
||||
/* line 417, ../sass/app.scss */
|
||||
.jGrowl-notification, .jGrowl-notify-submit {
|
||||
border: 2px #444444 solid;
|
||||
background-color: #f3f3f3 !important;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
/* line 415, ../sass/app.scss */
|
||||
/* line 423, ../sass/app.scss */
|
||||
.jGrowl-notify-error {
|
||||
border: 2px #660000 solid;
|
||||
background-color: #f39999 !important;
|
||||
color: #660000;
|
||||
}
|
||||
|
||||
/* line 421, ../sass/app.scss */
|
||||
/* line 429, ../sass/app.scss */
|
||||
.jGrowl-notify-error table td.key_error {
|
||||
text-transform: capitalize;
|
||||
width: 100%;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* line 427, ../sass/app.scss */
|
||||
/* line 435, ../sass/app.scss */
|
||||
.jGrowl-notify-error table td.key_error:after {
|
||||
content: ":";
|
||||
}
|
||||
|
||||
/* line 434, ../sass/app.scss */
|
||||
/* line 442, ../sass/app.scss */
|
||||
.markrow {
|
||||
background-color: #cdebf5 !important;
|
||||
}
|
||||
|
||||
/* line 435, ../sass/app.scss */
|
||||
/* line 443, ../sass/app.scss */
|
||||
.markrowselected {
|
||||
background-color: #2ba6cb !important;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
/* line 436, ../sass/app.scss */
|
||||
/* line 444, ../sass/app.scss */
|
||||
.markrowchecked {
|
||||
background-color: #cdebf5;
|
||||
}
|
||||
|
||||
/* line 439, ../sass/app.scss */
|
||||
/* line 447, ../sass/app.scss */
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* line 448, ../sass/app.scss */
|
||||
/* line 456, ../sass/app.scss */
|
||||
#navigation li.topTab span.plusIcon,
|
||||
#navigation li.subTab span.plusIcon {
|
||||
display: none;
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* line 453, ../sass/app.scss */
|
||||
/* line 461, ../sass/app.scss */
|
||||
span.plusIcon {
|
||||
color: #d0d0d0;
|
||||
}
|
||||
|
||||
/* line 457, ../sass/app.scss */
|
||||
/* line 465, ../sass/app.scss */
|
||||
span.plusIcon:hover {
|
||||
color: #555;
|
||||
}
|
||||
|
||||
/* line 464, ../sass/app.scss */
|
||||
/* line 472, ../sass/app.scss */
|
||||
table.extended_table tbody tr td {
|
||||
padding: 3px 10px;
|
||||
}
|
||||
|
||||
/* line 471, ../sass/app.scss */
|
||||
/* line 479, ../sass/app.scss */
|
||||
.reveal-modal {
|
||||
top: 50px;
|
||||
}
|
||||
|
||||
/* line 476, ../sass/app.scss */
|
||||
/* line 484, ../sass/app.scss */
|
||||
.ui-layout-resizer-open-hover,
|
||||
.ui-layout-resizer-dragging {
|
||||
background: #EEE;
|
||||
}
|
||||
|
||||
/* line 481, ../sass/app.scss */
|
||||
/* line 489, ../sass/app.scss */
|
||||
.reveal-modal .panel {
|
||||
margin-left: -30px;
|
||||
margin-right: -30px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
/* line 487, ../sass/app.scss */
|
||||
/* line 495, ../sass/app.scss */
|
||||
.reveal-modal.xlarge {
|
||||
padding-top: 0px;
|
||||
width: 80%;
|
||||
margin-left: -40%;
|
||||
}
|
||||
|
||||
/* line 493, ../sass/app.scss */
|
||||
/* line 501, ../sass/app.scss */
|
||||
.reveal-modal {
|
||||
padding-top: 0px;
|
||||
}
|
||||
|
||||
/* line 497, ../sass/app.scss */
|
||||
/* line 505, ../sass/app.scss */
|
||||
.reveal-modal h3 {
|
||||
margin-left: 30px;
|
||||
margin-bottom: 7px !important;
|
||||
}
|
||||
|
||||
/* line 502, ../sass/app.scss */
|
||||
/* line 510, ../sass/app.scss */
|
||||
.reveal-modal .close-reveal-modal:not(.button) {
|
||||
top: 13px;
|
||||
}
|
||||
|
||||
/* line 506, ../sass/app.scss */
|
||||
/* line 514, ../sass/app.scss */
|
||||
.reveal-modal .close-reveal-modal:not(.button):hover {
|
||||
color: #222;
|
||||
}
|
||||
|
||||
/* line 510, ../sass/app.scss */
|
||||
/* line 518, ../sass/app.scss */
|
||||
fieldset {
|
||||
margin: 0px 10px;
|
||||
}
|
||||
|
||||
/* line 516, ../sass/app.scss */
|
||||
/* line 524, ../sass/app.scss */
|
||||
.graph_table table {
|
||||
border: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
/* line 521, ../sass/app.scss */
|
||||
/* line 529, ../sass/app.scss */
|
||||
.graph_table table tr {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
/* line 526, ../sass/app.scss */
|
||||
/* line 534, ../sass/app.scss */
|
||||
.ui-layout-pane {
|
||||
padding: 0px;
|
||||
overflow: overlay;
|
||||
}
|
||||
|
||||
/* line 531, ../sass/app.scss */
|
||||
/* line 539, ../sass/app.scss */
|
||||
.reveal-modal .columns {
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
/* line 535, ../sass/app.scss */
|
||||
/* line 543, ../sass/app.scss */
|
||||
select {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
/* line 540, ../sass/app.scss */
|
||||
/* line 548, ../sass/app.scss */
|
||||
form.creation {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
/* line 544, ../sass/app.scss */
|
||||
/* line 552, ../sass/app.scss */
|
||||
#dialog input {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
/* line 549, ../sass/app.scss */
|
||||
/* line 557, ../sass/app.scss */
|
||||
.progress-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
@@ -6583,7 +6592,7 @@ form.creation {
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
/* line 556, ../sass/app.scss */
|
||||
/* line 564, ../sass/app.scss */
|
||||
.progress {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
@@ -6591,7 +6600,7 @@ form.creation {
|
||||
background: #FFF;
|
||||
}
|
||||
|
||||
/* line 563, ../sass/app.scss */
|
||||
/* line 571, ../sass/app.scss */
|
||||
.progress-text {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
@@ -6599,53 +6608,53 @@ form.creation {
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
/* line 570, ../sass/app.scss */
|
||||
/* line 578, ../sass/app.scss */
|
||||
.meter {
|
||||
background: #cdebf5 !important;
|
||||
}
|
||||
|
||||
/* line 574, ../sass/app.scss */
|
||||
/* line 582, ../sass/app.scss */
|
||||
.dashboard .subheader {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* line 578, ../sass/app.scss */
|
||||
/* line 586, ../sass/app.scss */
|
||||
.dashboard h2.subheader {
|
||||
margin-bottom: 0;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
/* line 583, ../sass/app.scss */
|
||||
/* line 591, ../sass/app.scss */
|
||||
.dashboard h6.subheader {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
/* line 587, ../sass/app.scss */
|
||||
/* line 595, ../sass/app.scss */
|
||||
.dashboard h3.subheader {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
/* line 591, ../sass/app.scss */
|
||||
/* line 599, ../sass/app.scss */
|
||||
ul.button-group {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* line 595, ../sass/app.scss */
|
||||
/* line 603, ../sass/app.scss */
|
||||
.value_td {
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
/* line 599, ../sass/app.scss */
|
||||
/* line 607, ../sass/app.scss */
|
||||
small {
|
||||
color: #b6b6b6 !important;
|
||||
}
|
||||
|
||||
/* line 603, ../sass/app.scss */
|
||||
/* line 611, ../sass/app.scss */
|
||||
.header-dashboard {
|
||||
margin-top: -5px;
|
||||
}
|
||||
|
||||
/* line 607, ../sass/app.scss */
|
||||
/* line 615, ../sass/app.scss */
|
||||
.span-dashboard {
|
||||
background: #fcfcfc;
|
||||
color: #6f6f6f;
|
||||
@@ -6653,42 +6662,43 @@ small {
|
||||
box-shadow: 0 0 2px 0px #6f6f6f;
|
||||
}
|
||||
|
||||
/* line 616, ../sass/app.scss */
|
||||
/* line 624, ../sass/app.scss */
|
||||
.button.dropdown.small::after {
|
||||
border-color: #2f2f2f transparent transparent transparent;
|
||||
border-color: #9f9f9f transparent transparent transparent;
|
||||
border-width: 4px;
|
||||
}
|
||||
|
||||
/* line 620, ../sass/app.scss */
|
||||
/* line 629, ../sass/app.scss */
|
||||
.footer-opennebula {
|
||||
font-size: 10px;
|
||||
color: #b6b6b6 !important;
|
||||
}
|
||||
|
||||
/* line 625, ../sass/app.scss */
|
||||
/* line 634, ../sass/app.scss */
|
||||
a.footer.button {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
/* line 630, ../sass/app.scss */
|
||||
/* line 639, ../sass/app.scss */
|
||||
.user-login {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* line 634, ../sass/app.scss */
|
||||
/* line 643, ../sass/app.scss */
|
||||
.user-login i.header-icon {
|
||||
color: #6f6f6f;
|
||||
font-weight: 300;
|
||||
font-size: 23px;
|
||||
}
|
||||
|
||||
/* line 640, ../sass/app.scss */
|
||||
/* line 649, ../sass/app.scss */
|
||||
.user-login .button {
|
||||
color: #6f6f6f;
|
||||
font-size: 60%;
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
/* line 646, ../sass/app.scss */
|
||||
/* line 655, ../sass/app.scss */
|
||||
.user-login .button.secondary {
|
||||
background: #f2f2f2;
|
||||
border: 0px;
|
||||
@@ -6696,88 +6706,88 @@ a.footer.button {
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
/* line 654, ../sass/app.scss */
|
||||
/* line 663, ../sass/app.scss */
|
||||
.user-login .button.secondary:hover, .user-login .button.secondary:focus {
|
||||
background-color: #d0d0d0;
|
||||
color: #6f6f6f;
|
||||
}
|
||||
|
||||
/* line 659, ../sass/app.scss */
|
||||
/* line 668, ../sass/app.scss */
|
||||
.user-login .button.dropdown.tiny::after {
|
||||
border: solid 5px;
|
||||
border-color: #b6b6b6 transparent transparent transparent;
|
||||
right: 7px;
|
||||
}
|
||||
|
||||
/* line 665, ../sass/app.scss */
|
||||
/* line 674, ../sass/app.scss */
|
||||
.header-resource {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* line 669, ../sass/app.scss */
|
||||
/* line 678, ../sass/app.scss */
|
||||
.header-resource {
|
||||
float: left;
|
||||
}
|
||||
|
||||
/* line 673, ../sass/app.scss */
|
||||
/* line 682, ../sass/app.scss */
|
||||
.header {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* line 677, ../sass/app.scss */
|
||||
/* line 686, ../sass/app.scss */
|
||||
.button.dropdown.tiny ul.no-hover.show-dropdown {
|
||||
top: 34px !important;
|
||||
}
|
||||
|
||||
/* line 681, ../sass/app.scss */
|
||||
/* line 690, ../sass/app.scss */
|
||||
.graph_legend {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* line 685, ../sass/app.scss */
|
||||
/* line 694, ../sass/app.scss */
|
||||
.graph_legend table {
|
||||
background: inherit;
|
||||
border: 0px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* line 691, ../sass/app.scss */
|
||||
/* line 700, ../sass/app.scss */
|
||||
.graph_legend h3 {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
/* line 695, ../sass/app.scss */
|
||||
/* line 704, ../sass/app.scss */
|
||||
.graph_legend .subheader {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
/* line 699, ../sass/app.scss */
|
||||
/* line 708, ../sass/app.scss */
|
||||
.dashboard hr {
|
||||
margin: 0;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
/* line 704, ../sass/app.scss */
|
||||
/* line 713, ../sass/app.scss */
|
||||
.graph {
|
||||
margin-bottom: 15px !important;
|
||||
}
|
||||
|
||||
/* line 708, ../sass/app.scss */
|
||||
/* line 717, ../sass/app.scss */
|
||||
.dashboard-panel {
|
||||
height: 450px;
|
||||
}
|
||||
|
||||
/* line 712, ../sass/app.scss */
|
||||
/* line 721, ../sass/app.scss */
|
||||
.vm_log_error {
|
||||
color: #ff8d81;
|
||||
}
|
||||
|
||||
/* line 716, ../sass/app.scss */
|
||||
/* line 725, ../sass/app.scss */
|
||||
.noUiSlider {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
/* line 720, ../sass/app.scss */
|
||||
/* line 729, ../sass/app.scss */
|
||||
.log-tab {
|
||||
background: #6f6f6f;
|
||||
color: #f2f2f2;
|
||||
@@ -6785,20 +6795,40 @@ a.footer.button {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
/* line 727, ../sass/app.scss */
|
||||
/* line 736, ../sass/app.scss */
|
||||
.reveal-modal ul.tabs-content {
|
||||
margin: 0 0 0px;
|
||||
}
|
||||
|
||||
/* line 731, ../sass/app.scss */
|
||||
/* line 740, ../sass/app.scss */
|
||||
.reveal-body {
|
||||
max-height: 360px;
|
||||
overflow-y: auto;
|
||||
height: 80%;
|
||||
overflow-y: overlay;
|
||||
overflow-x: hidden;
|
||||
padding: 5px;
|
||||
padding: 5px 20px;
|
||||
}
|
||||
|
||||
/* line 741, ../sass/app.scss */
|
||||
/* line 747, ../sass/app.scss */
|
||||
.reveal-footer {
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
/* line 753, ../sass/app.scss */
|
||||
.max-height {
|
||||
max-height: 85%;
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* line 759, ../sass/app.scss */
|
||||
.ui-layout-content {
|
||||
overflow-y: overlay;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
/* line 766, ../sass/app.scss */
|
||||
div.time-picker {
|
||||
position: absolute;
|
||||
height: 191px;
|
||||
@@ -6811,20 +6841,20 @@ div.time-picker {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* line 751, ../sass/app.scss */
|
||||
/* line 776, ../sass/app.scss */
|
||||
div.time-picker-12hours {
|
||||
width: 6em;
|
||||
/* needed for IE */
|
||||
}
|
||||
|
||||
/* line 755, ../sass/app.scss */
|
||||
/* line 780, ../sass/app.scss */
|
||||
div.time-picker ul {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* line 760, ../sass/app.scss */
|
||||
/* line 785, ../sass/app.scss */
|
||||
div.time-picker li {
|
||||
cursor: pointer;
|
||||
height: 20px;
|
||||
@@ -6832,25 +6862,61 @@ div.time-picker li {
|
||||
padding: 4px 3px;
|
||||
}
|
||||
|
||||
/* line 766, ../sass/app.scss */
|
||||
/* line 791, ../sass/app.scss */
|
||||
div.time-picker li.selected {
|
||||
background: #0063CE;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* line 772, ../sass/app.scss */
|
||||
/* line 797, ../sass/app.scss */
|
||||
.timepicker {
|
||||
float: left;
|
||||
width: 50px !important;
|
||||
}
|
||||
|
||||
/* line 777, ../sass/app.scss */
|
||||
/* line 802, ../sass/app.scss */
|
||||
.jdpicker {
|
||||
float: left;
|
||||
width: 90px !important;
|
||||
}
|
||||
|
||||
/* line 782, ../sass/app.scss */
|
||||
/* line 807, ../sass/app.scss */
|
||||
.columns {
|
||||
line-height: 2;
|
||||
}
|
||||
|
||||
/* line 811, ../sass/app.scss */
|
||||
.transparent_table, .transparent_table tr {
|
||||
background: none !important;
|
||||
border: 0px !important;
|
||||
}
|
||||
|
||||
/* line 816, ../sass/app.scss */
|
||||
form {
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
/* line 820, ../sass/app.scss */
|
||||
#template_create_tabs {
|
||||
width: 180px;
|
||||
}
|
||||
|
||||
/* line 825, ../sass/app.scss */
|
||||
.dataTables_scrollHead {
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
/* line 829, ../sass/app.scss */
|
||||
.dataTables_scrollBody {
|
||||
margin-top: -3px;
|
||||
}
|
||||
|
||||
/* line 833, ../sass/app.scss */
|
||||
.show_hide {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* line 837, ../sass/app.scss */
|
||||
.show_hide:hover > h4 > small {
|
||||
color: #6f6f6f !important;
|
||||
}
|
||||
@@ -150,16 +150,6 @@ div#login input#login_btn:hover {
|
||||
background: url(../images/login_over.png) no-repeat center ;
|
||||
}
|
||||
|
||||
.error_message {
|
||||
display: none;
|
||||
position: relative;
|
||||
width:400px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
top: 80px;
|
||||
font-size:1.0em;
|
||||
padding: 2px 15px;
|
||||
}
|
||||
|
||||
#login_spinner {
|
||||
left: 22px;
|
||||
@@ -187,3 +177,45 @@ div#login input#login_btn:hover {
|
||||
margin-top: 35px;
|
||||
margin-left:0px;
|
||||
}
|
||||
|
||||
div.alert-box {
|
||||
display: block;
|
||||
padding: 6px 7px 7px;
|
||||
font-size: 14px;
|
||||
color: white;
|
||||
background-color: #2ba6cb;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
margin-bottom: 12px;
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
-ms-border-radius: 3px;
|
||||
-o-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
text-shadow: 0 -1px rgba(0, 0, 0, 0.3);
|
||||
position: relative;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
div.alert-box.alert {
|
||||
background-color: #c0392b;
|
||||
color: #fff;
|
||||
text-shadow: 0 -1px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
div.alert-box a.close {
|
||||
color: #333;
|
||||
position: absolute;
|
||||
right: 4px;
|
||||
top: -1px;
|
||||
font-size: 17px;
|
||||
opacity: 0.2;
|
||||
padding: 4px;
|
||||
}
|
||||
/* line 34, ../../../../../../../.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/zurb-foundation-3.2.5/scss/foundation/components/modules/_ui.scss */
|
||||
div.alert-box a.close:hover, div.alert-box a.close:focus {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
#error_box {
|
||||
margin-top:70px;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
@@ -142,7 +142,7 @@ $(document).ready(function () {
|
||||
applyDefaultStyles: false
|
||||
, center__paneSelector: ".outer-center"
|
||||
, west__paneSelector: ".outer-west"
|
||||
, west__size: 245
|
||||
, west__size: 260
|
||||
, north__size: 26
|
||||
, south__size: 26
|
||||
, spacing_open: 0 // ALL panes
|
||||
@@ -159,7 +159,7 @@ $(document).ready(function () {
|
||||
, west__resizable: false
|
||||
});
|
||||
|
||||
var factor = 0.6;
|
||||
var factor = 0.5;
|
||||
var dialog_height = Math.floor($(".outer-center").height()*factor);
|
||||
|
||||
innerLayout = $('div.outer-center').layout({
|
||||
|
||||
@@ -24,16 +24,16 @@ function auth_error(req, error){
|
||||
|
||||
switch (status){
|
||||
case 401:
|
||||
$("#error_box").text("Invalid username or password");
|
||||
$("#error_message").text("Invalid username or password");
|
||||
break;
|
||||
case 500:
|
||||
$("#error_box").text("OpenNebula is not running or there was a server exception. Please check the server logs.");
|
||||
$("#error_message").text("OpenNebula is not running or there was a server exception. Please check the server logs.");
|
||||
break;
|
||||
case 0:
|
||||
$("#error_box").text("No answer from server. Is it running?");
|
||||
$("#error_message").text("No answer from server. Is it running?");
|
||||
break;
|
||||
default:
|
||||
$("#error_box").text("Unexpected error. Status "+status+". Check the server logs.");
|
||||
$("#error_message").text("Unexpected error. Status "+status+". Check the server logs.");
|
||||
};
|
||||
$("#error_box").fadeIn("slow");
|
||||
$("#login_spinner").hide();
|
||||
|
||||
@@ -83,7 +83,8 @@ var OpenNebula = {
|
||||
"SUSPENDED",
|
||||
"DONE",
|
||||
"FAILED",
|
||||
"POWEROFF"][value]);
|
||||
"POWEROFF",
|
||||
"UNDEPLOYED"][value]);
|
||||
break;
|
||||
case "VM_LCM":
|
||||
case "vm_lcm":
|
||||
@@ -92,30 +93,34 @@ var OpenNebula = {
|
||||
"BOOT",
|
||||
"RUNNING",
|
||||
"MIGRATE",
|
||||
"SAVE_STOP",
|
||||
"SAVE_SUSPEND",
|
||||
"SAVE_MIGRATE",
|
||||
"PROLOG_MIGRATE",
|
||||
"PROLOG_RESUME",
|
||||
"EPILOG_STOP",
|
||||
"SAVE",
|
||||
"SAVE",
|
||||
"SAVE",
|
||||
"MIGRATE",
|
||||
"PROLOG",
|
||||
"EPILOG",
|
||||
"EPILOG",
|
||||
"SHUTDOWN",
|
||||
"CANCEL",
|
||||
"SHUTDOWN",
|
||||
"FAILURE",
|
||||
"CLEANUP_RESUBMIT",
|
||||
"CLEANUP",
|
||||
"UNKNOWN",
|
||||
"HOTPLUG",
|
||||
"SHUTDOWN_POWEROFF",
|
||||
"BOOT_UNKNOWN",
|
||||
"BOOT_POWEROFF",
|
||||
"BOOT_SUSPENDED",
|
||||
"BOOT_STOPPED",
|
||||
"CLEANUP_DELETE",
|
||||
"HOTPLUG_SNAPSHOT",
|
||||
"HOTPLUG_NIC",
|
||||
"HOTPLUG_SAVEAS",
|
||||
"HOTPLUG_SAVEAS_POWEROFF",
|
||||
"HOTPLUG_SAVEAS_SUSPENDED"][value]);
|
||||
"SHUTDOWN",
|
||||
"BOOT",
|
||||
"BOOT",
|
||||
"BOOT",
|
||||
"BOOT",
|
||||
"CLEANUP",
|
||||
"SNAPSHOT",
|
||||
"HOTPLUG",
|
||||
"HOTPLUG",
|
||||
"HOTPLUG",
|
||||
"HOTPLUG",
|
||||
"SHUTDOWN",
|
||||
"EPILOG",
|
||||
"PROLOG",
|
||||
"BOOT"][value]);
|
||||
break;
|
||||
case "IMAGE":
|
||||
case "image":
|
||||
@@ -133,9 +138,31 @@ var OpenNebula = {
|
||||
case "vm_migrate_reason":
|
||||
state = tr(["NONE",
|
||||
"ERROR",
|
||||
"STOP_RESUME",
|
||||
"USER",
|
||||
"CANCEL"][value]);
|
||||
"USER"][value]);
|
||||
break;
|
||||
case "VM_MIGRATE_ACTION":
|
||||
case "vm_migrate_action":
|
||||
state = tr(["none",
|
||||
"migrate",
|
||||
"live-migrate",
|
||||
"shutdown",
|
||||
"shutdown-hard",
|
||||
"undeploy",
|
||||
"undeploy-hard",
|
||||
"hold",
|
||||
"release",
|
||||
"stop",
|
||||
"suspend",
|
||||
"resume",
|
||||
"boot",
|
||||
"destroy",
|
||||
"destroy-recreate",
|
||||
"reboot",
|
||||
"reboot-hard",
|
||||
"resched",
|
||||
"unresched",
|
||||
"poweroff",
|
||||
"poweroff-hard"][value]);
|
||||
break;
|
||||
default:
|
||||
return value;
|
||||
@@ -664,7 +691,20 @@ var OpenNebula = {
|
||||
OpenNebula.Action.simple_action(params,OpenNebula.VM.resource,"resubmit");
|
||||
},
|
||||
"poweroff" : function(params){
|
||||
OpenNebula.Action.simple_action(params,OpenNebula.VM.resource,"poweroff");
|
||||
var action_obj = {"hard": false};
|
||||
OpenNebula.Action.simple_action(params,OpenNebula.VM.resource,"poweroff", action_obj);
|
||||
},
|
||||
"poweroff_hard" : function(params){
|
||||
var action_obj = {"hard": true};
|
||||
OpenNebula.Action.simple_action(params,OpenNebula.VM.resource,"poweroff", action_obj);
|
||||
},
|
||||
"undeploy" : function(params){
|
||||
var action_obj = {"hard": false};
|
||||
OpenNebula.Action.simple_action(params,OpenNebula.VM.resource,"undeploy", action_obj);
|
||||
},
|
||||
"undeploy_hard" : function(params){
|
||||
var action_obj = {"hard": true};
|
||||
OpenNebula.Action.simple_action(params,OpenNebula.VM.resource,"undeploy", action_obj);
|
||||
},
|
||||
"reboot" : function(params){
|
||||
OpenNebula.Action.simple_action(params,OpenNebula.VM.resource,"reboot");
|
||||
|
||||
@@ -41,7 +41,7 @@ var acls_tab_content = '\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="three columns">\
|
||||
<input id="acl_search" type="text" placeholder="Search" />\
|
||||
<input id="acl_search" type="text" placeholder="'+tr("Search")+'" />\
|
||||
</div>\
|
||||
<br>\
|
||||
<br>\
|
||||
@@ -64,12 +64,6 @@ var acls_tab_content = '\
|
||||
<tbody id="tbodyaclss">\
|
||||
</tbody>\
|
||||
</table>\
|
||||
<div class="legend_div">\
|
||||
<span>?</span>\
|
||||
<p class="legend_p">\
|
||||
'+tr("This table shows the ACLs rules broken down to easier the reading and meaning of each one. You can show the ACL original string by clicking on Show/Hide columns.")+'\
|
||||
</p>\
|
||||
</div>\
|
||||
</form>';
|
||||
|
||||
var create_acl_tmpl =
|
||||
@@ -155,15 +149,17 @@ var create_acl_tmpl =
|
||||
<div class=""></div>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="reveal-footer">\
|
||||
<hr>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button radius right success" id="create_acl_submit" type="submit" value="Acl.create">'+tr("Create")+'</button>\
|
||||
<button class="button secondary radius" type="reset" value="reset">'+tr("Reset")+'</button>\
|
||||
<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
|
||||
</div>\
|
||||
</div>\
|
||||
<a class="close-reveal-modal">×</a>\
|
||||
</form>';
|
||||
</form>\
|
||||
</div>';
|
||||
|
||||
var acl_actions = {
|
||||
"Acl.create" : {
|
||||
@@ -436,7 +432,7 @@ function setupCreateAclDialog(){
|
||||
// width: 650,
|
||||
// height: height
|
||||
//});
|
||||
dialog.addClass("reveal-modal large");
|
||||
dialog.addClass("reveal-modal large max-height");
|
||||
|
||||
//Default selected options
|
||||
$('#res_subgroup_all',dialog).attr('checked','checked');
|
||||
@@ -617,7 +613,6 @@ function setAclAutorefresh(){
|
||||
$(document).ready(function(){
|
||||
//if we are not oneadmin, our tab will not even be in the DOM.
|
||||
dataTable_acls = $("#datatable_acls",main_tabs_context).dataTable({
|
||||
"sDom" : "<'H'>t<'row'<'six columns'i><'six columns'p>>",
|
||||
"oColVis": {
|
||||
"aiExclude": [ 0 ]
|
||||
},
|
||||
@@ -625,11 +620,7 @@ $(document).ready(function(){
|
||||
{ "bSortable": false, "aTargets": ["check"] },
|
||||
{ "sWidth": "35px", "aTargets": [0,1] },
|
||||
{ "bVisible": false, "aTargets": [6]}
|
||||
],
|
||||
"oLanguage": (datatable_lang != "") ?
|
||||
{
|
||||
sUrl: "locale/"+lang+"/"+datatable_lang
|
||||
} : ""
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -72,15 +72,14 @@ var datastore_datatable_table_tmpl='<thead>\
|
||||
</tbody>'
|
||||
|
||||
|
||||
var create_cluster_tmpl ='<div id="cluster_create_tabs">\
|
||||
<div class="panel">\
|
||||
var create_cluster_tmpl ='<div class="panel">\
|
||||
<h3 >\
|
||||
<small id="create_cluster_header">'+tr("Create Cluster")+'</small>\
|
||||
<small id="update_cluster_header">'+tr("Update Cluster")+'</small>\
|
||||
</h3>\
|
||||
</div>\
|
||||
<div class="reveal-body">\
|
||||
<form class="custom">\
|
||||
<form id="cluster_create_tabs" class="custom">\
|
||||
<div class="row centered">\
|
||||
<div class="columns eight centered">\
|
||||
<div class="two columns">\
|
||||
@@ -107,7 +106,7 @@ var create_cluster_tmpl ='<div id="cluster_create_tabs">\
|
||||
<button id="refresh_host_table_button_class" class="button small radius secondary action_button" value="ClusterHost.list"><i class="icon-refresh" /></button>\
|
||||
</div>\
|
||||
<div class="five columns">\
|
||||
<input id="cluster_hosts_search" type="text" placeholder="Search"/>\
|
||||
<input id="cluster_hosts_search" type="text" placeholder="'+tr("Search")+'"/>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div id="datatable_cluster_hosts_div">\
|
||||
@@ -124,7 +123,7 @@ var create_cluster_tmpl ='<div id="cluster_create_tabs">\
|
||||
<button id="refresh_vnet_table_button_class" class="button small radius secondary action_button" value="ClusterVN.list"><i class="icon-refresh" /></button>\
|
||||
</div>\
|
||||
<div class="five columns">\
|
||||
<input id="cluster_vnets_search" type="text" placeholder="Search"/>\
|
||||
<input id="cluster_vnets_search" type="text" placeholder="'+tr("Search")+'"/>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div id="datatable_cluster_vnets_div">\
|
||||
@@ -141,7 +140,7 @@ var create_cluster_tmpl ='<div id="cluster_create_tabs">\
|
||||
<button id="refresh_datastore_table_button_class" class="button small radius secondary action_button" value="ClusterDS.list"><i class="icon-refresh" /></button>\
|
||||
</div>\
|
||||
<div class="five columns">\
|
||||
<input id="cluster_datastores_search" type="text" placeholder="Search"/>\
|
||||
<input id="cluster_datastores_search" type="text" placeholder="'+tr("Search")+'"/>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div id="datatable_cluster_datastores_div">\
|
||||
@@ -153,18 +152,17 @@ var create_cluster_tmpl ='<div id="cluster_create_tabs">\
|
||||
</div>\
|
||||
</li>\
|
||||
</ul>\
|
||||
<br>\
|
||||
</form>\
|
||||
</div>\
|
||||
<div class="reveal-footer">\
|
||||
<hr>\
|
||||
<div class="form_buttons row">\
|
||||
<button class="button success right radius" type="submit" id="create_cluster_submit" value="OpenNebula.Cluster.create">' + tr("Create") + '</button>\
|
||||
<button class="button right radius" type="submit" id="update_cluster_submit">' + tr("Update") + '</button>\
|
||||
<button class="button secondary radius" type="reset" value="reset">' + tr("Reset") + '</button>\
|
||||
<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
|
||||
</div>\
|
||||
<a class="close-reveal-modal">×</a>\
|
||||
</div>';
|
||||
</div>\
|
||||
<a class="close-reveal-modal">×</a>';
|
||||
|
||||
// Common utils for datatatables
|
||||
// Holds the selected items
|
||||
@@ -185,7 +183,7 @@ function setupCreateClusterDialog(){
|
||||
dialog.html(create_cluster_tmpl);
|
||||
var height = Math.floor($(window).height()*0.8); //set height to a percentage of the window
|
||||
|
||||
dialog.addClass("reveal-modal large");
|
||||
dialog.addClass("reveal-modal large max-height");
|
||||
|
||||
// ------- Create the dialog datatables ------------
|
||||
dataTable_cluster_hosts = $("#datatable_cluster_hosts", dialog).dataTable({
|
||||
@@ -506,7 +504,7 @@ function popUpUpdateClusterDialog(){
|
||||
|
||||
if ( selected_nodes.length != 1 )
|
||||
{
|
||||
alert("Please select one (and just one) cluster to update.");
|
||||
notifyError(tr("Please select one (and just one) cluster to update."));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -877,7 +875,7 @@ var clusters_tab_content = '\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="three columns">\
|
||||
<input id="cluster_search" type="text" placeholder="Search" />\
|
||||
<input id="cluster_search" type="text" placeholder="'+tr("Search")+'" />\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
@@ -1345,8 +1343,6 @@ function updateClustersView (request,list){
|
||||
|
||||
updateView(list_array,dataTable_clusters);
|
||||
updateClusterSelect();
|
||||
//dependency with the infraestructure dashboard plugin
|
||||
//updateInfraDashboard("clusters",list);
|
||||
};
|
||||
|
||||
|
||||
@@ -1815,18 +1811,13 @@ $(document).ready(function(){
|
||||
|
||||
//prepare host datatable
|
||||
dataTable_clusters = $("#datatable_clusters",main_tabs_context).dataTable({
|
||||
"sDom" :"<'H'>t<'row'<'six columns'i><'six columns'p>>",
|
||||
"oColVis": {
|
||||
"aiExclude": [ 0 ]
|
||||
},
|
||||
"aoColumnDefs": [
|
||||
{ "bSortable": false, "aTargets": ["check"] },
|
||||
{ "sWidth": "35px", "aTargets": [0,1] },
|
||||
],
|
||||
"oLanguage": (datatable_lang != "") ?
|
||||
{
|
||||
sUrl: "locale/"+lang+"/"+datatable_lang
|
||||
} : ""
|
||||
]
|
||||
});
|
||||
|
||||
$('#cluster_search').keyup(function(){
|
||||
|
||||
@@ -21,7 +21,7 @@ var config_tab_content =
|
||||
<small id="configuration_dialog">'+tr("Configuration")+'</small>\
|
||||
</h3>\
|
||||
</div>\
|
||||
<br>\
|
||||
<div class="reveal-body">\
|
||||
<div class="row">\
|
||||
<div class="six columns">\
|
||||
<div class="row">\
|
||||
@@ -57,10 +57,13 @@ var config_tab_content =
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="reveal-footer">\
|
||||
<hr>\
|
||||
<div class="form_buttons">\
|
||||
<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
|
||||
</div>\
|
||||
</div>\
|
||||
<a class="close-reveal-modal">×</a>';
|
||||
|
||||
var config_actions = {
|
||||
@@ -80,7 +83,7 @@ function setupConfigDialog() {
|
||||
var dialog = $config_dialog;
|
||||
dialog.html(config_tab_content);
|
||||
|
||||
dialog.addClass("reveal-modal large");
|
||||
dialog.addClass("reveal-modal large max-height");
|
||||
|
||||
setupTips(dialog);
|
||||
|
||||
|
||||
@@ -14,172 +14,6 @@
|
||||
/* limitations under the License. */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
var dashboard_tab_content =
|
||||
'<table class="dashboard_table">\
|
||||
<tr>\
|
||||
<td>\
|
||||
<table style="width:100%">\
|
||||
<tr>\
|
||||
<td>\
|
||||
<div class="panel">\
|
||||
<h4 class="subheader">' + tr("Hosts") + '<i class="icon-refresh action_button" value="Host.refresh" style="float:right;cursor:pointer"></i></h4>\
|
||||
<div class="panel_info">\
|
||||
<table class="info_table">\
|
||||
\
|
||||
<tr>\
|
||||
<td class="key_td">' + tr("Total Hosts") + '</td>\
|
||||
<td class="key_td">' + tr("State") + '</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td colspan="2"><div id="totalHosts" class="big_text" style="float:left;width:50%;padding-top:12px;"></div>\
|
||||
<div id="statePie" style="float:right;width:50%;height:100px;"></div></td>\
|
||||
</tr>\
|
||||
\
|
||||
<tr>\
|
||||
<td class="key_td">' + tr("Global CPU Usage") + '</td>\
|
||||
<td></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td colspan="2"><div id="globalCpuUsage" style="width:100%;height:100px;"></div></td>\
|
||||
</tr>\
|
||||
\
|
||||
<tr>\
|
||||
<td class="key_td">' + tr("Used vs. Max CPU") + '</td>\
|
||||
<td><div id="cpuUsageBar_legend"></div></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td colspan="2">\
|
||||
<div id="cpuUsageBar" style="width:95%;height:50px"></div>\
|
||||
</td>\
|
||||
</tr>\
|
||||
\
|
||||
<tr>\
|
||||
<td class="key_td">' + tr("Used vs. Max Memory") + '</td>\
|
||||
<td><div id="memoryUsageBar_legend"></div></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td colspan="2">\
|
||||
<div id="memoryUsageBar" style="width:95%;height:50px"></div>\
|
||||
</td>\
|
||||
</tr>\
|
||||
\
|
||||
</table>\
|
||||
\
|
||||
</div>\
|
||||
</div>\
|
||||
</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td>\
|
||||
<div class="panel">\
|
||||
<h3>' + tr("Clusters") + '<i class="icon-refresh action_button" value="Host.refresh" style="float:right;cursor:pointer"></i></h3>\
|
||||
<div class="panel_info">\
|
||||
\
|
||||
<table class="info_table">\
|
||||
\
|
||||
<tr>\
|
||||
<td class="key_td">' + tr("Allocated CPU per cluster") + '</td>\
|
||||
<td class="value_td"></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td colspan="2"><div id="cpuPerCluster" style="width:100%;height:100px;overflow:hidden;"></div></td>\
|
||||
</tr>\
|
||||
\
|
||||
<tr>\
|
||||
<td class="key_td">' + tr("Allocated Memory per cluster") + '</td>\
|
||||
<td class="value_td"></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td colspan="2"><div id="memoryPerCluster" style="width:100%;height:100px;overflow:hidden;"></div></td>\
|
||||
</tr>\
|
||||
\
|
||||
</table>\
|
||||
\
|
||||
</div>\
|
||||
</div>\
|
||||
</td>\
|
||||
</tr>\
|
||||
</table>\
|
||||
</td>\
|
||||
<td>\
|
||||
<table style="width:100%">\
|
||||
<tr>\
|
||||
<td>\
|
||||
<div class="panel">\
|
||||
<h3>' + tr("Virtual Machines") + '<i class="icon-refresh action_button" value="VM.refresh" style="float:right;cursor:pointer"></i></h3>\
|
||||
<div class="panel_info">\
|
||||
<table class="info_table">\
|
||||
\
|
||||
<tr>\
|
||||
<td class="key_td">' + tr("Total VMs") + '</td>\
|
||||
<td class="key_td">' + tr("State") + '</td>\
|
||||
</tr>\
|
||||
\
|
||||
<tr>\
|
||||
<td colspan="2"><div id="totalVMs" class="big_text" style="float:left;width:50%;padding-top:12px;"></div>\
|
||||
<div id="vmStatePie" style="float:right;width:50%;height:100px"></div></td>\
|
||||
</tr>\
|
||||
\
|
||||
<tr>\
|
||||
<td class="key_td">' + tr("Bandwidth - Upload") + '</td>\
|
||||
<td class="key_td">' + tr("Bandwidth - Download") + '</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td id="bandwidth_up" class="big_text"></td>\
|
||||
<td id="bandwidth_down" class="big_text"></td>\
|
||||
</tr>\
|
||||
\
|
||||
<tr>\
|
||||
<td class="key_td">' + tr("Global transfer rates") + '</td>\
|
||||
<td colspan="2"><div id="netUsageBar_legend" style="float:right;"></div></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td colspan="3">\
|
||||
<div id="netUsageBar" style="float:left;width:92%;height:50px"></div>\
|
||||
</td>\
|
||||
</tr>\
|
||||
\
|
||||
</table>\
|
||||
</div>\
|
||||
</div>\
|
||||
</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td>\
|
||||
<div class="panel">\
|
||||
<h3>' + tr("System Information") + '</h3>\
|
||||
<div class="panel_info">\
|
||||
<table class="info_table">\
|
||||
\
|
||||
<tr>\
|
||||
<td class="key_td">' + tr("Total Users") + '</td>\
|
||||
<td class="key_td">' + tr("Total Groups") + '</td>\
|
||||
</tr>\
|
||||
\
|
||||
<tr>\
|
||||
<td class="big_text" id="totalUsers"></td>\
|
||||
<td class="big_text" id="totalGroups"></td>\
|
||||
</tr>\
|
||||
\
|
||||
<tr>\
|
||||
<td class="key_td">' + tr("Users per group") + '</td>\
|
||||
<td class="value_td"><i class="icon-refresh action_button" value="User.refresh" style="float:right;cursor:pointer"></i></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td colspan="2"><div id="usersPerGroup" style="width:100%;height:100px;overflow:hidden;"></div></td>\
|
||||
</tr>\
|
||||
\
|
||||
</table>\
|
||||
</div>\
|
||||
</div>\
|
||||
</td>\
|
||||
</tr>\
|
||||
</table>\
|
||||
</td>\
|
||||
</tr></table>';
|
||||
*/
|
||||
|
||||
var dashboard_tab_content = '\
|
||||
<div class="dashboard">\
|
||||
<div class="panel">\
|
||||
@@ -245,7 +79,7 @@ var dashboard_tab_content = '\
|
||||
<span id="total_vnets" class="subheader"/>\
|
||||
<small>'+tr("VNETS")+'</small> \
|
||||
<span id="addresses_vnets" class="subheader"/>\
|
||||
<small>'+tr("ADDRESSES")+'</small>\
|
||||
<small>'+tr("USED IPs")+'</small>\
|
||||
</h3>\
|
||||
</div>\
|
||||
</div>\
|
||||
|
||||
@@ -40,7 +40,7 @@ var datastores_tab_content = '\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="three columns">\
|
||||
<input id="datastore_search" type="text" placeholder="Search" />\
|
||||
<input id="datastore_search" type="text" placeholder="'+tr("Search")+'" />\
|
||||
</div>\
|
||||
<br>\
|
||||
<br>\
|
||||
@@ -66,17 +66,10 @@ var datastores_tab_content = '\
|
||||
<tbody id="tbodydatastores">\
|
||||
</tbody>\
|
||||
</table>\
|
||||
<div class="legend_div">\
|
||||
<span>?</span>\
|
||||
<p class="legend_p">\
|
||||
'+tr("Datatables are sets of images which share a common transfer driver. i.e. Images in a SSH datastore will be copied to the hosts using SSH when deploying a Virtual Machine.")+'\
|
||||
</p>\
|
||||
</div>\
|
||||
</form>';
|
||||
|
||||
var create_datastore_tmpl =
|
||||
'<div class="create_form">\
|
||||
<div class="panel">\
|
||||
'<div class="panel">\
|
||||
<h3>\
|
||||
<small id="create_cluster_header">'+tr("Create Datastore")+'</small>\
|
||||
</h3>\
|
||||
@@ -149,7 +142,7 @@ var create_datastore_tmpl =
|
||||
<select id="disk_type" name="disk_type">\
|
||||
<option value="file">' + tr("File") + '</option>\
|
||||
<option value="block">' + tr("Block") + '</option>\
|
||||
<option value="rbd">' + tr("RBD") + '</option>\
|
||||
<option value="RBD">' + tr("RBD") + '</option>\
|
||||
</select>\
|
||||
</div>\
|
||||
<div class="one columns">\
|
||||
@@ -201,30 +194,32 @@ var create_datastore_tmpl =
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="twelve columns">\
|
||||
<div class="three columns">\
|
||||
<div class="four columns">\
|
||||
<label class="right inline" for="safe_dirs">' + tr("Safe Directories") + ':</label>\
|
||||
</div>\
|
||||
<div class="eight columns">\
|
||||
<div class="seven columns">\
|
||||
<input type="text" name="safe_dirs" id="safe_dirs" />\
|
||||
</div>\
|
||||
<div class="one columns">\
|
||||
<div class="tip">'+tr("Paths that can not be used to register images. A space separated list of paths. This will prevent users registering important files as VM images and accessing them thourgh their VMs. OpenNebula will automatically add its configuration directories: /var/lib/one, /etc/one and oneadmin's home ($HOME).")+'</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="twelve columns">\
|
||||
<div class="three columns">\
|
||||
<div class="four columns">\
|
||||
<label class="right inline" for="restricted_dirs">' + tr("Restricted Directories") + ':</label>\
|
||||
</div>\
|
||||
<div class="eight columns">\
|
||||
<div class="seven columns">\
|
||||
<input type="text" name="restricted_dirs" id="restricted_dirs" />\
|
||||
</div>\
|
||||
<div class="one columns">\
|
||||
<div class="tip">'+tr("If you need to un-block a directory under one of the RESTRICTED_DIRS")+'</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="twelve columns">\
|
||||
<div class="three columns">\
|
||||
<div class="four columns">\
|
||||
<label class="right inline" for="bridge_list">' + tr("Host Bridge List") + ':</label>\
|
||||
</div>\
|
||||
<div class="eight columns">\
|
||||
<div class="seven columns">\
|
||||
<input type="text" name="bridge_list" id="bridge_list" />\
|
||||
</div>\
|
||||
<div class="one columns">\
|
||||
@@ -232,52 +227,53 @@ var create_datastore_tmpl =
|
||||
</div>\
|
||||
<div class="row">\
|
||||
<div class="six columns">\
|
||||
<label class="right inline" for="ds_use_ssh"><input id="ds_use_ssh" type="checkbox" name="ds_use_ssh" value="YES" />' + tr("Use SSH for Datastore Manager") + ':</label>\
|
||||
<label class="right inline" for="ds_use_ssh"><input id="ds_use_ssh" type="checkbox" name="ds_use_ssh" value="YES" />' + tr("Use SSH for Datastore Manager") + '</label>\
|
||||
</div>\
|
||||
<div class="six columns">\
|
||||
<label class="inline" for="tm_use_ssh"><input id="tm_use_ssh" type="checkbox" name="tm_use_ssh" value="YES" />' + tr("Use SSH for Transfer Manager") + ':</label>\
|
||||
<label class="inline" for="tm_use_ssh"><input id="tm_use_ssh" type="checkbox" name="tm_use_ssh" value="YES" />' + tr("Use SSH for Transfer Manager") + '</label>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="twelve columns">\
|
||||
<div class="three columns">\
|
||||
<div class="four columns">\
|
||||
<label class="right inline" for="host">' + tr("Storage Server") + ':</label>\
|
||||
</div>\
|
||||
<div class="eight columns">\
|
||||
<div class="seven columns">\
|
||||
<input type="text" name="host" id="host" />\
|
||||
</div>\
|
||||
<div class="one columns">\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="twelve columns">\
|
||||
<div class="three columns">\
|
||||
<div class="four columns">\
|
||||
<label class="right inline" for="base_iqn">' + tr("Base IQN") + ':</label>\
|
||||
</div>\
|
||||
<div class="eight columns">\
|
||||
<div class="seven columns">\
|
||||
<input type="text" name="base_iqn" id="base_iqn" />\
|
||||
</div>\
|
||||
<div class="one columns">\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="twelve columns">\
|
||||
<div class="three columns">\
|
||||
<div class="four columns">\
|
||||
<label class="right inline" for="vg_name">' + tr("Volume Group Name") + ':</label>\
|
||||
</div>\
|
||||
<div class="eight columns">\
|
||||
<div class="seven columns">\
|
||||
<input type="text" name="vg_name" id="vg_name" />\
|
||||
</div>\
|
||||
<div class="one columns">\
|
||||
</div>\
|
||||
</div>\
|
||||
</form>\
|
||||
</div>\
|
||||
<div class="reveal-footer">\
|
||||
<hr>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button radius right success" type="submit" id="create_datastore_submit" value="OpenNebula.Datastore.create">' + tr("Create") + '</button>\
|
||||
<button class="button radius secondary" type="reset" value="reset">' + tr("Reset") + '</button>\
|
||||
<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
|
||||
</div>\
|
||||
</div>\
|
||||
<a class="close-reveal-modal">×</a>\
|
||||
</div>';
|
||||
</form>';
|
||||
|
||||
var datastore_image_table_tmpl='<thead>\
|
||||
<tr>\
|
||||
@@ -761,13 +757,13 @@ function hide_all(context)
|
||||
// Set up the create datastore dialog
|
||||
function setupCreateDatastoreDialog(){
|
||||
|
||||
dialogs_context.append('<div title=\"'+tr("Create Datastore")+'\" id="create_datastore_dialog"></div>');
|
||||
dialogs_context.append('<div id="create_datastore_dialog"></div>');
|
||||
//Insert HTML in place
|
||||
$create_datastore_dialog = $('#create_datastore_dialog')
|
||||
var dialog = $create_datastore_dialog;
|
||||
dialog.html(create_datastore_tmpl);
|
||||
|
||||
dialog.addClass("reveal-modal large");
|
||||
dialog.addClass("reveal-modal large max-height");
|
||||
|
||||
setupTips(dialog);
|
||||
|
||||
@@ -942,7 +938,7 @@ function select_ceph(){
|
||||
$('select#ds_mad').attr('disabled', 'disabled');
|
||||
$('select#tm_mad').val('ceph');
|
||||
$('select#tm_mad').attr('disabled', 'disabled');
|
||||
$('select#ds_type').val('rbd');
|
||||
$('select#disk_type').val('RBD');
|
||||
}
|
||||
|
||||
function select_lvm(){
|
||||
@@ -990,18 +986,13 @@ function setDatastoreAutorefresh(){
|
||||
$(document).ready(function(){
|
||||
|
||||
dataTable_datastores = $("#datatable_datastores",main_tabs_context).dataTable({
|
||||
"sDom" : "<'H'>t<'row'<'six columns'i><'six columns'p>>",
|
||||
"oColVis": {
|
||||
"aiExclude": [ 0 ]
|
||||
},
|
||||
"aoColumnDefs": [
|
||||
{ "sWidth": "35px", "aTargets": [0,1] },
|
||||
{ "bVisible": false, "aTargets": [6,7,8,9] }
|
||||
],
|
||||
"oLanguage": (datatable_lang != "") ?
|
||||
{
|
||||
sUrl: "locale/"+lang+"/"+datatable_lang
|
||||
} : ""
|
||||
]
|
||||
});
|
||||
|
||||
$('#datastore_search').keyup(function(){
|
||||
|
||||
@@ -40,7 +40,7 @@ var files_tab_content = '\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="three columns">\
|
||||
<input id="file_search" type="text" placeholder="Search" />\
|
||||
<input id="file_search" type="text" placeholder="'+tr("Search")+'" />\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
@@ -67,12 +67,6 @@ var files_tab_content = '\
|
||||
<tbody id="tbodyfiles">\
|
||||
</tbody>\
|
||||
</table>\
|
||||
<div class="legend_div">\
|
||||
<span>?</span>\
|
||||
<p class="legend_p">\
|
||||
'+tr("Size and registration time are hidden colums. Note that persistent files can only be used by 1 VM. To change file datastore, please re-register the file.")+'\
|
||||
</p>\
|
||||
</div>\
|
||||
</form>';
|
||||
|
||||
var create_file_tmpl =
|
||||
@@ -80,8 +74,8 @@ var create_file_tmpl =
|
||||
<div class="panel">\
|
||||
<h3><small>'+tr("Create File")+'</small></h4>\
|
||||
</div>\
|
||||
<div class="reveal-body">\
|
||||
<form id="create_file_form_easy" action="" class="custom creation">\
|
||||
<div class="reveal-body">\
|
||||
<div class="row vm_param">\
|
||||
<div class="six columns">\
|
||||
<div class="row">\
|
||||
@@ -156,7 +150,7 @@ var create_file_tmpl =
|
||||
</fieldset>\
|
||||
</div>\
|
||||
<div class="show_hide" id="advanced_file_create">\
|
||||
<h4><small><i class=" icon-plus-sign-alt"/> '+tr("Advanced options")+'<a id="add_os_boot_opts" class="icon_left" href="#"></a></small></h4>\
|
||||
<h4><small><i class=" icon-caret-down"/> '+tr("Advanced options")+'<a id="add_os_boot_opts" class="icon_left" href="#"></a></small></h4>\
|
||||
</div>\
|
||||
<div class="advanced">\
|
||||
<div class="row">\
|
||||
@@ -178,13 +172,13 @@ var create_file_tmpl =
|
||||
</div>\
|
||||
</div>\
|
||||
<hr>\
|
||||
</form>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button success radius right" id="create_file_submit" value="file/create">'+tr("Create")+'</button>\
|
||||
<button class="button secondary radius" type="reset" value="reset">'+tr("Reset")+'</button>\
|
||||
<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
|
||||
</div>\
|
||||
<a class="close-reveal-modal">×</a>\
|
||||
</form>\
|
||||
</div>';
|
||||
|
||||
var dataTable_files;
|
||||
@@ -325,16 +319,6 @@ var file_actions = {
|
||||
error: onError,
|
||||
notify: true
|
||||
},
|
||||
"File.clone_dialog" : {
|
||||
type: "custom",
|
||||
call: popUpFileCloneDialog
|
||||
},
|
||||
"File.clone" : {
|
||||
type: "single",
|
||||
call: OpenNebula.Image.clone,
|
||||
error: onError,
|
||||
notify: true
|
||||
},
|
||||
"File.help" : {
|
||||
type: "custom",
|
||||
call: function() {
|
||||
@@ -392,11 +376,6 @@ var file_buttons = {
|
||||
layout: "more_select",
|
||||
text: tr("Disable")
|
||||
},
|
||||
"File.clone_dialog" : {
|
||||
type: "action",
|
||||
layout: "main",
|
||||
text: tr("Clone")
|
||||
},
|
||||
"File.delete" : {
|
||||
type: "confirm",
|
||||
layout: "del",
|
||||
@@ -552,14 +531,6 @@ function updateFileInfo(request,img){
|
||||
<td class="value_td">'+pretty_time(img_info.REGTIME)+'</td>\
|
||||
<td></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">'+tr("Persistent")+'</td>\
|
||||
<td class="value_td_persistency">'+(parseInt(img_info.PERSISTENT) ? tr("yes") : tr("no"))+'</td>\
|
||||
<td><div id="div_edit_persistency_files">\
|
||||
<a id="div_edit_persistency_link" class="edit_e" href="#"><i class="icon-edit right"/></a>\
|
||||
</div>\
|
||||
</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">'+tr("Filesystem type")+'</td>\
|
||||
<td class="value_td">'+(typeof img_info.FSTYPE === "string" ? img_info.FSTYPE : "--")+'</td>\
|
||||
@@ -639,26 +610,6 @@ function updateFileInfo(request,img){
|
||||
Sunstone.runAction("File.showinfo", img_info.ID);
|
||||
});
|
||||
|
||||
// Listener for edit link for persistency change
|
||||
$("#div_edit_persistency_files").live("click", function() {
|
||||
var value_str = $(".value_td_persistency").text();
|
||||
$(".value_td_persistency").html(
|
||||
'<select id="persistency_select_files">\
|
||||
<option value="yes">'+tr("yes")+'</option>\
|
||||
<option value="no">'+tr("no")+'</option>\
|
||||
</select>');
|
||||
$('option[value="'+value_str+'"]').replaceWith('<option value="'+value_str+'" selected="selected">'+tr(value_str)+'</option>');
|
||||
});
|
||||
|
||||
$("#persistency_select_files").live("change", function() {
|
||||
var new_value=$("option:selected", this).text();
|
||||
|
||||
if (new_value=="yes")
|
||||
Sunstone.runAction("File.persistent",[img_info.ID]);
|
||||
else
|
||||
Sunstone.runAction("File.nonpersistent",[img_info.ID]);
|
||||
|
||||
});
|
||||
|
||||
Sunstone.updateInfoPanelTab("file_info_panel","file_info_tab",info_tab);
|
||||
Sunstone.popUpInfoPanel("file_info_panel");
|
||||
@@ -952,12 +903,10 @@ function is_persistent_file(id){
|
||||
return $(data).is(':checked');
|
||||
};
|
||||
|
||||
|
||||
//The DOM is ready at this point
|
||||
$(document).ready(function(){
|
||||
|
||||
dataTable_files = $("#datatable_files",main_tabs_context).dataTable({
|
||||
"sDom" : "<'H'>t<'row'<'six columns'i><'six columns'p>>",
|
||||
"oColVis": {
|
||||
"aiExclude": [ 0 ]
|
||||
},
|
||||
@@ -968,11 +917,7 @@ $(document).ready(function(){
|
||||
{ "sWidth": "100px", "aTargets": [5,7] },
|
||||
{ "sWidth": "150px", "aTargets": [8] },
|
||||
{ "bVisible": false, "aTargets": [6,8,9,11,12]}
|
||||
],
|
||||
"oLanguage": (datatable_lang != "") ?
|
||||
{
|
||||
sUrl: "locale/"+lang+"/"+datatable_lang
|
||||
} : ""
|
||||
]
|
||||
});
|
||||
|
||||
$('#file_search').keyup(function(){
|
||||
@@ -986,7 +931,6 @@ $(document).ready(function(){
|
||||
|
||||
setupCreateFileDialog();
|
||||
setupTips($create_file_dialog);
|
||||
setupFileCloneDialog();
|
||||
setFileAutorefresh();
|
||||
|
||||
initCheckAllBoxes(dataTable_files);
|
||||
|
||||
@@ -61,7 +61,7 @@ var groups_tab_content = '\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="three columns">\
|
||||
<input id="group_search" type="text" placeholder="Search" />\
|
||||
<input id="group_search" type="text" placeholder="'+tr("Search")+'" />\
|
||||
</div>\
|
||||
<br>\
|
||||
<br>\
|
||||
@@ -77,19 +77,13 @@ var groups_tab_content = '\
|
||||
<th>'+tr("Name")+'</th>\
|
||||
<th>'+tr("Users")+'</th>\
|
||||
<th>'+tr("VMs")+'</th>\
|
||||
<th>'+tr("UMEM")+'</th>\
|
||||
<th>'+tr("UCPU")+'</th>\
|
||||
<th>'+tr("Memory")+'</th>\
|
||||
<th>'+tr("CPU")+'</th>\
|
||||
</tr>\
|
||||
</thead>\
|
||||
<tbody id="tbodygroups">\
|
||||
</tbody>\
|
||||
</table>\
|
||||
<div class="legend_div">\
|
||||
<span>?</span>\
|
||||
<p class="legend_p">\
|
||||
'+tr("Tip: Refresh the list if it only shows user ids in the Users column.")+'\
|
||||
</p>\
|
||||
</div>\
|
||||
</form>';
|
||||
|
||||
var create_group_tmpl =
|
||||
@@ -143,7 +137,7 @@ var group_quotas_tmpl = '<div class="panel">\
|
||||
<label class="inline right" >'+tr("Max VMs")+':</label>\
|
||||
</div>\
|
||||
<div class="seven columns">\
|
||||
<input type="text" name="VMS"></input><br />\
|
||||
<input type="text" name="VMS"></input>\
|
||||
</div>\
|
||||
<div class="one columns">\
|
||||
<div class=""></div>\
|
||||
@@ -154,7 +148,7 @@ var group_quotas_tmpl = '<div class="panel">\
|
||||
<label class="inline right" >'+tr("Max Memory (MB)")+':</label>\
|
||||
</div>\
|
||||
<div class="seven columns">\
|
||||
<input type="text" name="MEMORY"></input><br />\
|
||||
<input type="text" name="MEMORY"></input>\
|
||||
</div>\
|
||||
<div class="one columns">\
|
||||
<div class=""></div>\
|
||||
@@ -178,7 +172,7 @@ var group_quotas_tmpl = '<div class="panel">\
|
||||
<label class="inline right" >'+tr("Datastore")+'</label>\
|
||||
</div>\
|
||||
<div class="seven columns">\
|
||||
<select name="ID"></select><br />\
|
||||
<select name="ID"></select>\
|
||||
</div>\
|
||||
<div class="one columns">\
|
||||
<div class=""></div>\
|
||||
@@ -189,7 +183,7 @@ var group_quotas_tmpl = '<div class="panel">\
|
||||
<label class="inline right" >'+tr("Max size (MB)")+':</label>\
|
||||
</div>\
|
||||
<div class="seven columns">\
|
||||
<input type="text" name="SIZE"></input><br />\
|
||||
<input type="text" name="SIZE"></input>\
|
||||
</div>\
|
||||
<div class="one columns">\
|
||||
<div class=""></div>\
|
||||
@@ -213,7 +207,7 @@ var group_quotas_tmpl = '<div class="panel">\
|
||||
<label class="inline right" >'+tr("Image")+'</label>\
|
||||
</div>\
|
||||
<div class="seven columns">\
|
||||
<select name="ID"></select><br />\
|
||||
<select name="ID"></select>\
|
||||
</div>\
|
||||
<div class="one columns">\
|
||||
<div class=""></div>\
|
||||
@@ -237,7 +231,7 @@ var group_quotas_tmpl = '<div class="panel">\
|
||||
<label class="inline right" >'+tr("Network")+'</label>\
|
||||
</div>\
|
||||
<div class="seven columns">\
|
||||
<select name="ID"></select><br />\
|
||||
<select name="ID"></select>\
|
||||
</div>\
|
||||
<div class="one columns">\
|
||||
<div class=""></div>\
|
||||
@@ -271,14 +265,16 @@ var group_quotas_tmpl = '<div class="panel">\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="reveal-footer">\
|
||||
<hr>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button radius right success" id="create_user_submit" type="submit" value="Group.set_quota">'+tr("Apply changes")+'</button>\
|
||||
<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
|
||||
</div>\
|
||||
</div>\
|
||||
<a class="close-reveal-modal">×</a>\
|
||||
</form>';
|
||||
</form>\
|
||||
</div>';
|
||||
|
||||
|
||||
var group_actions = {
|
||||
@@ -799,15 +795,10 @@ function setGroupAutorefresh(){
|
||||
|
||||
$(document).ready(function(){
|
||||
dataTable_groups = $("#datatable_groups",main_tabs_context).dataTable({
|
||||
"sDom" : "<'H'>t<'row'<'six columns'i><'six columns'p>>",
|
||||
"aoColumnDefs": [
|
||||
{ "bSortable": false, "aTargets": ["check"] },
|
||||
{ "sWidth": "35px", "aTargets": [0,1] }
|
||||
],
|
||||
"oLanguage": (datatable_lang != "") ?
|
||||
{
|
||||
sUrl: "locale/"+lang+"/"+datatable_lang
|
||||
} : ""
|
||||
]
|
||||
});
|
||||
|
||||
//addElement([
|
||||
|
||||
@@ -44,7 +44,7 @@ var hosts_tab_content = '\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="three columns">\
|
||||
<input id="hosts_search" type="text" placeholder="Search" />\
|
||||
<input id="hosts_search" type="text" placeholder="'+tr("Search")+'" />\
|
||||
</div>\
|
||||
<br>\
|
||||
<br>\
|
||||
@@ -73,32 +73,19 @@ var hosts_tab_content = '\
|
||||
<tbody id="tbodyhosts">\
|
||||
</tbody>\
|
||||
</table>\
|
||||
<div class="legend_div">\
|
||||
<span>?</span>\
|
||||
<p class="legend_p">\
|
||||
'+tr("CPU Use is calculated as the minimum between (total CPU - real CPU usage) and (allocated CPU). Real CPU usage is provided by the hosts monitoring driver. Available CPU is calculated using the information from the CPU setting of the VMs running on that host (allocated CPU)")+'\
|
||||
</p>\
|
||||
<p class="legend_p">\
|
||||
'+tr("Memory use is calculated according to the information provided by the host monitoring driver.")+'\
|
||||
</p>\
|
||||
<p class="legend_p">\
|
||||
'+tr("You can get monitoring graphs by clicking in the desired host and visiting the monitoring information tab. Note that oneacctd must be running for this information to be updated/available.")+'\
|
||||
</p>\
|
||||
</div>\
|
||||
</form>';
|
||||
|
||||
var create_host_tmpl =
|
||||
'<div class="create_form">\
|
||||
<div class="panel">\
|
||||
'<div class="panel">\
|
||||
<h3 >\
|
||||
<small id="create_cluster_header">'+tr("Create Host")+'</small>\
|
||||
</h3>\
|
||||
</div>\
|
||||
<div class="reveal-body">\
|
||||
<div class="reveal-body">\
|
||||
<form id="create_host_form" action="" class="">\
|
||||
<div class="row">\
|
||||
<div class="four columns">\
|
||||
<label class="inline right" for="name">' + tr("Name") + ':</label>\
|
||||
<label class="inline right" for="name">' + tr("Hostname") + ':</label>\
|
||||
</div>\
|
||||
<div class="seven columns">\
|
||||
<input type="text" name="name" id="name" />\
|
||||
@@ -191,15 +178,17 @@ var create_host_tmpl =
|
||||
<div class="tip"></div>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="reveal-footer">\
|
||||
<hr>\
|
||||
<div class="form_buttons row">\
|
||||
<button class="button success right radius" type="submit" id="create_host_submit" value="OpenNebula.Host.create">' + tr("Create") + '</button>\
|
||||
<button class="button secondary radius" type="reset" value="reset">' + tr("Reset") + '</button>\
|
||||
<button class="close-reveal-modal button secondary radius" action="" type="button" value="close">' + tr("Close") + '</button>\
|
||||
</div>\
|
||||
</div>\
|
||||
<a class="close-reveal-modal">×</a>\
|
||||
</form></div>';
|
||||
</form>\
|
||||
</div>';
|
||||
|
||||
var hosts_select="";
|
||||
var dataTable_hosts;
|
||||
@@ -296,14 +285,14 @@ var host_actions = {
|
||||
var host_graphs = [
|
||||
{
|
||||
monitor_resources : "HOST_SHARE/CPU_USAGE,HOST_SHARE/USED_CPU,HOST_SHARE/MAX_CPU",
|
||||
labels : "Allocated,Real,Total",
|
||||
labels : tr("Allocated")+","+tr("Real")+","+tr("Total"),
|
||||
humanize_figures : false,
|
||||
div_graph : $("#host_cpu_graph"),
|
||||
div_legend : $("#host_cpu_legend")
|
||||
},
|
||||
{
|
||||
monitor_resources : "HOST_SHARE/MEM_USAGE,HOST_SHARE/USED_MEM,HOST_SHARE/MAX_MEM",
|
||||
labels : "Allocated,Real,Total",
|
||||
labels : tr("Allocated")+","+tr("Real")+","+tr("Total"),
|
||||
humanize_figures : true,
|
||||
div_graph : $("#host_mem_graph"),
|
||||
div_legend : $("#host_mem_legend")
|
||||
@@ -327,14 +316,14 @@ var host_actions = {
|
||||
var host_dashboard_graphs = [
|
||||
{
|
||||
monitor_resources : "HOST_SHARE/CPU_USAGE,HOST_SHARE/USED_CPU,HOST_SHARE/MAX_CPU",
|
||||
labels : "Allocated,Real,Total",
|
||||
labels : tr("Allocated")+","+tr("Real")+","+tr("Total"),
|
||||
humanize_figures : false,
|
||||
div_graph : $("#dash_host_cpu_graph", $dashboard)
|
||||
//div_legend : $("#dash_host_cpu_legend", $dashboard)
|
||||
},
|
||||
{
|
||||
monitor_resources : "HOST_SHARE/MEM_USAGE,HOST_SHARE/USED_MEM,HOST_SHARE/MAX_MEM",
|
||||
labels : "Allocated,Real,Total",
|
||||
labels : tr("Allocated")+","+tr("Real")+","+tr("Total"),
|
||||
humanize_figures : true,
|
||||
div_graph : $("#dash_host_mem_graph", $dashboard),
|
||||
div_legend : $("#dash_host_mem_legend", $dashboard)
|
||||
@@ -947,7 +936,7 @@ function setupCreateHostDialog(){
|
||||
// modal: true,
|
||||
// width: 500
|
||||
//});
|
||||
dialog.addClass("reveal-modal");
|
||||
dialog.addClass("reveal-modal max-height");
|
||||
|
||||
//$('button',dialog).button();
|
||||
|
||||
@@ -1049,7 +1038,6 @@ $(document).ready(function(){
|
||||
|
||||
//prepare host datatable
|
||||
dataTable_hosts = $("#datatable_hosts",main_tabs_context).dataTable({
|
||||
"sDom" : "<'H'>t<'row'<'six columns'i><'six columns'p>>",
|
||||
"oColVis": { //exclude checkbox column
|
||||
"aiExclude": [ 0 ]
|
||||
},
|
||||
@@ -1057,11 +1045,7 @@ $(document).ready(function(){
|
||||
//{ "bSortable": false, "aTargets": ["check"] },
|
||||
{ "sWidth": "35px", "aTargets": [0,1,4,9] }, //check, ID, RVMS, Status
|
||||
{ "bVisible": false, "aTargets": [5,7,10,11,12]}
|
||||
],
|
||||
"oLanguage": (datatable_lang != "") ?
|
||||
{
|
||||
sUrl: "locale/"+lang+"/"+datatable_lang
|
||||
} : ""
|
||||
]
|
||||
});
|
||||
|
||||
$('#hosts_search').keyup(function(){
|
||||
|
||||
@@ -27,7 +27,7 @@ var images_tab_content = '\
|
||||
</span>\
|
||||
<span class="header-info">\
|
||||
<span id="total_images"/> <small>'+tr("TOTAL")+'</small> \
|
||||
<span id="size_images"/> <small>'+tr("SIZE")+'</small>\
|
||||
<span id="size_images"/> <small>'+tr("USED")+'</small>\
|
||||
</span>\
|
||||
<span class="user-login">\
|
||||
</span>\
|
||||
@@ -40,7 +40,7 @@ var images_tab_content = '\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="three columns">\
|
||||
<input id="image_search" type="text" placeholder="Search" />\
|
||||
<input id="image_search" type="text" placeholder="'+tr("Search")+'" />\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
@@ -67,27 +67,20 @@ var images_tab_content = '\
|
||||
<tbody id="tbodyimages">\
|
||||
</tbody>\
|
||||
</table>\
|
||||
<div class="legend_div">\
|
||||
<span>?</span>\
|
||||
<p class="legend_p">\
|
||||
'+tr("Size and registration time are hidden colums. Note that persistent images can only be used by 1 VM. To change image datastore, please re-register the image.")+'\
|
||||
</p>\
|
||||
</div>\
|
||||
</form>';
|
||||
|
||||
var create_image_tmpl =
|
||||
'<div id="img_tabs">\
|
||||
<div class="panel">\
|
||||
'<div class="panel">\
|
||||
<h3><small>'+tr("Create Image")+'</small></h4>\
|
||||
</div>\
|
||||
<div class="reveal-body">\
|
||||
<form id="create_image" action="" class="custom creation">\
|
||||
<dl class="tabs">\
|
||||
<dd class="active"><a href="#img_easy">'+tr("Wizard")+'</a></dd>\
|
||||
<dd><a href="#img_manual">'+tr("Advanced mode")+'</a></dd>\
|
||||
</dl>\
|
||||
<ul class="tabs-content">\
|
||||
<li id="img_easyTab" class="active">\
|
||||
<div class="reveal-body">\
|
||||
<form id="create_image_form_easy" action="" class="custom creation">\
|
||||
<div class="row vm_param">\
|
||||
<div class="six columns">\
|
||||
<div class="row">\
|
||||
@@ -202,7 +195,7 @@ var create_image_tmpl =
|
||||
</fieldset>\
|
||||
</div>\
|
||||
<div class="show_hide" id="advanced_image_create">\
|
||||
<h4><small><i class=" icon-plus-sign-alt"/> '+tr("Advanced options")+'<a id="add_os_boot_opts" class="icon_left" href="#"></a></small></h4>\
|
||||
<h4><small><i class=" icon-caret-down"/> '+tr("Advanced options")+'<a id="add_os_boot_opts" class="icon_left" href="#"></a></small></h4>\
|
||||
</div>\
|
||||
<div class="advanced">\
|
||||
<div class="row">\
|
||||
@@ -257,34 +250,35 @@ var create_image_tmpl =
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
<hr>\
|
||||
</form>\
|
||||
<div class="reveal-footer">\
|
||||
<hr>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button success radius right" id="create_image_submit" value="image/create">'+tr("Create")+'</button>\
|
||||
<button class="button secondary radius" type="reset" value="reset">'+tr("Reset")+'</button>\
|
||||
<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
|
||||
</div>\
|
||||
</div>\
|
||||
</li>\
|
||||
<li id="img_manualTab">\
|
||||
<div class="reveal-body">\
|
||||
<form id="create_image_form_manual" action="" class="custom">\
|
||||
<h4><small>'+tr("Write the image template here")+'</small></h4>\
|
||||
<label for="img_datastores_raw">'+tr("Datastore")+':</label>\
|
||||
<select id="img_datastore_raw" name="img_datastore_raw">\
|
||||
</select>\
|
||||
<textarea id="template" rows="15" style="width:100%;"></textarea>\
|
||||
</div>\
|
||||
<div class="reveal-footer">\
|
||||
<hr>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button success radius right" id="create_image_submit_manual" value="image/create">'+tr("Create")+'</button>\
|
||||
<button class="button secondary radius" type="reset" value="reset">'+tr("Reset")+'</button>\
|
||||
<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
|
||||
</div>\
|
||||
</form>\
|
||||
</div>\
|
||||
</li>\
|
||||
</ul>\
|
||||
<a class="close-reveal-modal">×</a>\
|
||||
</form>\
|
||||
</div>';
|
||||
|
||||
var dataTable_images;
|
||||
@@ -828,7 +822,7 @@ function setupCreateImageDialog(){
|
||||
// width: 520,
|
||||
// height: height
|
||||
//});
|
||||
dialog.addClass("reveal-modal large");
|
||||
dialog.addClass("reveal-modal large max-height");
|
||||
|
||||
$('.advanced',dialog).hide();
|
||||
|
||||
@@ -1253,7 +1247,6 @@ function popUpImageCloneDialog(){
|
||||
$(document).ready(function(){
|
||||
|
||||
dataTable_images = $("#datatable_images",main_tabs_context).dataTable({
|
||||
"sDom" : "<'H'>t<'row'<'six columns'i><'six columns'p>>",
|
||||
"oColVis": {
|
||||
"aiExclude": [ 0 ]
|
||||
},
|
||||
@@ -1264,11 +1257,7 @@ $(document).ready(function(){
|
||||
{ "sWidth": "100px", "aTargets": [5,7] },
|
||||
{ "sWidth": "150px", "aTargets": [8] },
|
||||
{ "bVisible": false, "aTargets": [6,8,12]}
|
||||
],
|
||||
"oLanguage": (datatable_lang != "") ?
|
||||
{
|
||||
sUrl: "locale/"+lang+"/"+datatable_lang
|
||||
} : ""
|
||||
]
|
||||
});
|
||||
|
||||
$('#image_search').keyup(function(){
|
||||
|
||||
@@ -120,7 +120,7 @@ var marketplace_tab_content = '\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="three columns">\
|
||||
<input id="marketplace_search" type="text" placeholder="Search" />\
|
||||
<input id="marketplace_search" type="text" placeholder="'+tr("Search")+'" />\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
@@ -285,7 +285,6 @@ function onlyOneCheckboxListener(dataTable) {
|
||||
$(document).ready(function(){
|
||||
dataTable_marketplace = $("#datatable_marketplace", main_tabs_context).dataTable({
|
||||
"bSortClasses": true,
|
||||
"sDom" : "<'H'>t<'row'<'six columns'i><'six columns'p>>",
|
||||
"aoColumns": [
|
||||
{ "bSortable": false,
|
||||
"mData": function ( o, val, data ) {
|
||||
@@ -304,11 +303,7 @@ $(document).ready(function(){
|
||||
{ "mDataProp": "files.0.os-arch", "sWidth" : "100px"},
|
||||
{ "mDataProp": "files.0.format", "sWidth" : "100px"},
|
||||
{ "mDataProp": "tags", "bVisible": false}
|
||||
],
|
||||
"oLanguage": (datatable_lang != "") ?
|
||||
{
|
||||
sUrl: "locale/"+lang+"/"+datatable_lang
|
||||
} : ""
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ var templates_tab_content = '\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="three columns">\
|
||||
<input id="template_search" type="text" placeholder="Search" />\
|
||||
<input id="template_search" type="text" placeholder="'+tr("Search")+'" />\
|
||||
</div>\
|
||||
<br>\
|
||||
<br>\
|
||||
@@ -63,45 +63,35 @@ var templates_tab_content = '\
|
||||
</table>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="legend_div">\
|
||||
<span>?</span>\
|
||||
<p class="legend_p">\
|
||||
'+tr("Clicking `instantiate` will create new Virtual Machines from the selected templates and name one-id. You will be able to assign a specific name to a new VM, or launch several instances at once if the template doesn't reference any persistent image.")+'\
|
||||
</p>\
|
||||
<p class="legend_p">\
|
||||
'+tr("You can clone a template to obtain a copy from an existing template. This copy will be owned by you.")+'\
|
||||
</p>\
|
||||
</div>\
|
||||
</form>';
|
||||
|
||||
|
||||
var create_template_tmpl = '<div class="panel">'+
|
||||
'<h3><small>'+tr("Create VM Template")+'</small></h4>'+
|
||||
'<h3><small id="create_template_header">'+tr("Create VM Template")+'</small><small id="update_template_header" class="hidden">'+tr("Update VM Template")+'</small></h3>'+
|
||||
'</div>'+
|
||||
'<div class="row">'+
|
||||
'<div class="reveal-body">'+
|
||||
'<form class="custom creation">'+
|
||||
'<div class="">'+
|
||||
'<div class="columns three">'+
|
||||
'<dl id="template_create_tabs" class="tabs vertical">'+
|
||||
'</dl>'+
|
||||
'</div>'+
|
||||
'<div class="columns nine">'+
|
||||
'<div class="reveal-body">'+
|
||||
'<form class="custom creation">'+
|
||||
'<ul id="template_create_tabs_content" class="tabs-content">'+
|
||||
'</ul>'+
|
||||
'</form>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<div class="">'+
|
||||
'<div class="reveal-footer">'+
|
||||
'<hr>'+
|
||||
'<button class="success button radius" id="create_template_form_easy" value="OpenNebula.Template.create" style="float: right">'+tr("Create")+'</button>'+
|
||||
'<button class="button hidden radius" id="template_template_update_button" value="Template.update_template" style="float: right">'+tr("Update")+'</button>'+
|
||||
'<button class="button secondary radius" id="template_template_reset_button" value="">'+tr("Reset")+'</button>'+
|
||||
'<button class="button secondary radius" id="template_template_reset_button" value="reset" type="reset">'+tr("Reset")+'</button>'+
|
||||
'<button class="button secondary hidden radius" id="template_template_reset_button_update" value="reset" type="reset">'+tr("Reset")+'</button>'+
|
||||
'<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>'+
|
||||
//'<button class="button secondary radius" id="wizard_next" type="reset" style="float: right">'+tr("Next")+' <span class=" icon-angle-right"></span> </button>'+
|
||||
//'<button class="button secondary radius" id="wizard_previous" type="reset" style="float: right"><span class="icon-angle-left"></span> '+tr("Previous")+'</button>'+
|
||||
'</div>'+
|
||||
'<a class="close-reveal-modal">×</a>';
|
||||
'<a class="close-reveal-modal">×</a>'+
|
||||
'</form>'+
|
||||
'</div>';
|
||||
|
||||
|
||||
var update_template_tmpl =
|
||||
@@ -528,13 +518,13 @@ function generate_capacity_tab_content() {
|
||||
'</div>'+
|
||||
'<hr>'+
|
||||
'<br>'+
|
||||
'<div class="row vm_param">'+
|
||||
'<div class="row">'+
|
||||
'<div class="two columns">'+
|
||||
'<label class="inline right" for="CPU">'+tr("CPU")+':</label>'+
|
||||
'</div>'+
|
||||
'<div id="cpu_slider" class="seven columns">'+
|
||||
'</div>'+
|
||||
'<div class="one columns">'+
|
||||
'<div class="one columns vm_param">'+
|
||||
'<input type="text" id="CPU" name="cpu" size="2"/>'+
|
||||
'</div>'+
|
||||
'<div class="one right columns">'+
|
||||
@@ -564,16 +554,16 @@ function generate_capacity_tab_content() {
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<div class="show_hide" id="advanced_capacity">'+
|
||||
'<h4><small><i class=" icon-plus-sign-alt"/> '+tr("Advanced options")+'<a id="add_os_boot_opts" class="icon_left" href="#"></a></small></h4>'+
|
||||
'<h4><small><i class=" icon-caret-down"/> '+tr("Advanced options")+'<a id="add_os_boot_opts" class="icon_left" href="#"></a></small></h4>'+
|
||||
'</div>'+
|
||||
'<div class="advanced">'+
|
||||
'<div class="row vm_param">'+
|
||||
'<div class="row">'+
|
||||
'<div class="two columns">'+
|
||||
'<label class="inline right" for="VCPU">'+tr("VCPU")+':</label>'+
|
||||
'</div>'+
|
||||
'<div id="vcpu_slider" class="seven columns">'+
|
||||
'</div>'+
|
||||
'<div class="one columns">'+
|
||||
'<div class="one columns vm_param">'+
|
||||
'<input type="text" id="VCPU" name="vcpu" size="3" />'+
|
||||
'</div>'+
|
||||
'<div class="one right columns">'+
|
||||
@@ -755,10 +745,10 @@ function setup_capacity_tab_content(capacity_section) {
|
||||
function generate_disk_tab_content(str_disk_tab_id, str_datatable_id){
|
||||
var html = '<div class="row">'+
|
||||
'<div class="three columns push-three">'+
|
||||
'<input id="'+str_disk_tab_id+'radioImage" type="radio" name="'+str_disk_tab_id+'" value="image" checked> Image '+
|
||||
'<input id="'+str_disk_tab_id+'radioImage" type="radio" name="'+str_disk_tab_id+'" value="image" checked> '+tr("Image")+
|
||||
'</div>'+
|
||||
'<div class="three columns pull-three">'+
|
||||
'<input id="'+str_disk_tab_id+'radioVolatile" type="radio" name="'+str_disk_tab_id+'" value="volatile"> Volatile Disk '+
|
||||
'<input id="'+str_disk_tab_id+'radioVolatile" type="radio" name="'+str_disk_tab_id+'" value="volatile"> '+tr("Volatile Disk")+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<hr>'+
|
||||
@@ -768,7 +758,7 @@ function generate_disk_tab_content(str_disk_tab_id, str_datatable_id){
|
||||
'<button id="refresh_template_images_table_button_class'+str_disk_tab_id+'" type="button" class="button small radius secondary"><i class="icon-refresh" /></button>' +
|
||||
'</div>' +
|
||||
'<div class="five columns">'+
|
||||
'<input id="'+str_disk_tab_id+'_search" type="text" placeholder="Search"/>'+
|
||||
'<input id="'+str_disk_tab_id+'_search" type="text" placeholder="'+tr("Search")+'"/>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<table id="'+str_datatable_id+'" class="datatable twelve">'+
|
||||
@@ -795,14 +785,14 @@ function generate_disk_tab_content(str_disk_tab_id, str_datatable_id){
|
||||
'<br>'+
|
||||
'<div class="vm_param kvm_opt xen_opt vmware_opt">'+
|
||||
'<span id="select_image" class="radius secondary label">'+tr("Please select an image from the list")+'</span>'+
|
||||
'<span id="image_selected" class="radius secondary label hidden">You selected the following image: '+
|
||||
'<span id="image_selected" class="radius secondary label hidden">'+tr("You selected the following image: ")+
|
||||
'</span>'+
|
||||
'<span class="radius label" type="text" id="IMAGE" name="image"></span>'+
|
||||
'<input type="hidden" id="IMAGE_ID" name="image_id" size="2"/>'+
|
||||
'</div>'+
|
||||
'<hr>'+
|
||||
'<div class="show_hide" id="advanced_image">'+
|
||||
'<h4><small><i class=" icon-plus-sign-alt"/> '+tr("Advanced options")+'<a id="add_os_boot_opts" class="icon_left" href="#"></a></small></h4>'+
|
||||
'<h4><small><i class=" icon-caret-down"/> '+tr("Advanced options")+'<a id="add_os_boot_opts" class="icon_left" href="#"></a></small></h4>'+
|
||||
'</div>'+
|
||||
'<div class="row advanced vm_param">'+
|
||||
'<div class="six columns">'+
|
||||
@@ -866,13 +856,13 @@ function generate_disk_tab_content(str_disk_tab_id, str_datatable_id){
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<div class="row vm_param">'+
|
||||
'<div class="row">'+
|
||||
'<div class="two columns">'+
|
||||
'<label class="inline right" for="SIZE">'+tr("SIZE")+':</label>'+
|
||||
'</div>'+
|
||||
'<div id="size_slider" class="five columns">'+
|
||||
'</div>'+
|
||||
'<div class="two columns">'+
|
||||
'<div class="two columns vm_param">'+
|
||||
'<input type="text" id="SIZE" name="size"/>'+
|
||||
'</div>'+
|
||||
'<div class="two columns">'+
|
||||
@@ -886,7 +876,7 @@ function generate_disk_tab_content(str_disk_tab_id, str_datatable_id){
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<div class="show_hide" id="advanced_volatile">'+
|
||||
'<h4><small><i class=" icon-plus-sign-alt"/> '+tr("Advanced options")+'<a id="add_os_boot_opts" class="icon_left" href="#"></a></small</h4>'+
|
||||
'<h4><small><i class=" icon-caret-down"/> '+tr("Advanced options")+'<a id="add_os_boot_opts" class="icon_left" href="#"></a></small</h4>'+
|
||||
'</div>'+
|
||||
'<div class="row advanced vm_param">'+
|
||||
'<div class="six columns">'+
|
||||
@@ -1140,7 +1130,7 @@ function generate_nic_tab_content(str_nic_tab_id, str_datatable_id){
|
||||
'<button id="refresh_template_nic_table_button_class'+str_nic_tab_id+'" type="button" class="button small radius secondary"><i class="icon-refresh" /></button>' +
|
||||
'</div>' +
|
||||
'<div class="five columns push-seven">'+
|
||||
'<input id="'+str_nic_tab_id+'_search" type="text" placeholder="Search"/>'+
|
||||
'<input id="'+str_nic_tab_id+'_search" type="text" placeholder="'+tr("Search")+'"/>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<table id="'+str_datatable_id+'" class="datatable twelve">'+
|
||||
@@ -1163,14 +1153,14 @@ function generate_nic_tab_content(str_nic_tab_id, str_datatable_id){
|
||||
'<br>'+
|
||||
'<div class="vm_param kvm_opt xen_opt vmware_opt">'+
|
||||
'<span id="select_network" class="radius secondary label">'+tr("Please select an network from the list")+'</span>'+
|
||||
'<span id="network_selected" class="radius secondary label hidden">You selected the following image: '+
|
||||
'<span id="network_selected" class="radius secondary label hidden">'+tr("You selected the following image:")+
|
||||
'</span>'+
|
||||
'<span class="radius label" type="text" id="NETWORK" name="network"></span>'+
|
||||
'<input type="hidden" id="NETWORK_ID" name="network_id" size="2"/>'+
|
||||
'</div>'+
|
||||
'<hr>'+
|
||||
'<div class="show_hide" id="advanced">'+
|
||||
'<h4><small><i class=" icon-plus-sign-alt"/> '+tr("Advanced options")+'<a id="add_os_boot_opts" class="icon_left" href="#"></a></small></h4>'+
|
||||
'<h4><small><i class=" icon-caret-down"/> '+tr("Advanced options")+'<a id="add_os_boot_opts" class="icon_left" href="#"></a></small></h4>'+
|
||||
'</div>'+
|
||||
'<div class="advanced">'+
|
||||
'<div class="row">'+
|
||||
@@ -1179,7 +1169,7 @@ function generate_nic_tab_content(str_nic_tab_id, str_datatable_id){
|
||||
'<div class="four columns">'+
|
||||
'<label class="right inline" for="IP">'+tr("IP")+':</label>'+
|
||||
'</div>'+
|
||||
'<div class="six columns">'+
|
||||
'<div class="six columns vm_param">'+
|
||||
'<input type="text" id="IP" name="IP" size="3" />'+
|
||||
'</div>'+
|
||||
'<div class="two columns">'+
|
||||
@@ -1192,7 +1182,7 @@ function generate_nic_tab_content(str_nic_tab_id, str_datatable_id){
|
||||
'<div class="four columns">'+
|
||||
'<label class="right inline" for="MODEL">'+tr("MODEL")+':</label>'+
|
||||
'</div>'+
|
||||
'<div class="six columns">'+
|
||||
'<div class="six columns vm_param">'+
|
||||
'<input type="text" id="MODEL" name="MODEL" />'+
|
||||
'</div>'+
|
||||
'<div class="two columns">'+
|
||||
@@ -1222,7 +1212,7 @@ function generate_nic_tab_content(str_nic_tab_id, str_datatable_id){
|
||||
'<input type="text" id="TCP_PORTS" name="ports" />'+
|
||||
'</div>'+
|
||||
'<div class="two columns">'+
|
||||
'<div class="tip">'+tr("A list of ports separated by commas or a ranges separated by semilocolons, e.g.: 22,80,5900:6000")+'</div>'+
|
||||
'<div class="tip">'+tr("A list of ports separated by commas or a ranges separated by semicolons, e.g.: 22,80,5900:6000")+'</div>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'</fieldset>'+
|
||||
@@ -1232,10 +1222,10 @@ function generate_nic_tab_content(str_nic_tab_id, str_datatable_id){
|
||||
'<legend>'+tr("UDP Firewall")+'</legend>'+
|
||||
'<div class="row">'+
|
||||
'<div class="four columns push-two">'+
|
||||
'<input type="radio" name="udp_type" id="udp_type" value="WHITE_PORTS_UDP"> Whitelist '+
|
||||
'<input type="radio" name="udp_type" id="udp_type" value="WHITE_PORTS_UDP"> '+tr("Whitelist")+
|
||||
'</div>'+
|
||||
'<div class="four columns pull-two">'+
|
||||
'<input type="radio" name="udp_type" id="udp_type" value="BLACK_PORTS_UDP"> Blacklist'+
|
||||
'<input type="radio" name="udp_type" id="udp_type" value="BLACK_PORTS_UDP"> '+tr("Blacklist")+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<br>'+
|
||||
@@ -1247,7 +1237,7 @@ function generate_nic_tab_content(str_nic_tab_id, str_datatable_id){
|
||||
'<input type="text" id="UDP_PORTS" name="ports" />'+
|
||||
'</div>'+
|
||||
'<div class="two columns">'+
|
||||
'<div class="tip">'+tr("A list of ports separated by commas or a ranges separated by semilocolons, e.g.: 22,80,5900:6000")+'</div>'+
|
||||
'<div class="tip">'+tr("A list of ports separated by commas or a ranges separated by semicolons, e.g.: 22,80,5900:6000")+'</div>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'</fieldset>'+
|
||||
@@ -1255,15 +1245,19 @@ function generate_nic_tab_content(str_nic_tab_id, str_datatable_id){
|
||||
'</div>'+
|
||||
'<div class="row">'+
|
||||
'<div class="six columns">'+
|
||||
'<fieldset>'+
|
||||
'<legend>'+tr("ICMP")+'</legend>'+
|
||||
'<div class="row">'+
|
||||
'<div class="four columns">'+
|
||||
'<div class="one columns">'+
|
||||
'<input type="checkbox" name="icmp_type" value="ICMP" id="icmp_type">'+
|
||||
'</div>'+
|
||||
'<div class="six columns">'+
|
||||
'<label for="icmp_type"><input type="checkbox" name="icmp_type" value="ICMP" id="icmp_type"> '+ tr("Drop ICMP")+'</label>'+
|
||||
'<div class="nine columns">'+
|
||||
'<label for="icmp_type">'+ tr("Drop")+'</label>'+
|
||||
'</div>'+
|
||||
'<div class="two columns">'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'</fieldset>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
@@ -1424,10 +1418,13 @@ function updateTemplateInfo(request,template){
|
||||
};
|
||||
var template_tab = {
|
||||
title: tr("Template"),
|
||||
content: '<table id="template_template_table" class="info_table" style="width:80%">\
|
||||
<thead><tr><th colspan="2">'+tr("Template")+'</th></tr></thead>'+
|
||||
prettyPrintJSON(template_info.TEMPLATE)+
|
||||
'</table>'
|
||||
content: '<div class="">\
|
||||
<div class="eight columns">\
|
||||
<table id="template_template_table" class="transparent_table twelve">'+
|
||||
prettyPrintJSON(template_info.TEMPLATE)+'\
|
||||
</table>\
|
||||
</div>\
|
||||
</div>'
|
||||
};
|
||||
|
||||
$("#div_edit_rename_link").die();
|
||||
@@ -1599,6 +1596,7 @@ function setupCreateTemplateDialog(){
|
||||
if (value.length == 0)
|
||||
remove = true;
|
||||
}
|
||||
|
||||
if (remove)
|
||||
delete obj[elem];
|
||||
}
|
||||
@@ -1669,13 +1667,13 @@ function setupCreateTemplateDialog(){
|
||||
var add_disks_tab = function() {
|
||||
var html_tab_content = '<li id="storageTab" class="wizard_tab">'+
|
||||
'<dl class="tabs" id="template_create_storage_tabs">'+
|
||||
'<dt><button type="button" class="button tiny radius" id="tf_btn_disks"><span class="icon-plus"></span> Add another disk</button></dt>'+
|
||||
'<dt><button type="button" class="button tiny radius" id="tf_btn_disks"><span class="icon-plus"></span>'+tr("Add another disk")+'</button></dt>'+
|
||||
'</dl>'+
|
||||
'<ul class="tabs-content" id="template_create_storage_tabs_content">'+
|
||||
'</ul>'+
|
||||
'</li>';
|
||||
|
||||
$("<dd><a href='#storage'>Storage</a></dd>").appendTo($("dl#template_create_tabs"));
|
||||
$("<dd><a href='#storage'>"+tr("Storage")+"</a></dd>").appendTo($("dl#template_create_tabs"));
|
||||
$(html_tab_content).appendTo($("ul#template_create_tabs_content"));
|
||||
|
||||
|
||||
@@ -1714,7 +1712,7 @@ function setupCreateTemplateDialog(){
|
||||
$(html_tab_content).appendTo($("ul#template_create_storage_tabs_content"));
|
||||
|
||||
var a = $("<dd>\
|
||||
<a id='disk_tab"+str_disk_tab_id+"' href='#"+str_disk_tab_id+"'>DISK <i class='icon-remove-sign remove-tab'></i></a>\
|
||||
<a id='disk_tab"+str_disk_tab_id+"' href='#"+str_disk_tab_id+"'>"+tr("DISK")+" <i class='icon-remove-sign remove-tab'></i></a>\
|
||||
</dd>").appendTo($("dl#template_create_storage_tabs"));
|
||||
|
||||
$(document).foundationTabs("set_tab", a);
|
||||
@@ -1742,13 +1740,13 @@ function setupCreateTemplateDialog(){
|
||||
var add_nics_tab = function() {
|
||||
var html_tab_content = '<li id="networkTab" class="wizard_tab">'+
|
||||
'<dl class="tabs" id="template_create_network_tabs">'+
|
||||
'<dt><button type="button" class="button tiny radius" id="tf_btn_nics"><span class="icon-plus"></span> Add another nic</button></dt>'+
|
||||
'<dt><button type="button" class="button tiny radius" id="tf_btn_nics"><span class="icon-plus"></span> '+tr("Add another nic")+'</button></dt>'+
|
||||
'</dl>'+
|
||||
'<ul class="tabs-content" id="template_create_network_tabs_content">'+
|
||||
'</ul>'+
|
||||
'</li>';
|
||||
|
||||
$("<dd><a href='#network'>Network</a></dd>").appendTo($("dl#template_create_tabs"));
|
||||
$("<dd><a href='#network'>"+tr("Network")+"</a></dd>").appendTo($("dl#template_create_tabs"));
|
||||
$(html_tab_content).appendTo($("ul#template_create_tabs_content"));
|
||||
|
||||
// close icon: removing the tab on click
|
||||
@@ -1784,7 +1782,7 @@ function setupCreateTemplateDialog(){
|
||||
'</li>'
|
||||
|
||||
// Append the new div containing the tab and add the tab to the list
|
||||
var a = $("<dd><a id='nic_tab"+str_nic_tab_id+"' href='#"+str_nic_tab_id+"'>NIC <i class='icon-remove-sign remove-tab'></i></a></dd>").appendTo($("dl#template_create_network_tabs"));
|
||||
var a = $("<dd><a id='nic_tab"+str_nic_tab_id+"' href='#"+str_nic_tab_id+"'>"+tr("NIC")+" <i class='icon-remove-sign remove-tab'></i></a></dd>").appendTo($("dl#template_create_network_tabs"));
|
||||
|
||||
$(html_tab_content).appendTo($("ul#template_create_network_tabs_content"));
|
||||
|
||||
@@ -1891,10 +1889,10 @@ function setupCreateTemplateDialog(){
|
||||
'<li id="kernelTab" class="wizard_internal_tab">'+
|
||||
'<div class="row">'+
|
||||
'<div class="three columns push-three">'+
|
||||
'<input id="radioKernelDs" type="radio" name="kernel_type" value="kernel_ds" checked> Registered Image'+
|
||||
'<input id="radioKernelDs" type="radio" name="kernel_type" value="kernel_ds" checked> '+tr("Registered Image")+
|
||||
'</div>'+
|
||||
'<div class="three columns pull-three">'+
|
||||
'<input id="radioKernelPath" type="radio" name="kernel_type" value="kernel_path"> Remote PATH'+
|
||||
'<input id="radioKernelPath" type="radio" name="kernel_type" value="kernel_path"> '+tr("Remote PATH")+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<hr>'+
|
||||
@@ -1904,7 +1902,7 @@ function setupCreateTemplateDialog(){
|
||||
'<button id="refresh_kernel_table" type="button" class="button small radius secondary"><i class="icon-refresh" /></button>' +
|
||||
'</div>' +
|
||||
'<div class="five columns push-seven">'+
|
||||
'<input id="kernel_search" type="text" placeholder="Search"/>'+
|
||||
'<input id="kernel_search" type="text" placeholder="'+tr("Search")+'"/>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<table id="datatable_kernel" class="datatable twelve">'+
|
||||
@@ -1930,7 +1928,7 @@ function setupCreateTemplateDialog(){
|
||||
'</table>'+
|
||||
'<div id="kernel_ds_inputs" class="vm_param kvm_opt xen_opt vmware_opt">'+
|
||||
'<span id="select_image" class="radius secondary label">'+tr("Please select a Kernel from the list")+'</span>'+
|
||||
'<span id="image_selected" class="radius secondary label hidden">You selected the following Kernel: '+
|
||||
'<span id="image_selected" class="radius secondary label hidden">'+tr("You selected the following Kernel: ")+
|
||||
'</span>'+
|
||||
'<span class="radius label" type="text" id="KERNEL" name="kernel""></span>'+
|
||||
'<input type="hidden" id="KERNEL_DS" name="kernel_ds" s size="2"/>'+
|
||||
@@ -1951,10 +1949,10 @@ function setupCreateTemplateDialog(){
|
||||
'<li id="ramdiskTab" class="wizard_internal_tab">'+
|
||||
'<div class="row">'+
|
||||
'<div class="three columns push-three">'+
|
||||
'<input id="radioInintrdDs" type="radio" name="initrd_type" value="initrd_ds" checked> Registered Image '+
|
||||
'<input id="radioInintrdDs" type="radio" name="initrd_type" value="initrd_ds" checked> '+tr("Registered Image ") +
|
||||
'</div>'+
|
||||
'<div class="three columns pull-three">'+
|
||||
'<input id="radioInitrdPath" type="radio" name="initrd_type" value="initrd_path"> Remote PATH'+
|
||||
'<input id="radioInitrdPath" type="radio" name="initrd_type" value="initrd_path"> '+tr("Remote PATH")+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<hr>'+
|
||||
@@ -1964,7 +1962,7 @@ function setupCreateTemplateDialog(){
|
||||
'<button id="refresh_ramdisk_table" type="button" class="button small radius secondary"><i class="icon-refresh" /></button>' +
|
||||
'</div>' +
|
||||
'<div class="five columns push-seven">'+
|
||||
'<input id="initrd_search" type="text" placeholder="Search"/>'+
|
||||
'<input id="initrd_search" type="text" placeholder="'+tr("Search")+'"/>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<table id="datatable_initrd" class="datatable twelve">'+
|
||||
@@ -1990,7 +1988,7 @@ function setupCreateTemplateDialog(){
|
||||
'</table>'+
|
||||
'<div class="vm_param kvm_opt xen_opt vmware_opt">'+
|
||||
'<span id="select_image" class="radius secondary label">'+tr("Please select a Ramdisk from the list")+'</span>'+
|
||||
'<span id="image_selected" class="radius secondary label hidden">You selected the following Ramdisk: '+
|
||||
'<span id="image_selected" class="radius secondary label hidden">'+tr("You selected the following Ramdisk: ")+
|
||||
'</span>'+
|
||||
'<span class="radius label" type="text" id="INITRD" name="initrd"></span>'+
|
||||
'<input type="hidden"id="INITRD_DS" name="initrd_id" size="2"/>'+
|
||||
@@ -2431,43 +2429,51 @@ function setupCreateTemplateDialog(){
|
||||
'<fieldset>'+
|
||||
'<legend>'+tr("SSH")+'</legend>'+
|
||||
'<div class="row">'+
|
||||
'<div class="columns eight centered">'+
|
||||
'<label for="ssh_context"><input type="checkbox" name="ssh_context" id="ssh_context"> '+ tr(" Add SSH contextualization")+'</label>'+
|
||||
'<div class="columns one">'+
|
||||
'<input type="checkbox" name="ssh_context" id="ssh_context" checked>'+
|
||||
'</div>'+
|
||||
'<div class="columns ten">'+
|
||||
'<label class="inline" for="ssh_context">'+ tr(" Add SSH contextualization")+'</label>'+
|
||||
'</div>'+
|
||||
'<div class="columns one">'+
|
||||
'<div class="tip">'+tr("Add an ssh public key to the context. If the Public Key textarea is empty then the user variable SSH_PUBLIC_KEY will be used.")+'</div>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<br>'+
|
||||
'<div class="row">'+
|
||||
'<div class="four columns">'+
|
||||
'<label class="right inline" for="ssh_puclic_key"> '+tr("Public Key")+':</label>'+
|
||||
'</div>'+
|
||||
'<div class="six columns">'+
|
||||
'<input type="text" id="ssh_puclic_key" name="ssh_puclic_key" />'+
|
||||
'</div>'+
|
||||
'<div class="two columns">'+
|
||||
'<div class="ten columns">'+
|
||||
'<label for="ssh_puclic_key"> '+tr("Public Key")+':</label>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<div class="row">'+
|
||||
'<textarea rows="4" type="text" id="ssh_puclic_key" name="ssh_puclic_key" />'+
|
||||
'</div>'+
|
||||
'</fieldset>'+
|
||||
'</div>'+
|
||||
'<div class="six columns">'+
|
||||
'<fieldset>'+
|
||||
'<legend>'+tr("Network")+'</legend>'+
|
||||
'<div class="row">'+
|
||||
'<div class="columns nine centered">'+
|
||||
'<label for="network_context"><input type="checkbox" name="network_context" id="network_context">'+ tr(" Add Network contextualization")+'</label>'+
|
||||
'<div class="row">'+
|
||||
'<div class="columns one">'+
|
||||
'<input type="checkbox" name="network_context" id="network_context" checked>'+
|
||||
'</div>'+
|
||||
'<div class="columns ten">'+
|
||||
'<label class="inline" for="network_context">'+ tr(" Add Network contextualization")+'</label>'+
|
||||
'</div>'+
|
||||
'<div class="columns one">'+
|
||||
'<div class="tip">'+tr("Add network contextualization parameters. For each NIC defined in the NETWORK section, ETH%i_IP, ETH%i_NETWORK... parameters will be included in the CONTEXT section and will be available in the Virtual Machine")+'</div>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<br>'+
|
||||
'</fieldset>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'</li>'+
|
||||
'<li class="wizard_internal_tab vm_param" id="filesTab">'+
|
||||
'<li class="wizard_internal_tab" id="filesTab">'+
|
||||
'<div class="row collapse ">'+
|
||||
'<div class="seven columns">' +
|
||||
'<button id="refresh_context_table" type="button" class="button small radius secondary"><i class="icon-refresh" /></button>' +
|
||||
'</div>' +
|
||||
'<div class="five columns push-seven">'+
|
||||
'<input id="files_search" type="text" placeholder="Search"/>'+
|
||||
'<input id="files_search" type="text" placeholder="'+tr("Search")+'"/>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<table id="datatable_context" class="datatable twelve">'+
|
||||
@@ -2493,7 +2499,7 @@ function setupCreateTemplateDialog(){
|
||||
'</table>'+
|
||||
'<div class="vm_param kvm_opt xen_opt vmware_opt row" id="selected_files_spans">'+
|
||||
'<span id="select_files" class="radius secondary label">'+tr("Please select files from the list")+'</span> '+
|
||||
'<span id="files_selected" class="radius secondary label hidden">You selected the following files:</span> '+
|
||||
'<span id="files_selected" class="radius secondary label hidden">'+tr("You selected the following files:")+'</span> '+
|
||||
'<input type="hidden" id="FILES_DS" name="files_ds" size="2"/>'+
|
||||
'</div>'+
|
||||
'</li>'+
|
||||
@@ -2727,10 +2733,10 @@ function setupCreateTemplateDialog(){
|
||||
'<li class="requirements wizard_internal_tab active" id="placementTab">'+
|
||||
'<div class="row">'+
|
||||
'<div class="three columns push-three">'+
|
||||
'<input type="radio" id="hosts_req" name="req_select" value="host_select" checked> Select Hosts '+
|
||||
'<input type="radio" id="hosts_req" name="req_select" value="host_select" checked> '+tr("Select Hosts ")+
|
||||
'</div>'+
|
||||
'<div class="three columns pull-three">'+
|
||||
'<input type="radio" id="clusters_req" name="req_select" value="cluster_select"> Select Clusters '+
|
||||
'<input type="radio" id="clusters_req" name="req_select" value="cluster_select"> '+tr("Select Clusters ")+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<hr>'+
|
||||
@@ -2740,7 +2746,7 @@ function setupCreateTemplateDialog(){
|
||||
'<button id="refresh_hosts_placement" type="button" class="button small radius secondary"><i class="icon-refresh" /></button>' +
|
||||
'</div>' +
|
||||
'<div class="five columns push-seven">'+
|
||||
'<input id="hosts_search" type="text" placeholder="Search"/>'+
|
||||
'<input id="hosts_search" type="text" placeholder="'+tr("Search")+'"/>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<table id="datatable_template_hosts" class="datatable twelve">'+
|
||||
@@ -2767,7 +2773,7 @@ function setupCreateTemplateDialog(){
|
||||
'<br>'+
|
||||
'<div class="kvm_opt xen_opt vmware_opt" id="selected_hosts_template">'+
|
||||
'<span id="select_hosts" class="radius secondary label">'+tr("Please select one or more hosts from the list")+'</span> '+
|
||||
'<span id="hosts_selected" class="radius secondary label hidden">You selected the following hosts:</span> '+
|
||||
'<span id="hosts_selected" class="radius secondary label hidden">'+tr("You selected the following hosts:")+'</span> '+
|
||||
'</div>'+
|
||||
'<br>'+
|
||||
'</div>'+
|
||||
@@ -2777,7 +2783,7 @@ function setupCreateTemplateDialog(){
|
||||
'<button id="refresh_clusters_placement" type="button" class="button small radius secondary"><i class="icon-refresh" /></button>' +
|
||||
'</div>' +
|
||||
'<div class="five columns push-seven">'+
|
||||
'<input id="clusters_search" type="text" placeholder="Search"/>'+
|
||||
'<input id="clusters_search" type="text" placeholder="'+tr("Search")+'"/>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<table id="datatable_template_clusters" class="datatable twelve">'+
|
||||
@@ -2797,7 +2803,7 @@ function setupCreateTemplateDialog(){
|
||||
'<br>'+
|
||||
'<div class="kvm_opt xen_opt vmware_opt" id="selected_clusters_template">'+
|
||||
'<span id="select_clusters" class="radius secondary label">'+tr("Please select one or more clusters from the list")+'</span> '+
|
||||
'<span id="clusters_selected" class="radius secondary label hidden">You selected the following clusters:</span> '+
|
||||
'<span id="clusters_selected" class="radius secondary label hidden">'+tr("You selected the following clusters:")+'</span> '+
|
||||
'</div>'+
|
||||
'<br>'+
|
||||
'</div>'+
|
||||
@@ -2817,19 +2823,19 @@ function setupCreateTemplateDialog(){
|
||||
'<li id="policyTab" class="wizard_internal_tab">'+
|
||||
'<div class="row">'+
|
||||
'<div class="two columns push-two">'+
|
||||
'<input type="radio" id="packingRadio" name="rank_select" value="RUNNING_VMS"> Packing '+
|
||||
'<input type="radio" id="packingRadio" name="rank_select" value="RUNNING_VMS"> '+tr("Packing")+
|
||||
'</div>'+
|
||||
'<div class="one columns push-two">'+
|
||||
'<div class="tip">'+tr("Pack the VMs in the cluster nodes to reduce VM fragmentation")+'</div>'+
|
||||
'</div>'+
|
||||
'<div class="two columns push-two">'+
|
||||
'<input type="radio" id="stripingRadio" name="rank_select" value="-RUNNING_VMS"> Stripping '+
|
||||
'<input type="radio" id="stripingRadio" name="rank_select" value="-RUNNING_VMS"> '+tr("Stripping")+
|
||||
'</div>'+
|
||||
'<div class="one columns push-two">'+
|
||||
'<div class="tip">'+tr("Spread the VMs in the cluster nodes")+'</div>'+
|
||||
'</div>'+
|
||||
'<div class="two columns push-two">'+
|
||||
'<input type="radio" id="loadawareRadio" name="rank_select" value="FREECPU"> Load-aware'+
|
||||
'<input type="radio" id="loadawareRadio" name="rank_select" value="FREECPU"> '+tr("Load-aware")+
|
||||
'</div>'+
|
||||
'<div class="two columns">'+
|
||||
'<div class="tip">'+tr("Maximize the resources available to VMs in a node")+'</div>'+
|
||||
@@ -3161,7 +3167,7 @@ function setupCreateTemplateDialog(){
|
||||
// width: 'auto',
|
||||
// height: height
|
||||
//});
|
||||
dialog.addClass("reveal-modal xlarge")
|
||||
dialog.addClass("reveal-modal xlarge max-height")
|
||||
|
||||
|
||||
var tabs = $( "#template_create_tabs", dialog)//.tabs().addClass("ui-tabs-vertical");
|
||||
@@ -3177,11 +3183,32 @@ function setupCreateTemplateDialog(){
|
||||
// tabs.tabs("option", "active", selected-1);
|
||||
//});
|
||||
|
||||
|
||||
$('#template_template_reset_button').click(function(){
|
||||
$create_template_dialog.trigger("reveal:close")
|
||||
$create_template_dialog.empty();
|
||||
setupCreateTemplateDialog();
|
||||
$create_template_dialog.reveal();
|
||||
|
||||
$('button#create_template_form_easy', $create_template_dialog).show();
|
||||
$('button#template_template_update_button', $create_template_dialog).hide();
|
||||
$('button#template_template_reset_button', $create_template_dialog).show();
|
||||
$('button#template_template_reset_button_update', $create_template_dialog).hide();
|
||||
|
||||
$('#create_template_header', $create_template_dialog).show();
|
||||
$('#update_template_header', $create_template_dialog).hide();
|
||||
|
||||
});
|
||||
|
||||
$('#template_template_reset_button_update').click(function(){
|
||||
$create_template_dialog.empty();
|
||||
setupCreateTemplateDialog();
|
||||
|
||||
$('button#create_template_form_easy', $create_template_dialog).hide();
|
||||
$('button#template_template_update_button', $create_template_dialog).show();
|
||||
$('button#template_template_reset_button', $create_template_dialog).hide();
|
||||
$('button#template_template_reset_button_update', $create_template_dialog).show();
|
||||
|
||||
$('#create_template_header', $create_template_dialog).hide();
|
||||
$('#update_template_header', $create_template_dialog).show();
|
||||
});
|
||||
|
||||
add_capacityTab();
|
||||
@@ -3225,7 +3252,6 @@ function setupCreateTemplateDialog(){
|
||||
var build_template = function(){
|
||||
var vm_json = {};
|
||||
var name,value,boot_method;
|
||||
|
||||
//
|
||||
// CAPACITY
|
||||
//
|
||||
@@ -3236,7 +3262,6 @@ function setupCreateTemplateDialog(){
|
||||
// return false;
|
||||
// };
|
||||
addSectionJSON(vm_json,$('li#capacityTab',dialog));
|
||||
|
||||
//
|
||||
// OS
|
||||
//
|
||||
@@ -3398,18 +3423,23 @@ function setupCreateTemplateDialog(){
|
||||
});
|
||||
|
||||
//Reset form - empty boxes
|
||||
$('button#reset_vm_form',dialog).click(function(){
|
||||
$('select#disks_box option',section_disks).remove();
|
||||
$('select#nics_box option',section_networks).remove();
|
||||
$('select#inputs_box option',section_inputs).remove();
|
||||
$('select#custom_var_box option',section_custom_var).remove();
|
||||
return true;
|
||||
});
|
||||
//$('button#reset_vm_form',dialog).click(function(){
|
||||
// $('select#disks_box option',section_disks).remove();
|
||||
// $('select#nics_box option',section_networks).remove();
|
||||
// $('select#inputs_box option',section_inputs).remove();
|
||||
// $('select#custom_var_box option',section_custom_var).remove();
|
||||
// return true;
|
||||
//});
|
||||
}
|
||||
|
||||
function popUpUpdateTemplateDialog(){
|
||||
$('button#create_template_form_easy', $create_template_dialog).hide();
|
||||
$('button#template_template_update_button', $create_template_dialog).show();
|
||||
$('button#template_template_reset_button', $create_template_dialog).hide();
|
||||
$('button#template_template_reset_button_update', $create_template_dialog).show();
|
||||
|
||||
$('#create_template_header', $create_template_dialog).hide();
|
||||
$('#update_template_header', $create_template_dialog).show();
|
||||
|
||||
$create_template_dialog.reveal();
|
||||
};
|
||||
@@ -3417,6 +3447,11 @@ function popUpUpdateTemplateDialog(){
|
||||
function popUpCreateTemplateDialog(){
|
||||
$('button#create_template_form_easy', $create_template_dialog).show();
|
||||
$('button#template_template_update_button', $create_template_dialog).hide();
|
||||
$('button#template_template_reset_button', $create_template_dialog).show();
|
||||
$('button#template_template_reset_button_update', $create_template_dialog).hide();
|
||||
|
||||
$('#create_template_header', $create_template_dialog).show();
|
||||
$('#update_template_header', $create_template_dialog).hide();
|
||||
|
||||
$create_template_dialog.reveal();
|
||||
};
|
||||
@@ -4288,12 +4323,9 @@ $(document).ready(function(){
|
||||
"oColVis": {
|
||||
"aiExclude": [ 0 ]
|
||||
},
|
||||
"sDom" : "<'H'>t<'row'<'six columns'i><'six columns'p>>",
|
||||
"aoColumnDefs": [
|
||||
{ "bSortable": false, "aTargets": ["check"] },
|
||||
{ "sWidth": "35px", "aTargets": [0,1] },
|
||||
{ "sWidth": "150px", "aTargets": [5] },
|
||||
{ "sWidth": "100px", "aTargets": [2,3] }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ var users_tab_content = '\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="three columns">\
|
||||
<input id="user_search" type="text" placeholder="Search" />\
|
||||
<input id="user_search" type="text" placeholder="'+tr("Search")+'" />\
|
||||
</div>\
|
||||
<br>\
|
||||
<br>\
|
||||
@@ -211,7 +211,7 @@ var user_quotas_tmpl = '<div class="panel">\
|
||||
<label class="inline right" >'+tr("Max VMs")+':</label>\
|
||||
</div>\
|
||||
<div class="seven columns">\
|
||||
<input type="text" name="VMS"></input><br />\
|
||||
<input type="text" name="VMS"></input>\
|
||||
</div>\
|
||||
<div class="one columns">\
|
||||
<div class=""></div>\
|
||||
@@ -222,7 +222,7 @@ var user_quotas_tmpl = '<div class="panel">\
|
||||
<label class="inline right" >'+tr("Max Memory (MB)")+':</label>\
|
||||
</div>\
|
||||
<div class="seven columns">\
|
||||
<input type="text" name="MEMORY"></input><br />\
|
||||
<input type="text" name="MEMORY"></input>\
|
||||
</div>\
|
||||
<div class="one columns">\
|
||||
<div class=""></div>\
|
||||
@@ -246,7 +246,7 @@ var user_quotas_tmpl = '<div class="panel">\
|
||||
<label class="inline right" >'+tr("Datastore")+'</label>\
|
||||
</div>\
|
||||
<div class="seven columns">\
|
||||
<select name="ID"></select><br />\
|
||||
<select name="ID"></select>\
|
||||
</div>\
|
||||
<div class="one columns">\
|
||||
<div class=""></div>\
|
||||
@@ -257,7 +257,7 @@ var user_quotas_tmpl = '<div class="panel">\
|
||||
<label class="inline right" >'+tr("Max size (MB)")+':</label>\
|
||||
</div>\
|
||||
<div class="seven columns">\
|
||||
<input type="text" name="SIZE"></input><br />\
|
||||
<input type="text" name="SIZE"></input>\
|
||||
</div>\
|
||||
<div class="one columns">\
|
||||
<div class=""></div>\
|
||||
@@ -281,7 +281,7 @@ var user_quotas_tmpl = '<div class="panel">\
|
||||
<label class="inline right" >'+tr("Image")+'</label>\
|
||||
</div>\
|
||||
<div class="seven columns">\
|
||||
<select name="ID"></select><br />\
|
||||
<select name="ID"></select>\
|
||||
</div>\
|
||||
<div class="one columns">\
|
||||
<div class=""></div>\
|
||||
@@ -305,7 +305,7 @@ var user_quotas_tmpl = '<div class="panel">\
|
||||
<label class="inline right" >'+tr("Network")+'</label>\
|
||||
</div>\
|
||||
<div class="seven columns">\
|
||||
<select name="ID"></select><br />\
|
||||
<select name="ID"></select>\
|
||||
</div>\
|
||||
<div class="one columns">\
|
||||
<div class=""></div>\
|
||||
@@ -339,14 +339,16 @@ var user_quotas_tmpl = '<div class="panel">\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="reveal-footer">\
|
||||
<hr>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button radius right success" id="create_user_submit" type="submit" value="User.set_quota">'+tr("Apply changes")+'</button>\
|
||||
<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
|
||||
</div>\
|
||||
</div>\
|
||||
<a class="close-reveal-modal">×</a>\
|
||||
</form>';
|
||||
</form>\
|
||||
</div>';
|
||||
|
||||
|
||||
var user_actions = {
|
||||
@@ -1166,7 +1168,6 @@ function setUserAutorefresh(){
|
||||
$(document).ready(function(){
|
||||
//if we are not oneadmin, our tab will not even be in the DOM.
|
||||
dataTable_users = $("#datatable_users",main_tabs_context).dataTable({
|
||||
"sDom" : "<'H'>t<'row'<'six columns'i><'six columns'p>>",
|
||||
"oColVis": {
|
||||
"aiExclude": [ 0 ]
|
||||
},
|
||||
@@ -1174,11 +1175,7 @@ $(document).ready(function(){
|
||||
{ "bSortable": false, "aTargets": ["check"] },
|
||||
{ "sWidth": "35px", "aTargets": [0,1] },
|
||||
{ "bVisible": false, "aTargets": [8]}
|
||||
],
|
||||
"oLanguage": (datatable_lang != "") ?
|
||||
{
|
||||
sUrl: "locale/"+lang+"/"+datatable_lang
|
||||
} : ""
|
||||
]
|
||||
});
|
||||
|
||||
$('#user_search').keyup(function(){
|
||||
|
||||
@@ -24,7 +24,7 @@ function loadVNC(){
|
||||
}
|
||||
loadVNC();
|
||||
|
||||
var VNCstates=["RUNNING","SHUTDOWN","SHUTDOWN_POWEROFF","UNKNOWN","HOTPLUG","CANCEL","MIGRATE", "HOTPLUG_SNAPSHOT", "HOTPLUG_NIC", "HOTPLUG_SAVEAS", "HOTPLUG_SAVEAS_POWEROFF", "HOTPLUG_SAVEAS_SUSPENDED"];
|
||||
var VNCstates=["RUNNING","SHUTDOWN","SHUTDOWN_POWEROFF","UNKNOWN","HOTPLUG","CANCEL","MIGRATE", "HOTPLUG_SNAPSHOT", "HOTPLUG_NIC", "HOTPLUG_SAVEAS", "HOTPLUG_SAVEAS_POWEROFF", "HOTPLUG_SAVEAS_SUSPENDED", "SHUTDOWN_UNDEPLOY"];
|
||||
|
||||
//Permanent storage for last value of aggregated network usage
|
||||
//Used to calculate bandwidth
|
||||
@@ -61,7 +61,7 @@ var vms_tab_content = '\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="three columns">\
|
||||
<input id="vms_search" type="text" placeholder="Search" />\
|
||||
<input id="vms_search" type="text" placeholder="'+tr("Search")+'" />\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
@@ -371,6 +371,33 @@ var vm_actions = {
|
||||
notify: true
|
||||
},
|
||||
|
||||
"VM.poweroff_hard" : {
|
||||
type: "multiple",
|
||||
call: OpenNebula.VM.poweroff_hard,
|
||||
callback: vmShow,
|
||||
elements: vmElements,
|
||||
error: onError,
|
||||
notify: true
|
||||
},
|
||||
|
||||
"VM.undeploy" : {
|
||||
type: "multiple",
|
||||
call: OpenNebula.VM.undeploy,
|
||||
callback: vmShow,
|
||||
elements: vmElements,
|
||||
error: onError,
|
||||
notify: true
|
||||
},
|
||||
|
||||
"VM.undeploy_hard" : {
|
||||
type: "multiple",
|
||||
call: OpenNebula.VM.undeploy_hard,
|
||||
callback: vmShow,
|
||||
elements: vmElements,
|
||||
error: onError,
|
||||
notify: true
|
||||
},
|
||||
|
||||
"VM.saveas" : {
|
||||
type: "single",
|
||||
call: OpenNebula.VM.saveas,
|
||||
@@ -754,45 +781,63 @@ var vm_buttons = {
|
||||
"VM.suspend" : {
|
||||
type: "confirm",
|
||||
text: tr("Suspend"),
|
||||
layout: "vmsstopresume_buttons",
|
||||
layout: "vmspause_buttons",
|
||||
tip: tr("This will suspend selected machines")
|
||||
},
|
||||
"VM.resume" : {
|
||||
type: "confirm",
|
||||
text: tr("Resume"),
|
||||
layout: "vmsstopresume_buttons",
|
||||
text: '<i class="icon-play"/>',
|
||||
layout: "vmsplay_buttons",
|
||||
tip: tr("This will resume selected stopped or suspended VMs")
|
||||
},
|
||||
"VM.stop" : {
|
||||
type: "confirm",
|
||||
text: tr("Stop"),
|
||||
layout: "vmsstopresume_buttons",
|
||||
layout: "vmsstop_buttons",
|
||||
tip: tr("This will stop selected VMs")
|
||||
},
|
||||
"VM.restart" : {
|
||||
type: "confirm",
|
||||
text: tr("Boot"),
|
||||
layout: "vmsoneoff_buttons",
|
||||
layout: "vmsplanification_buttons",
|
||||
tip: tr("This will redeploy selected VMs (in UNKNOWN or BOOT state)")
|
||||
},
|
||||
"VM.reboot" : {
|
||||
type : "confirm",
|
||||
text: tr("Reboot"),
|
||||
layout: "vmsoneoff_buttons",
|
||||
layout: "vmsrepeat_buttons",
|
||||
tip: tr("This will send a reboot action to running VMs")
|
||||
},
|
||||
"VM.reset" : {
|
||||
type: "confirm",
|
||||
text: tr("Reboot") + ' <span class="label secondary radius">hard</span>',
|
||||
layout: "vmsoneoff_buttons",
|
||||
layout: "vmsrepeat_buttons",
|
||||
tip: tr("This will perform a hard reboot on selected VMs")
|
||||
},
|
||||
"VM.poweroff" : {
|
||||
type : "confirm",
|
||||
text: tr("Power Off"),
|
||||
layout: "vmsoneoff_buttons",
|
||||
layout: "vmspause_buttons",
|
||||
tip: tr("This will send a power off signal to running VMs. They can be restarted later.")
|
||||
},
|
||||
"VM.poweroff_hard" : {
|
||||
type : "confirm",
|
||||
text: tr("Power Off") + ' <span class="label secondary radius">hard</span>',
|
||||
layout: "vmspause_buttons",
|
||||
tip: tr("This will send a power off signal to running VMs. They can be restarted later.")
|
||||
},
|
||||
"VM.undeploy" : {
|
||||
type : "confirm",
|
||||
text: tr("Undeploy"),
|
||||
layout: "vmsstop_buttons",
|
||||
tip: tr("Shuts down the given VM. The VM is saved in the system Datastore.")
|
||||
},
|
||||
"VM.undeploy_hard" : {
|
||||
type : "confirm",
|
||||
text: tr("Undeploy") + ' <span class="label secondary radius">hard</span>',
|
||||
layout: "vmsstop_buttons",
|
||||
tip: tr("Shuts down the given VM. The VM is saved in the system Datastore.")
|
||||
},
|
||||
"VM.shutdown" : {
|
||||
type: "confirm",
|
||||
text: tr("Shutdown"),
|
||||
@@ -815,7 +860,7 @@ var vm_buttons = {
|
||||
"VM.resubmit" : {
|
||||
type: "confirm",
|
||||
text: tr("Destroy") + ' <span class="label secondary radius">recreate</span>',
|
||||
layout: "vmsdelete_buttons",
|
||||
layout: "vmsrepeat_buttons",
|
||||
tip: tr("This will resubmits VMs to PENDING state")
|
||||
},
|
||||
|
||||
@@ -1138,6 +1183,7 @@ function generatePlacementTable(vm){
|
||||
<tr>\
|
||||
<th>'+tr("#")+'</th>\
|
||||
<th>'+tr("Host")+'</th>\
|
||||
<th>'+tr("Action")+'</th>\
|
||||
<th>'+tr("Reason")+'</th>\
|
||||
<th>'+tr("Chg time")+'</th>\
|
||||
<th>'+tr("Total time")+'</th>\
|
||||
@@ -1180,9 +1226,10 @@ function generatePlacementTable(vm){
|
||||
|
||||
|
||||
html += ' <tr>\
|
||||
<td style="width:20%">'+history[i].SEQ+'</td>\
|
||||
<td style="width:5%">'+history[i].SEQ+'</td>\
|
||||
<td style="width:20%">'+history[i].HOSTNAME+'</td>\
|
||||
<td style="width:16%">'+OpenNebula.Helper.resource_state("VM_MIGRATE_REASON",parseInt(history[i].REASON, 10))+'</td>\
|
||||
<td style="width:16%">'+OpenNebula.Helper.resource_state("VM_MIGRATE_ACTION",parseInt(history[i].ACTION, 10))+'</td>\
|
||||
<td style="width:10%">'+OpenNebula.Helper.resource_state("VM_MIGRATE_REASON",parseInt(history[i].REASON, 10))+'</td>\
|
||||
<td style="width:16%">'+pretty_time(history[i].STIME)+'</td>\
|
||||
<td style="width:16%">'+pretty_time_runtime(dtime)+'</td>\
|
||||
<td style="width:16%">'+pretty_time_runtime(dtime2)+'</td>\
|
||||
@@ -1272,33 +1319,6 @@ function updateVMInfo(request,vm){
|
||||
</tr>\
|
||||
</tbody>\
|
||||
</table>\
|
||||
<table id="vm_monitoring_table" class="twelve datatable extended_table">\
|
||||
<thead>\
|
||||
<tr><th colspan="2">'+tr("Monitoring information")+'</th></tr>\
|
||||
</thead>\
|
||||
<tbody>\
|
||||
<tr>\
|
||||
<td class="key_td">'+tr("Net_TX")+'</td>\
|
||||
<td class="value_td">'+vm_info.NET_TX+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">'+tr("Net_RX")+'</td>\
|
||||
<td class="value_td">'+vm_info.NET_RX+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">'+tr("Used Memory")+'</td>\
|
||||
<td class="value_td">'+humanize_size(vm_info.MEMORY)+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">'+tr("Used CPU")+'</td>\
|
||||
<td class="value_td">'+vm_info.CPU+'</td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td class="key_td">'+tr("VNC Session")+'</td>\
|
||||
<td class="value_td">'+vncIcon(vm_info)+'</td>\
|
||||
</tr>\
|
||||
</tbody>\
|
||||
</table>\
|
||||
</div>\
|
||||
<div class="six columns">' +
|
||||
insert_permissions_table("VM",
|
||||
@@ -1340,8 +1360,7 @@ function updateVMInfo(request,vm){
|
||||
var template_tab = {
|
||||
title: tr("Template"),
|
||||
content:
|
||||
'<table id="vm_template_table" class="info_table" style="width:80%">\
|
||||
<thead><tr><th colspan="2">'+tr("VM template")+'</th></tr></thead>'+
|
||||
'<table id="vm_template_table" class="info_table transparent_table" style="width:80%">'+
|
||||
prettyPrintJSON(vm_info.TEMPLATE)+
|
||||
'</table>'
|
||||
};
|
||||
@@ -1486,6 +1505,9 @@ function printActionsTable(vm_info)
|
||||
<option value="reboot">' + tr("reboot") + '</option>\
|
||||
<option value="reboot-hard">' + tr("reboot-hard") + '</option>\
|
||||
<option value="poweroff">' + tr("poweroff") + '</option>\
|
||||
<option value="poweroff-hard">' + tr("poweroff-hard") + '</option>\
|
||||
<option value="undeploy">' + tr("undeploy") + '</option>\
|
||||
<option value="undeploy-hard">' + tr("undeploy-hard") + '</option>\
|
||||
<option value="snapshot-create">' + tr("snapshot-create") + '</option>\
|
||||
</select>\
|
||||
</td>\
|
||||
@@ -1820,8 +1842,8 @@ function printDisks(vm_info){
|
||||
( //
|
||||
disk.SAVE_AS_ACTIVE == "YES")
|
||||
) {
|
||||
save_as = "in progress";
|
||||
actions = 'deferred snapshot in progress'
|
||||
save_as = tr("in progress");
|
||||
actions = tr('deferred snapshot in progress');
|
||||
}
|
||||
// Snapshot Hot
|
||||
else if (
|
||||
@@ -1833,7 +1855,7 @@ function printDisks(vm_info){
|
||||
disk.HOTPLUG_SAVE_AS_ACTIVE == "YES")
|
||||
) {
|
||||
save_as = (disk.SAVE_AS ? disk.SAVE_AS : '-');
|
||||
actions = 'hot snapshot in progress'
|
||||
actions = tr('hot snapshot in progress');
|
||||
}
|
||||
// Attach / Detach
|
||||
else if (
|
||||
@@ -1845,7 +1867,7 @@ function printDisks(vm_info){
|
||||
disk.ATTACH = "YES")
|
||||
) {
|
||||
save_as = (disk.SAVE_AS ? disk.SAVE_AS : '-');
|
||||
actions = 'attach/detach in progress'
|
||||
actions = tr('attach/detach in progress');
|
||||
}
|
||||
else {
|
||||
save_as = (disk.SAVE_AS ? disk.SAVE_AS : '-');
|
||||
@@ -1937,9 +1959,9 @@ function setupSaveAsDialog(){
|
||||
</select>\
|
||||
</div>\
|
||||
<div class="one columns">\
|
||||
<div class="tip">Sets the specified VM disk to be saved in a new Image.<br><br>\
|
||||
Deferred: The Image is created immediately, but the contents are saved only if the VM is shut down gracefully (i.e., using Shutdown or Cancel; not Delete)<br><br>\
|
||||
Life: The Image will be saved immediately.</div>\
|
||||
<div class="tip">'+tr("Sets the specified VM disk to be saved in a new Image.")+'<br><br>\
|
||||
'+tr("Deferred: The Image is created immediately, but the contents are saved only if the VM is shut down gracefully (i.e., using Shutdown or Cancel; not Delete)")+'<br><br>\
|
||||
'+tr("Hot: The Image will be saved immediately.")+'</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
<hr>\
|
||||
@@ -1959,7 +1981,7 @@ function setupSaveAsDialog(){
|
||||
var snapshot_type = $('#snapshot_type', this).val();
|
||||
|
||||
if (!image_name.length){
|
||||
notifyError('Please provide a name for the new image');
|
||||
notifyError(tr('Please provide a name for the new image'));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1996,6 +2018,7 @@ function setupAttachDiskDialog(){
|
||||
<small id="">'+tr("Attach new disk")+'</small>\
|
||||
</h3>\
|
||||
</div>\
|
||||
<div class="reveal-body">\
|
||||
<form id="attach_disk_form" action="">\
|
||||
<div class="row centered">\
|
||||
<div class="four columns">\
|
||||
@@ -2009,15 +2032,17 @@ function setupAttachDiskDialog(){
|
||||
</div>\
|
||||
</div>' +
|
||||
generate_disk_tab_content("attach_disk", "attach_disk") +
|
||||
'<hr>\
|
||||
'<div class="reveal-footer">\
|
||||
<hr>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button radius right success" id="attach_disk_button" type="submit" value="VM.attachdisk">'+tr("Attach")+'</button>\
|
||||
<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
|
||||
</div>\
|
||||
</div>\
|
||||
<a class="close-reveal-modal">×</a>\
|
||||
</form>')
|
||||
</form></div>')
|
||||
|
||||
dialog.addClass("reveal-modal large");
|
||||
dialog.addClass("reveal-modal large max-height");
|
||||
setupTips(dialog);
|
||||
|
||||
setup_disk_tab_content(dialog, "attach_disk", "attach_disk")
|
||||
@@ -2257,6 +2282,7 @@ function setupAttachNicDialog(){
|
||||
<small id="">'+tr("Attach new nic")+'</small>\
|
||||
</h3>\
|
||||
</div>\
|
||||
<div class="reveal-body">\
|
||||
<form id="attach_nic_form" action="">\
|
||||
<div class="row centered">\
|
||||
<div class="four columns">\
|
||||
@@ -2270,15 +2296,17 @@ function setupAttachNicDialog(){
|
||||
</div>\
|
||||
</div>' +
|
||||
generate_nic_tab_content("attach_nic", "attach_nic") +
|
||||
'<hr>\
|
||||
'<div class="reveal-footer">\
|
||||
<hr>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button radius right success" id="attach_nic_button" type="submit" value="VM.attachnic">'+tr("Attach")+'</button>\
|
||||
<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
|
||||
</div>\
|
||||
</div>\
|
||||
<a class="close-reveal-modal">×</a>\
|
||||
</form>')
|
||||
</form></div>')
|
||||
|
||||
dialog.addClass("reveal-modal large");
|
||||
dialog.addClass("reveal-modal large max-height");
|
||||
setupTips(dialog);
|
||||
|
||||
setup_nic_tab_content(dialog, "attach_nic", "attach_nic")
|
||||
@@ -2428,6 +2456,7 @@ function setupResizeCapacityDialog(){
|
||||
<small id="">'+tr("Resize VM capacity")+'</small>\
|
||||
</h3>\
|
||||
</div>\
|
||||
<div class="reveal-body">\
|
||||
<form id="resize_capacity_form" action="">\
|
||||
<div class="row centered">\
|
||||
<div class="eight columns">\
|
||||
@@ -2455,15 +2484,17 @@ function setupResizeCapacityDialog(){
|
||||
</div>\
|
||||
</div>' +
|
||||
generate_capacity_tab_content() +
|
||||
'<hr>\
|
||||
'<div class="reveal-footer">\
|
||||
<hr>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button radius right success" id="resize_capacity_button" type="submit" value="VM.resize">'+tr("Resize")+'</button>\
|
||||
<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
|
||||
</div>\
|
||||
</div>\
|
||||
<a class="close-reveal-modal">×</a>\
|
||||
</form>')
|
||||
</form></div>')
|
||||
|
||||
dialog.addClass("reveal-modal large");
|
||||
dialog.addClass("reveal-modal large max-height");
|
||||
setupTips(dialog);
|
||||
|
||||
$("#template_name_form", dialog).hide();
|
||||
@@ -2620,17 +2651,17 @@ function printSnapshots(vm_info){
|
||||
return html;
|
||||
}
|
||||
|
||||
function setupSaveAsDialog(){
|
||||
dialogs_context.append('<div id="save_as_dialog"></div>');
|
||||
$save_as_dialog = $('#save_as_dialog',dialogs_context);
|
||||
var dialog = $save_as_dialog;
|
||||
function setupSnapshotDialog(){
|
||||
dialogs_context.append('<div id="snapshot_dialog"></div>');
|
||||
$snapshot_dialog = $('#snapshot_dialog',dialogs_context);
|
||||
var dialog = $snapshot_dialog;
|
||||
|
||||
dialog.html('<div class="panel">\
|
||||
<h3>\
|
||||
<small id="">'+tr("Snapshot")+'</small>\
|
||||
</h3>\
|
||||
</div>\
|
||||
<form id="save_as_form" action="">\
|
||||
<form id="snapshot_form" action="">\
|
||||
<div class="row centered">\
|
||||
<div class="four columns">\
|
||||
<label class="inline right" for="vm_id">'+tr("Virtual Machine ID")+':</label>\
|
||||
@@ -2664,7 +2695,7 @@ function setupSaveAsDialog(){
|
||||
dialog.addClass("reveal-modal");
|
||||
setupTips(dialog);
|
||||
|
||||
$('#save_as_form',dialog).submit(function(){
|
||||
$('#snapshot_form',dialog).submit(function(){
|
||||
var vm_id = $('#vm_id', this).val();
|
||||
var snapshot_name = $('#snapshot_name', this).val();
|
||||
|
||||
@@ -2674,14 +2705,14 @@ function setupSaveAsDialog(){
|
||||
|
||||
Sunstone.runAction('VM.snapshot_create', vm_id, obj);
|
||||
|
||||
$save_as_dialog.trigger("reveal:close")
|
||||
$snapshot_dialog.trigger("reveal:close")
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
function popUpSnapshotDialog(vm_id){
|
||||
$('#vm_id',$save_as_dialog).val(vm_id);
|
||||
$save_as_dialog.reveal();
|
||||
$('#vm_id',$snapshot_dialog).val(vm_id);
|
||||
$snapshot_dialog.reveal();
|
||||
}
|
||||
|
||||
|
||||
@@ -2689,7 +2720,7 @@ function popUpSnapshotDialog(vm_id){
|
||||
|
||||
// Listeners to the disks operations (detach, saveas, attach)
|
||||
function setup_vm_snapshot_tab(){
|
||||
setupSaveAsDialog();
|
||||
setupSnapshotDialog();
|
||||
|
||||
$('a.snapshot_revert').live('click', function(){
|
||||
var b = $(this);
|
||||
@@ -2867,9 +2898,11 @@ function setupVNC(){
|
||||
</small>\
|
||||
</h3>\
|
||||
</div>\
|
||||
<div class="reveal-body">\
|
||||
<canvas id="VNC_canvas" width="640px" height="20px">\
|
||||
'+tr("Canvas not supported.")+'\
|
||||
</canvas>\
|
||||
</div>\
|
||||
<a class="close-reveal-modal">×</a>\
|
||||
</div>\
|
||||
');
|
||||
@@ -2882,7 +2915,7 @@ function setupVNC(){
|
||||
// resizable:true,
|
||||
// closeOnEscape: false
|
||||
//});
|
||||
dialog.addClass("reveal-modal large");
|
||||
dialog.addClass("reveal-modal large max-height");
|
||||
|
||||
$('#sendCtrlAltDelButton',dialog).click(function(){
|
||||
rfb.sendCtrlAltDel();
|
||||
@@ -2925,11 +2958,13 @@ function vncIcon(vm){
|
||||
|
||||
if (graphics && graphics.TYPE.toLowerCase() == "vnc" && $.inArray(state, VNCstates)!=-1){
|
||||
gr_icon = '<a class="vnc" href="#" vm_id="'+vm.ID+'">';
|
||||
gr_icon += '<img style="height:15px" src="images/vnc_on.png" alt=\"'+tr("Open VNC Session")+'\" /></a>';
|
||||
gr_icon += '<i class="icon-desktop" style="color: rgb(29, 29, 29)"/>';
|
||||
}
|
||||
else {
|
||||
gr_icon = '<img style="height:15px" src="images/vnc_off.png" alt=\"'+tr("VNC Disabled")+'\" />';
|
||||
gr_icon = '';
|
||||
}
|
||||
|
||||
gr_icon += '</a>'
|
||||
return gr_icon;
|
||||
}
|
||||
|
||||
@@ -2948,7 +2983,6 @@ function vmMonitorError(req,error_json){
|
||||
$(document).ready(function(){
|
||||
|
||||
dataTable_vMachines = $("#datatable_vmachines",main_tabs_context).dataTable({
|
||||
"sDom" : "<'H'>t<'row'<'six columns'i><'six columns'p>>",
|
||||
"oColVis": {
|
||||
"aiExclude": [ 0 ]
|
||||
},
|
||||
@@ -2956,17 +2990,15 @@ $(document).ready(function(){
|
||||
{ "bSortable": false, "aTargets": ["check"] },
|
||||
{ "sWidth": "35px", "aTargets": [0,1] },
|
||||
{ "bVisible": false, "aTargets": [6,7,10]}
|
||||
],
|
||||
"oLanguage": (datatable_lang != "") ?
|
||||
{
|
||||
sUrl: "locale/"+lang+"/"+datatable_lang
|
||||
} : ""
|
||||
]
|
||||
});
|
||||
|
||||
$('#vms_search').keyup(function(){
|
||||
dataTable_templates.fnFilter( $(this).val() );
|
||||
dataTable_vMachines.fnFilter( $(this).val() );
|
||||
})
|
||||
|
||||
|
||||
|
||||
//addElement([
|
||||
// spinner,
|
||||
// '','','','','','','','','','',''],dataTable_vMachines);
|
||||
|
||||
@@ -27,7 +27,7 @@ var vnets_tab_content = '\
|
||||
</span>\
|
||||
<span class="header-info">\
|
||||
<span id="total_vnets"/> <small>'+tr("TOTAL")+'</small> \
|
||||
<span id="addresses_vnets"/> <small>'+tr("ADDRESSES")+'</small>\
|
||||
<span id="addresses_vnets"/> <small>'+tr("USED IPs")+'</small>\
|
||||
</span>\
|
||||
<span class="user-login">\
|
||||
</span>\
|
||||
@@ -40,7 +40,7 @@ var vnets_tab_content = '\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="three columns">\
|
||||
<input id="vnet_search" type="text" placeholder="Search" />\
|
||||
<input id="vnet_search" type="text" placeholder="'+tr("Search")+'" />\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
@@ -63,28 +63,21 @@ var vnets_tab_content = '\
|
||||
<tbody id="tbodyvnetworks">\
|
||||
</tbody>\
|
||||
</table>\
|
||||
<div class="legend_div">\
|
||||
<span>?</span>\
|
||||
<p class="legend_p">\
|
||||
'+tr("Tip: edit the leases of a network by clicking on one and going to the lease management tab.")+'\
|
||||
</p>\
|
||||
</div>\
|
||||
</form>';
|
||||
|
||||
var create_vn_tmpl =
|
||||
'<div id="vn_tabs">\
|
||||
<div class="panel">\
|
||||
'<div class="panel">\
|
||||
<h3>\
|
||||
<small id="create_vnet_header">'+tr("Create Virtual Network")+'</small>\
|
||||
</h3>\
|
||||
</div>\
|
||||
<div class="reveal-body">\
|
||||
<dl class="tabs">\
|
||||
<dd class="active"><a href="#easy">'+tr("Wizard")+'</a></dd>\
|
||||
<dd><a href="#manual">'+tr("Advanced mode")+'</a></dd>\
|
||||
</dl>\
|
||||
<ul class="tabs-content">\
|
||||
<li class="active" id="easyTab">\
|
||||
<div class="reveal-body">\
|
||||
<form id="create_vn_form_easy" action="" class="creation">\
|
||||
<div class="row">\
|
||||
<div class="three columns">\
|
||||
@@ -246,7 +239,8 @@ var create_vn_tmpl =
|
||||
<div class="one columns">\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\<div class="six columns">\
|
||||
</div>\
|
||||
<div class="six columns">\
|
||||
<div class="row">\
|
||||
<div class="four columns">\
|
||||
<label class="right inline" for="vlan">'+tr("VLAN")+':</label>\
|
||||
@@ -322,8 +316,7 @@ var create_vn_tmpl =
|
||||
</div>\
|
||||
</fieldset>\
|
||||
</div>\
|
||||
</form>\
|
||||
</div>\
|
||||
<div class="reveal-footer">\
|
||||
<hr>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button success radius right" id="create_vn_submit_easy" value="vn/create">\
|
||||
@@ -332,14 +325,14 @@ var create_vn_tmpl =
|
||||
<button class="button secondary radius" type="reset" value="reset">'+tr("Reset")+'</button>\
|
||||
<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
|
||||
</div>\
|
||||
</div>\
|
||||
</form>\
|
||||
</li>\
|
||||
<li id="manualTab">\
|
||||
<div class="reveal-body">\
|
||||
<form id="create_vn_form_manual" action="">\
|
||||
<h4><small>'+tr("Write the Virtual Network template here")+'</small></h4>\
|
||||
<textarea id="template" rows="15" style="width:100%;"></textarea>\
|
||||
</form>\
|
||||
</div>\
|
||||
<div class="reveal-footer">\
|
||||
<hr>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button success right radius" id="create_vn_submit_manual" value="vn/create">\
|
||||
@@ -348,10 +341,12 @@ var create_vn_tmpl =
|
||||
<button class="button secondary radius" type="reset" value="reset">'+tr("Reset")+'</button>\
|
||||
<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
|
||||
</div>\
|
||||
</div>\
|
||||
</form>\
|
||||
</li>\
|
||||
</ul>\
|
||||
<a class="close-reveal-modal">×</a>\
|
||||
</div>';
|
||||
</div>\
|
||||
<a class="close-reveal-modal">×</a>';
|
||||
|
||||
var update_vnet_tmpl =
|
||||
'<form action="javascript:alert(\'js error!\');">\
|
||||
@@ -977,7 +972,7 @@ function setupCreateVNetDialog() {
|
||||
// width: 475,
|
||||
// height: height
|
||||
//});
|
||||
dialog.addClass("reveal-modal large");
|
||||
dialog.addClass("reveal-modal large max-height");
|
||||
|
||||
//Make the tabs look nice for the creation mode
|
||||
//$('#vn_tabs',dialog).tabs();
|
||||
@@ -1325,18 +1320,13 @@ function setVNetAutorefresh() {
|
||||
$(document).ready(function(){
|
||||
|
||||
dataTable_vNetworks = $("#datatable_vnetworks",main_tabs_context).dataTable({
|
||||
"sDom" : "<'H'>t<'row'<'six columns'i><'six columns'p>>",
|
||||
"oColVis": {
|
||||
"aiExclude": [ 0 ]
|
||||
},
|
||||
"aoColumnDefs": [
|
||||
{ "sWidth": "35px", "aTargets": [0,1] },
|
||||
{ "bVisible": false, "aTargets": [7]}
|
||||
],
|
||||
"oLanguage": (datatable_lang != "") ?
|
||||
{
|
||||
sUrl: "locale/"+lang+"/"+datatable_lang
|
||||
} : ""
|
||||
]
|
||||
});
|
||||
|
||||
$('#vnet_search').keyup(function(){
|
||||
|
||||
@@ -313,7 +313,7 @@ function notifyMessage(msg){
|
||||
function prettyPrintJSON(template_json,padding,weight, border_bottom,padding_top_bottom){
|
||||
var str = ""
|
||||
if (!template_json){ return "Not defined";}
|
||||
if (!padding) {padding=0};
|
||||
if (!padding) {padding=10};
|
||||
if (!weight) {weight="bold";}
|
||||
if (!border_bottom) {border_bottom = "1px solid #CCCCCC";}
|
||||
if (!padding_top_bottom) {padding_top_bottom=6;}
|
||||
@@ -381,9 +381,9 @@ function prettyPrintRowJSON(field,value,padding,weight, border_bottom,padding_to
|
||||
function initCheckAllBoxes(datatable){
|
||||
|
||||
//small css hack
|
||||
$('input.check_all',datatable).css({"border":"2px"});
|
||||
$('input.check_all',datatable).live("change",function(){
|
||||
var table = $(this).parents('table');
|
||||
$('input.check_all').css({"border":"2px"});
|
||||
$('input.check_all').live("change",function(){
|
||||
var table = $(this).closest('.dataTables_wrapper');
|
||||
var checked = $(this).attr('checked');
|
||||
if (checked) { //check all
|
||||
$('tbody input.check_item',table).attr('checked','checked');
|
||||
@@ -483,7 +483,7 @@ function onError(request,error_json) {
|
||||
//Used when refreshing elements of a datatable.
|
||||
function waitingNodes(dataTable){
|
||||
$('tr input.check_item:visible',dataTable).replaceWith(spinner);
|
||||
recountCheckboxes(dataTable);
|
||||
//recountCheckboxes(dataTable);
|
||||
}
|
||||
|
||||
|
||||
@@ -1152,7 +1152,7 @@ function setupQuotasDialog(dialog){
|
||||
// width: 740,
|
||||
// height: height
|
||||
//});
|
||||
dialog.addClass("reveal-modal xlarge")
|
||||
dialog.addClass("reveal-modal xlarge max-height")
|
||||
|
||||
//$('button',dialog).button();
|
||||
$('#vm_quota,#datastore_quota,#image_quota,#network_quota',dialog).hide();
|
||||
@@ -1333,7 +1333,7 @@ function quotaListItem(quota_json){
|
||||
|
||||
str += '><td>'+
|
||||
quota_json.TYPE+
|
||||
'</td><td style="width:100%;"><pre style="margin:0;">';
|
||||
'</td><td style="width:100%;">';
|
||||
switch(quota_json.TYPE){
|
||||
case "VM":
|
||||
str += 'VMs: ' + quota_json.VMS + (quota_json.VMS_USED ? ' (' + quota_json.VMS_USED + '). ' : ". ") + '<br>' +
|
||||
@@ -1354,7 +1354,7 @@ function quotaListItem(quota_json){
|
||||
'Leases: ' + quota_json.LEASES + (quota_json.LEASES_USED ? ' (' + quota_json.LEASES_USED + '). ': ". ");
|
||||
break;
|
||||
}
|
||||
str += '</td><td><button class="quota_edit_icon"><i class="icon-pencil"></i></button></pre></td></tr>';
|
||||
str += '</td><td><button class="quota_edit_icon"><i class="icon-pencil"></i></button></td></tr>';
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
@@ -582,19 +582,21 @@ function insertButtonsInTab(tab_name){
|
||||
"<div class='eight columns'>"+
|
||||
'<div class="button-bar">'+
|
||||
'<ul class="button-group right">'+
|
||||
'<li id="vmsstopresume_buttons">'+
|
||||
'<li id="vmsplanification_buttons">'+
|
||||
"<div>"+
|
||||
"<div href='#' class='top_button small button secondary dropdown radius'>"+
|
||||
"<i class='icon-play'/> / <i class='icon-pause'/>"+
|
||||
"<i class='icon-th-list'/>"+
|
||||
"<ul>"+
|
||||
"</ul>"+
|
||||
"</div>"+
|
||||
"</div>"+
|
||||
'</li>'+
|
||||
'<li id="vmsoneoff_buttons">'+
|
||||
'</ul>'+
|
||||
'<ul class="button-group right">'+
|
||||
'<li id="vmsrepeat_buttons">'+
|
||||
"<div>"+
|
||||
"<div href='#' class='top_button small button secondary dropdown radius'>"+
|
||||
"<i class='icon-off'/>"+
|
||||
"<i class='icon-repeat'/>"+
|
||||
"<ul>"+
|
||||
"</ul>"+
|
||||
"</div>"+
|
||||
@@ -609,15 +611,34 @@ function insertButtonsInTab(tab_name){
|
||||
"</div>"+
|
||||
"</div>"+
|
||||
'</li>'+
|
||||
'<li id="vmsplanification_buttons">'+
|
||||
'</ul>'+
|
||||
'<ul class="button-group right">'+
|
||||
'<li>'+
|
||||
"<div>"+
|
||||
"<div id='vmsplay_buttons'>"+
|
||||
"</div>"+
|
||||
"</div>"+
|
||||
'</li>'+
|
||||
'<li id="vmspause_buttons">'+
|
||||
"<div>"+
|
||||
"<div href='#' class='top_button small button secondary dropdown radius'>"+
|
||||
"<i class='icon-th-list'/>"+
|
||||
"<i class='icon-pause'/>"+
|
||||
"<ul>"+
|
||||
"</ul>"+
|
||||
"</div>"+
|
||||
"</div>"+
|
||||
'</li>'+
|
||||
'<li id="vmsstop_buttons">'+
|
||||
"<div>"+
|
||||
"<div href='#' class='top_button small button secondary dropdown radius'>"+
|
||||
"<i class='icon-stop'/>"+
|
||||
"<ul>"+
|
||||
"</ul>"+
|
||||
"</div>"+
|
||||
"</div>"+
|
||||
'</li>'+
|
||||
'</ul>'+
|
||||
'<ul class="button-group right">'+
|
||||
'<li>'+
|
||||
"<div id='main_buttons'>"+
|
||||
"<ul class='button-group radius'>"+
|
||||
@@ -703,13 +724,24 @@ function insertButtonsInTab(tab_name){
|
||||
str_class.push("secondary", "button", "small", "radius");
|
||||
button_code = '<li><button type"button" class="'+str_class.join(' ')+'" href="'+button_name+'">'+text+'</button></li>';
|
||||
break;
|
||||
case "vmsstopresume_buttons":
|
||||
context = $("#vmsstopresume_buttons ul", buttons_row);
|
||||
case "vmsplay_buttons":
|
||||
context = $("#vmsplay_buttons", buttons_row);
|
||||
text = button.text;
|
||||
str_class.push("secondary", "button", "small", "radius");
|
||||
button_code = '<button class="'+str_class.join(' ')+'" href="'+button_name+'">'+text+'</button>';
|
||||
break;
|
||||
case "vmspause_buttons":
|
||||
context = $("#vmspause_buttons ul", buttons_row);
|
||||
text = button.text;
|
||||
button_code = '<li><a class="'+str_class.join(' ')+'" href="'+button_name+'">'+text+'</a></li>';
|
||||
break;
|
||||
case "vmsplanification_buttons":
|
||||
context = $("#vmsplanification_buttons ul", buttons_row);
|
||||
case "vmsstop_buttons":
|
||||
context = $("#vmsstop_buttons ul", buttons_row);
|
||||
text = button.text;
|
||||
button_code = '<li><a class="'+str_class.join(' ')+'" href="'+button_name+'">'+text+'</a></li>';
|
||||
break;
|
||||
case "vmsrepeat_buttons":
|
||||
context = $("#vmsrepeat_buttons ul", buttons_row);
|
||||
text = button.text;
|
||||
button_code = '<li><a class="'+str_class.join(' ')+'" href="'+button_name+'">'+text+'</a></li>';
|
||||
break;
|
||||
@@ -718,8 +750,8 @@ function insertButtonsInTab(tab_name){
|
||||
text = button.text;
|
||||
button_code = '<li><a class="'+str_class.join(' ')+'" href="'+button_name+'">'+text+'</a></li>';
|
||||
break;
|
||||
case "vmsoneoff_buttons":
|
||||
context = $("#vmsoneoff_buttons ul", buttons_row);
|
||||
case "vmsplanification_buttons":
|
||||
context = $("#vmsplanification_buttons ul", buttons_row);
|
||||
text = button.text;
|
||||
button_code = '<li><a class="'+str_class.join(' ')+'" href="'+button_name+'">'+text+'</a></li>';
|
||||
break;
|
||||
@@ -769,18 +801,26 @@ function insertButtonsInTab(tab_name){
|
||||
$("#vmsdelete_buttons", action_block).remove()
|
||||
}
|
||||
|
||||
if ($("#vmsoneoff_buttons ul li", action_block).length == 0 ) {
|
||||
$("#vmsoneoff_buttons", action_block).remove()
|
||||
if ($("#vmsstop_buttons ul li", action_block).length == 0 ) {
|
||||
$("#vmsstop_buttons", action_block).remove()
|
||||
}
|
||||
|
||||
if ($("#vmsstopresume_buttons ul li", action_block).length == 0 ) {
|
||||
$("#vmsstopresume_buttons", action_block).remove()
|
||||
if ($("#vmspause_buttons ul li", action_block).length == 0 ) {
|
||||
$("#vmspause_buttons", action_block).remove()
|
||||
}
|
||||
|
||||
if ($("#vmsrepeat_buttons ul li", action_block).length == 0 ) {
|
||||
$("#vmsrepeat_buttons", action_block).remove()
|
||||
}
|
||||
|
||||
if ($("#user_buttons ul li", action_block).length == 0 ) {
|
||||
$("#user_buttons", action_block).remove()
|
||||
}
|
||||
//action_block.foundationButtons();
|
||||
$('.top_button, .list_button',action_block).attr('disabled', false);
|
||||
$('.top_button, .list_button',action_block).attr('disabled', true);
|
||||
$('.create_dialog_button',action_block).attr('disabled', false);
|
||||
$('.alwaysActive',action_block).attr('disabled', false);
|
||||
|
||||
}//if tab exists
|
||||
}
|
||||
@@ -876,7 +916,7 @@ function setupConfirmDialogs(){
|
||||
<hr>\
|
||||
<div class="form_buttons">\
|
||||
<button id="confirm_proceed" class="action_button radius button right" value="">'+tr("OK")+'</button>\
|
||||
<button class="confirm_cancel close-reveal-modal button radius secondary" value="">'+tr("Cancel")+'</button>\
|
||||
<button class="confirm_cancel close-reveal-modal button radius secondary" type="button" value="">'+tr("Cancel")+'</button>\
|
||||
</div>\
|
||||
<a class="close-reveal-modal">×</a>\
|
||||
</form>');
|
||||
@@ -916,7 +956,7 @@ function setupConfirmDialogs(){
|
||||
<hr>\
|
||||
<div class="form_buttons">\
|
||||
<button id="confirm_with_select_proceed" class="action_button radius button right" value="">'+tr("OK")+'</button>\
|
||||
<button class="confirm_cancel close-reveal-modal button radius secondary" value="">'+tr("Cancel")+'</button>\
|
||||
<button class="confirm_cancel close-reveal-modal button radius secondary" type="button" value="">'+tr("Cancel")+'</button>\
|
||||
</div>\
|
||||
<a class="close-reveal-modal">×</a>\
|
||||
</form>');
|
||||
|
||||
@@ -157,7 +157,6 @@ div.button-bar {
|
||||
|
||||
#logo {
|
||||
font-weight: bold;
|
||||
margin:10%;
|
||||
margin-top: 15%;
|
||||
margin-bottom: 10%;
|
||||
}
|
||||
@@ -224,7 +223,7 @@ div.button-bar {
|
||||
}
|
||||
|
||||
#navigation {
|
||||
margin: 8%;;
|
||||
margin: 0 8%;
|
||||
box-shadow: 0 0 1px 0px black;
|
||||
}
|
||||
|
||||
@@ -264,15 +263,23 @@ div.button-bar {
|
||||
}
|
||||
|
||||
#navigation li:not(subTab) {
|
||||
border-left: 5px solid #f2f2f2 !important;
|
||||
border-left: 5px solid #f2f2f2;
|
||||
}
|
||||
|
||||
#navigation li:not(subTab):hover {
|
||||
border-left: 5px solid #e2e2e2 ;
|
||||
}
|
||||
|
||||
#navigation li.subTab:not(.navigation-active-li) {
|
||||
border-left: 5px solid #fdfdfd !important;
|
||||
border-left: 5px solid #fdfdfd;
|
||||
}
|
||||
|
||||
#navigation li:hover {
|
||||
font-weight: bold;
|
||||
#navigation li.subTab:not(.navigation-active-li):hover {
|
||||
border-left: 5px solid #e2e2e2 ;
|
||||
}
|
||||
|
||||
#navigation a:hover {
|
||||
background: #e2e2e2 !important;
|
||||
}
|
||||
|
||||
#navigation .navigation-active-li {
|
||||
@@ -281,6 +288,7 @@ div.button-bar {
|
||||
|
||||
|
||||
|
||||
|
||||
/* top menu css */
|
||||
#menutop_container{
|
||||
margin:0px 171px;
|
||||
@@ -614,7 +622,8 @@ small {
|
||||
|
||||
|
||||
.button.dropdown.small::after {
|
||||
border-color: #2f2f2f transparent transparent transparent;
|
||||
border-color: #9f9f9f transparent transparent transparent;
|
||||
border-width: 4px;
|
||||
}
|
||||
|
||||
.footer-opennebula {
|
||||
@@ -729,12 +738,28 @@ a.footer.button {
|
||||
}
|
||||
|
||||
.reveal-body {
|
||||
max-height: 360px;
|
||||
overflow-y: auto;
|
||||
height:80%;
|
||||
overflow-y: overlay;
|
||||
overflow-x: hidden;
|
||||
padding: 5px;
|
||||
padding: 5px 20px;
|
||||
}
|
||||
|
||||
.reveal-footer {
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
.max-height{
|
||||
max-height: 85%;
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.ui-layout-content {
|
||||
overflow-y: overlay;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
|
||||
// time-picker
|
||||
@@ -781,4 +806,34 @@ div.time-picker li.selected {
|
||||
|
||||
.columns {
|
||||
line-height: 2;
|
||||
}
|
||||
}
|
||||
|
||||
.transparent_table, .transparent_table tr {
|
||||
background: none !important;
|
||||
border: 0px !important;
|
||||
}
|
||||
|
||||
form {
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
#template_create_tabs {
|
||||
//position: fixed;
|
||||
width: 180px;
|
||||
}
|
||||
|
||||
.dataTables_scrollHead {
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.dataTables_scrollBody {
|
||||
margin-top: -3px;
|
||||
}
|
||||
|
||||
.show_hide {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.show_hide:hover > h4 > small {
|
||||
color: #6f6f6f !important;
|
||||
}
|
||||
+20
-15
@@ -1,12 +1,13 @@
|
||||
/* Set the defaults for DataTables initialisation */
|
||||
$.extend( true, $.fn.dataTable.defaults, {
|
||||
"sDom": "<'row'<'six columns'l><'six columns'f>r><'row'<'twelve columns't>><'row'<'six columns'i><'six columns'p>>",
|
||||
"sDom": "<'H'>t<'row'<'four columns'l><'six columns'p>>",
|
||||
"sPaginationType": "foundation",
|
||||
"oLanguage": {
|
||||
"sLengthMenu": 'Show <form class="custom dataTables"><select><option value="10">10</option><option value="25">25</option><option value="50">50</option><option value="100">100</option></select></form> entries'
|
||||
"sLengthMenu": '<select><option value="10">10</option><option value="25">25</option><option value="50">50</option><option value="100">100</option></select> rows'
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
/* API method to get paging information */
|
||||
$.fn.dataTableExt.oApi.fnPagingInfo = function ( oSettings )
|
||||
{
|
||||
@@ -34,14 +35,18 @@ $.extend( $.fn.dataTableExt.oPagination, {
|
||||
};
|
||||
|
||||
$(nPaging).addClass('pagination').append(
|
||||
'<ul class="pagination">'+
|
||||
'<li class="arrow unavailable"><a href="#">« '+oLang.sPrevious+'</a></li>'+
|
||||
'<li class="arrow unavailable"><a href="#">'+oLang.sNext+' » </a></li>'+
|
||||
'<ul class="pagination">' +
|
||||
'<li class="prev unavailable"><a href="#"><i class="icon-double-angle-left"/></a></li>' +
|
||||
'<li class="prev unavailable"><a href="#"><i class="icon-angle-left"/></a></li>'+
|
||||
'<li class="next unavailable"><a href="#"><i class="icon-angle-right"/></a></li>' +
|
||||
'<li class="next unavailable"><a href="#"><i class="icon-double-angle-right"/></a></li>' +
|
||||
'</ul>'
|
||||
);
|
||||
var els = $('a', nPaging);
|
||||
$(els[0]).bind( 'click.DT', { action: "previous" }, fnClickHandler );
|
||||
$(els[1]).bind( 'click.DT', { action: "next" }, fnClickHandler );
|
||||
$(els[0]).bind('click.DT', { action: "first" }, fnClickHandler);
|
||||
$(els[1]).bind( 'click.DT', { action: "previous" }, fnClickHandler );
|
||||
$(els[2]).bind('click.DT', { action: "next" }, fnClickHandler);
|
||||
$(els[3]).bind('click.DT', { action: "last" }, fnClickHandler);
|
||||
},
|
||||
|
||||
"fnUpdate": function ( oSettings, fnDraw ) {
|
||||
@@ -67,31 +72,31 @@ $.extend( $.fn.dataTableExt.oPagination, {
|
||||
|
||||
for ( i=0, iLen=an.length ; i<iLen ; i++ ) {
|
||||
// Remove the middle elements
|
||||
$('li:gt(0)', an[i]).filter(':not(:last)').remove();
|
||||
|
||||
$('li:gt(1)', an[i]).filter(':not(.next)').remove();
|
||||
|
||||
// Add the new list items and their event handlers
|
||||
for ( j=iStart ; j<=iEnd ; j++ ) {
|
||||
sClass = (j==oPaging.iPage+1) ? 'class="current"' : '';
|
||||
$('<li '+sClass+'><a href="#">'+j+'</a></li>')
|
||||
.insertBefore( $('li:last', an[i])[0] )
|
||||
.insertBefore( $('li.next:first', an[i])[0] )
|
||||
.bind('click', function (e) {
|
||||
e.preventDefault();
|
||||
oSettings._iDisplayStart = (parseInt($('a', this).text(),10)-1) * oPaging.iLength;
|
||||
fnDraw( oSettings );
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Add / remove disabled classes from the static elements
|
||||
if ( oPaging.iPage === 0 ) {
|
||||
$('li:first', an[i]).addClass('unavailable');
|
||||
$('li.prev', an[i]).addClass('unavailable');
|
||||
} else {
|
||||
$('li:first', an[i]).removeClass('unavailable');
|
||||
$('li.prev', an[i]).removeClass('unavailable');
|
||||
}
|
||||
|
||||
if ( oPaging.iPage === oPaging.iTotalPages-1 || oPaging.iTotalPages === 0 ) {
|
||||
$('li:last', an[i]).addClass('unavailable');
|
||||
$('li.next', an[i]).addClass('unavailable');
|
||||
} else {
|
||||
$('li:last', an[i]).removeClass('unavailable');
|
||||
$('li.next', an[i]).removeClass('unavailable');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ body {
|
||||
.ui-layout-content {
|
||||
padding: 10px;
|
||||
position: relative; /* contain floated or positioned elements */
|
||||
overflow: auto; /* add scrolling to content-div */
|
||||
overflow: overlay; /* add scrolling to content-div */
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
<div id="logo_sunstone">
|
||||
</div>
|
||||
|
||||
<div id="error_box" class="error_message ui-state-error ui-corner-all">
|
||||
</div>
|
||||
|
||||
|
||||
<form id="login_form">
|
||||
<div class="border" id="login">
|
||||
@@ -17,8 +16,10 @@
|
||||
<label id="label_remember" for="check_remember">Keep me logged in</label>
|
||||
<input type="submit" id="login_btn" value="" />
|
||||
<img src="images/ajax-loader.gif" alt="retrieving" id="login_spinner" />
|
||||
|
||||
</div>
|
||||
<div id="error_box" class="hidden alert-box alert" style="display: none">
|
||||
<span id="error_message"></span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -2,13 +2,6 @@
|
||||
<div id="logo_sunstone">
|
||||
</div>
|
||||
|
||||
<div id="auth_error" class="error_message">
|
||||
Invalid username or password
|
||||
</div>
|
||||
<div id="one_error" class="error_message">
|
||||
OpenNebula is not running
|
||||
</div>
|
||||
|
||||
<form id="login_form">
|
||||
<div class="border" id="login" style='height:169px;background:url("../images/panel_short.png") no-repeat scroll center transparent'>
|
||||
<div class="content">
|
||||
@@ -17,6 +10,10 @@
|
||||
<label id="label_remember" for="check_remember">Keep me logged in</label>
|
||||
|
||||
</div>
|
||||
<div id="error_box" class="hidden alert-box alert" style="display: none">
|
||||
<span id="auth_error"></span>
|
||||
<span id="one_error"></span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -86,8 +86,10 @@
|
||||
</div>
|
||||
|
||||
<div id="menu" class="outer-west">
|
||||
<div id="logo">
|
||||
<img src="images/opennebula-sunstone-v4.0.png"/>
|
||||
<div class="ui-layout-content">
|
||||
|
||||
<div id="logo" class="header">
|
||||
<img src="images/opennebula-sunstone-v4.0-small.png"/>
|
||||
</div>
|
||||
<div class="menu-navZ">
|
||||
<ul id="navigation" class="tabs vertical">
|
||||
@@ -95,6 +97,7 @@
|
||||
</ul>
|
||||
<!--<span class="footer-opennebula"><a href="http://opennebula.org" target="_blank">OpenNebula 3.9.80</a> by <a href="http://c12g.com" target="_blank">C12G Labs</a>.</span>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -122,11 +122,13 @@ void TransferManagerDriver::protocol(
|
||||
case VirtualMachine::PROLOG:
|
||||
case VirtualMachine::PROLOG_MIGRATE:
|
||||
case VirtualMachine::PROLOG_RESUME:
|
||||
case VirtualMachine::PROLOG_UNDEPLOY:
|
||||
lcm_action = LifeCycleManager::PROLOG_SUCCESS;
|
||||
break;
|
||||
|
||||
case VirtualMachine::EPILOG:
|
||||
case VirtualMachine::EPILOG_STOP:
|
||||
case VirtualMachine::EPILOG_UNDEPLOY:
|
||||
case VirtualMachine::CLEANUP_RESUBMIT:
|
||||
lcm_action = LifeCycleManager::EPILOG_SUCCESS;
|
||||
break;
|
||||
@@ -165,11 +167,13 @@ void TransferManagerDriver::protocol(
|
||||
case VirtualMachine::PROLOG:
|
||||
case VirtualMachine::PROLOG_MIGRATE:
|
||||
case VirtualMachine::PROLOG_RESUME:
|
||||
case VirtualMachine::PROLOG_UNDEPLOY:
|
||||
lcm_action = LifeCycleManager::PROLOG_FAILURE;
|
||||
break;
|
||||
|
||||
case VirtualMachine::EPILOG:
|
||||
case VirtualMachine::EPILOG_STOP:
|
||||
case VirtualMachine::EPILOG_UNDEPLOY:
|
||||
case VirtualMachine::CLEANUP_RESUBMIT:
|
||||
lcm_action = LifeCycleManager::EPILOG_FAILURE;
|
||||
break;
|
||||
|
||||
@@ -38,6 +38,13 @@ fi
|
||||
|
||||
. $TMCOMMON
|
||||
|
||||
function exit_error
|
||||
{
|
||||
error_message "$ERROR"
|
||||
rm -rf $ISO_DIR > /dev/null 2>&1
|
||||
exit -1
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Set dst path and dirs
|
||||
#-------------------------------------------------------------------------------
|
||||
@@ -56,22 +63,29 @@ VM_ID=`basename $DST_DIR`
|
||||
ISO_DIR="$DS_DIR/.isofiles/$VM_ID"
|
||||
ISO_FILE="$ISO_DIR/$VM_ID.iso"
|
||||
|
||||
exec_and_log "mkdir -p $ISO_DIR" "Could not create tmp dir to make context dev"
|
||||
exec_and_set_error "mkdir -p $ISO_DIR" \
|
||||
"Could not create tmp dir to make context dev"
|
||||
[ -n "$ERROR" ] && exit_error
|
||||
|
||||
for f in $SRC; do
|
||||
case $f in
|
||||
http://*)
|
||||
exec_and_log "$WGET -P $ISO_DIR $f" "Error downloading $f"
|
||||
exec_and_set_error "$WGET -P $ISO_DIR $f" "Error downloading $f"
|
||||
;;
|
||||
*)
|
||||
exec_and_log "cp -R $f $ISO_DIR" "Error copying $f to $ISO_DIR"
|
||||
exec_and_set_error "cp -R $f $ISO_DIR" "Error copying $f to $ISO_DIR"
|
||||
;;
|
||||
esac
|
||||
|
||||
[ -n "$ERROR" ] && exit_error
|
||||
done
|
||||
|
||||
exec_and_log "$MKISOFS -o $ISO_FILE -J -R $ISO_DIR" "Error creating iso fs"
|
||||
exec_and_set_error "$MKISOFS -o $ISO_FILE -J -R $ISO_DIR" \
|
||||
"Error creating iso fs"
|
||||
[ -n "$ERROR" ] && exit_error
|
||||
|
||||
exec_and_log "$SCP $ISO_FILE $DST" "Error copying context ISO to $DST"
|
||||
exec_and_set_error "$SCP $ISO_FILE $DST" "Error copying context ISO to $DST"
|
||||
[ -n "$ERROR" ] && exit_error
|
||||
|
||||
# Creates symbolic link to add a .iso suffix, needed for VMware CDROMs
|
||||
ssh_exec_and_log $DST_HOST "$LN -s $DST_PATH $DST_PATH.iso" "Error creating ISO symbolic link"
|
||||
|
||||
+21
-6
@@ -40,6 +40,13 @@ fi
|
||||
|
||||
. $TMCOMMON
|
||||
|
||||
function exit_error
|
||||
{
|
||||
error_message "$ERROR"
|
||||
rm -rf $ISO_DIR > /dev/null 2>&1
|
||||
exit -1
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# Retrieve needed information, set dst path and dir
|
||||
#-------------------------------------------------------------------------------
|
||||
@@ -73,30 +80,38 @@ log "Generating context block device at $DST"
|
||||
ISO_DIR="$DS_DIR/.isofiles/$VM_ID"
|
||||
ISO_FILE="$ISO_DIR/$VM_ID.iso"
|
||||
|
||||
exec_and_log "mkdir -p $ISO_DIR" "Could not create tmp dir to make context dev"
|
||||
exec_and_set_error "mkdir -p $ISO_DIR" \
|
||||
"Could not create tmp dir to make context dev"
|
||||
[ -n "$ERROR" ] && exit_error
|
||||
|
||||
for f in $SRC; do
|
||||
case $f in
|
||||
http://*)
|
||||
exec_and_log "$WGET -P $ISO_DIR $f" "Error downloading $f"
|
||||
exec_and_set_error "$WGET -P $ISO_DIR $f" "Error downloading $f"
|
||||
;;
|
||||
*)
|
||||
exec_and_log "cp -R $f $ISO_DIR" "Error copying $f to $ISO_DIR"
|
||||
exec_and_set_error "cp -R $f $ISO_DIR" "Error copying $f to $ISO_DIR"
|
||||
;;
|
||||
esac
|
||||
|
||||
[ -n "$ERROR" ] && exit_error
|
||||
done
|
||||
|
||||
exec_and_log "$MKISOFS -o $ISO_FILE -J -R $ISO_DIR" "Error creating iso fs"
|
||||
exec_and_set_error "$MKISOFS -o $ISO_FILE -J -R $ISO_DIR" \
|
||||
"Error creating iso fs"
|
||||
[ -n "$ERROR" ] && exit_error
|
||||
|
||||
if [ "$USE_SSH" == "yes" ]; then
|
||||
exec_and_log "$SCP $ISO_FILE $DST_PATH.iso" "Error copying context ISO to $DST"
|
||||
exec_and_set_error "$SCP $ISO_FILE $DST_PATH.iso" "Error copying context ISO to $DST"
|
||||
else
|
||||
# Copies the iso file with .iso suffix, needed for VMware CDROMs
|
||||
vifs $VI_PARAMS -rm [$DS_ID]$VM_ID/$DST_FOLDER.iso
|
||||
exec_and_log "vifs $VI_PARAMS -p $ISO_FILE [$DS_ID]$VM_ID/$DST_FOLDER.iso" \
|
||||
exec_and_set_error "vifs $VI_PARAMS -p $ISO_FILE [$DS_ID]$VM_ID/$DST_FOLDER.iso" \
|
||||
"Error copying context ISO to [$DS_ID]$VM_ID/$DST_FOLDER.iso in $DST_HOST"
|
||||
fi
|
||||
|
||||
[ -n "$ERROR" ] && exit_error
|
||||
|
||||
rm -rf $ISO_DIR > /dev/null 2>&1
|
||||
|
||||
exit 0
|
||||
+8
-3
@@ -56,6 +56,7 @@ History::History(
|
||||
epilog_stime(0),
|
||||
epilog_etime(0),
|
||||
reason(NONE),
|
||||
action(NONE_ACTION),
|
||||
vm_info("<VM/>"){};
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
@@ -89,6 +90,7 @@ History::History(
|
||||
epilog_stime(0),
|
||||
epilog_etime(0),
|
||||
reason(NONE),
|
||||
action(NONE_ACTION),
|
||||
vm_info(_vm_info)
|
||||
{
|
||||
non_persistent_data();
|
||||
@@ -307,7 +309,8 @@ string& History::to_xml(string& xml, bool database) const
|
||||
"<RETIME>" << running_etime << "</RETIME>"<<
|
||||
"<ESTIME>" << epilog_stime << "</ESTIME>"<<
|
||||
"<EETIME>" << epilog_etime << "</EETIME>"<<
|
||||
"<REASON>" << reason << "</REASON>";
|
||||
"<REASON>" << reason << "</REASON>"<<
|
||||
"<ACTION>" << action << "</ACTION>";
|
||||
|
||||
if ( database )
|
||||
{
|
||||
@@ -327,7 +330,7 @@ string& History::to_xml(string& xml, bool database) const
|
||||
|
||||
int History::rebuild_attributes()
|
||||
{
|
||||
int int_reason;
|
||||
int int_reason, int_action;
|
||||
int rc = 0;
|
||||
|
||||
rc += xpath(seq , "/HISTORY/SEQ", -1);
|
||||
@@ -347,8 +350,10 @@ int History::rebuild_attributes()
|
||||
rc += xpath(epilog_stime , "/HISTORY/ESTIME", 0);
|
||||
rc += xpath(epilog_etime , "/HISTORY/EETIME", 0);
|
||||
rc += xpath(int_reason , "/HISTORY/REASON", 0);
|
||||
rc += xpath(int_action , "/HISTORY/ACTION", 0);
|
||||
|
||||
reason = static_cast<MigrationReason>(int_reason);
|
||||
reason = static_cast<EndReason>(int_reason);
|
||||
action = static_cast<VMAction>(int_action);
|
||||
|
||||
non_persistent_data();
|
||||
|
||||
|
||||
@@ -274,16 +274,16 @@ int VirtualMachine::insert(SqlDB * db, string& error_str)
|
||||
user_obj_template->get("NAME",name);
|
||||
user_obj_template->erase("NAME");
|
||||
|
||||
user_obj_template->get("TEMPLATE_NAME", prefix);
|
||||
user_obj_template->erase("TEMPLATE_NAME");
|
||||
|
||||
if (prefix.empty())
|
||||
{
|
||||
prefix = "one";
|
||||
}
|
||||
|
||||
if (name.empty() == true)
|
||||
{
|
||||
user_obj_template->get("TEMPLATE_NAME", prefix);
|
||||
user_obj_template->erase("TEMPLATE_NAME");
|
||||
|
||||
if (prefix.empty())
|
||||
{
|
||||
prefix = "one";
|
||||
}
|
||||
|
||||
oss.str("");
|
||||
oss << prefix << "-" << oid;
|
||||
name = oss.str();
|
||||
|
||||
@@ -901,14 +901,11 @@ error_driver:
|
||||
os.str("");
|
||||
os << "cancel_action, error getting driver " << vm->get_vmm_mad();
|
||||
|
||||
error_common:
|
||||
if ( vm->get_lcm_state() == VirtualMachine::CANCEL ) //not in DELETE
|
||||
{
|
||||
Nebula &ne = Nebula::instance();
|
||||
LifeCycleManager * lcm = ne.get_lcm();
|
||||
error_common://LifeCycleManager::cancel_failure_action will check state
|
||||
Nebula &ne = Nebula::instance();
|
||||
LifeCycleManager * lcm = ne.get_lcm();
|
||||
|
||||
lcm->trigger(LifeCycleManager::CANCEL_FAILURE, vid);
|
||||
}
|
||||
lcm->trigger(LifeCycleManager::CANCEL_FAILURE, vid);
|
||||
|
||||
vm->log("VMM", Log::ERROR, os);
|
||||
vm->unlock();
|
||||
|
||||
Reference in new issue
Block a user