mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-21 04:12:37 +09:00
Merge remote-tracking branch 'origin/one-4.0'
Sync with one-4.0 branch
This commit is contained in:
commit
fde458dce1
65 files changed
+2154
-747
No files matched your search
+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;
|
||||
|
||||
|
||||
+38
-10
@@ -98,7 +98,8 @@ public:
|
||||
HOTPLUG_SAVEAS_SUSPENDED = 28,
|
||||
SHUTDOWN_UNDEPLOY = 29,
|
||||
EPILOG_UNDEPLOY = 30,
|
||||
PROLOG_UNDEPLOY = 31
|
||||
PROLOG_UNDEPLOY = 31,
|
||||
BOOT_UNDEPLOY = 32
|
||||
};
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -497,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.
|
||||
@@ -630,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"
|
||||
|
||||
@@ -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"];
|
||||
@@ -52,7 +54,7 @@ digraph OpenNebula {
|
||||
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"];
|
||||
@@ -79,6 +81,12 @@ digraph OpenNebula {
|
||||
save_stop -> running [style="dotted"];
|
||||
epilog_stop -> stopped [style="dashed"];
|
||||
|
||||
# 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"];
|
||||
save_suspend -> suspended [style="dashed"];
|
||||
@@ -88,9 +96,15 @@ 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"];
|
||||
|
||||
poweroff -> boot_poweroff [label="resume"];
|
||||
boot_poweroff -> running [style="dashed"];
|
||||
|
||||
# destroy
|
||||
ANY -> done [label="destroy"];
|
||||
|
||||
@@ -101,10 +115,8 @@ digraph OpenNebula {
|
||||
boot -> boot [label="boot"];
|
||||
boot_suspended -> boot_suspended [label="boot"];
|
||||
boot_stopped -> boot_stopped [label="boot"];
|
||||
|
||||
poweroff -> boot_poweroff [label="boot"];
|
||||
boot_poweroff -> boot_poweroff [label="boot"];
|
||||
boot_poweroff -> running [style="dashed"];
|
||||
boot_undeploy -> boot_undeploy [label="boot"];
|
||||
|
||||
unknown -> boot_unknown [label="boot"];
|
||||
boot_unknown -> boot_unknown [label="boot"];
|
||||
@@ -138,16 +150,19 @@ digraph OpenNebula {
|
||||
# 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>
|
||||
|
||||
@@ -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"
|
||||
+28
-3
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
+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>
|
||||
|
||||
@@ -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
|
||||
;;
|
||||
*)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -608,6 +608,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")
|
||||
@@ -745,6 +757,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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
+3
-3
@@ -344,7 +344,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
||||
|
||||
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
|
||||
@@ -432,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],
|
||||
@@ -487,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],
|
||||
|
||||
@@ -572,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;
|
||||
@@ -614,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();
|
||||
@@ -914,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;
|
||||
|
||||
|
||||
@@ -48,12 +48,13 @@ 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_reason() == History::NONE)
|
||||
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;
|
||||
@@ -120,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");
|
||||
|
||||
//----------------------------------------------------
|
||||
@@ -166,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");
|
||||
|
||||
//----------------------------------------------------
|
||||
@@ -215,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);
|
||||
@@ -271,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);
|
||||
@@ -323,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");
|
||||
|
||||
//----------------------------------------------------
|
||||
@@ -375,12 +392,18 @@ void LifeCycleManager::undeploy_action(int vid, bool hard)
|
||||
|
||||
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
|
||||
{
|
||||
@@ -445,12 +468,18 @@ void LifeCycleManager::poweroff_action(int vid, bool hard)
|
||||
|
||||
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
|
||||
{
|
||||
@@ -548,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");
|
||||
|
||||
//----------------------------------------------------
|
||||
@@ -584,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();
|
||||
@@ -599,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");
|
||||
}
|
||||
@@ -809,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);
|
||||
@@ -845,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:
|
||||
|
||||
+57
-12
@@ -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);
|
||||
|
||||
@@ -530,7 +563,7 @@ void LifeCycleManager::shutdown_success_action(int vid)
|
||||
|
||||
vm->set_running_etime(the_time);
|
||||
|
||||
vm->set_reason(History::NONE);
|
||||
vm->set_reason(History::USER);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
@@ -577,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).");
|
||||
|
||||
@@ -641,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);
|
||||
@@ -712,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);
|
||||
|
||||
@@ -745,7 +786,7 @@ void LifeCycleManager::prolog_failure_action(int vid)
|
||||
|
||||
vm->set_vm_info();
|
||||
|
||||
vm->set_reason(History::NONE);
|
||||
vm->set_reason(History::ERROR);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
@@ -946,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);
|
||||
|
||||
@@ -976,7 +1017,7 @@ void LifeCycleManager::cancel_success_action(int vid)
|
||||
|
||||
vm->set_running_etime(the_time);
|
||||
|
||||
vm->set_reason(History::NONE);
|
||||
vm->set_reason(History::USER);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
@@ -1002,7 +1043,7 @@ void LifeCycleManager::cancel_success_action(int vid)
|
||||
|
||||
vm->set_vm_info();
|
||||
|
||||
vm->set_reason(History::STOP_RESUME);
|
||||
vm->set_reason(History::USER);
|
||||
|
||||
vmpool->update_history(vm);
|
||||
|
||||
@@ -1047,6 +1088,10 @@ void LifeCycleManager::cancel_failure_action(int vid)
|
||||
|
||||
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).");
|
||||
|
||||
@@ -1133,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
|
||||
#
|
||||
|
||||
@@ -107,7 +107,8 @@ public class VirtualMachine extends PoolElement{
|
||||
"HOTPLUG_SAVEAS_SUSPENDED",
|
||||
"SHUTDOWN_UNDEPLOY",
|
||||
"EPILOG_UNDEPLOY",
|
||||
"PROLOG_UNDEPLOY" };
|
||||
"PROLOG_UNDEPLOY",
|
||||
"BOOT_UNDEPLOY" };
|
||||
|
||||
private static final String[] SHORT_LCM_STATES =
|
||||
{
|
||||
@@ -139,7 +140,11 @@ public class VirtualMachine extends PoolElement{
|
||||
"hotp",
|
||||
"hotp",
|
||||
"hotp",
|
||||
"hotp" };
|
||||
"hotp",
|
||||
"shut",
|
||||
"epil",
|
||||
"prol",
|
||||
"boot" };
|
||||
|
||||
/**
|
||||
* Creates a new VM representation.
|
||||
|
||||
@@ -54,7 +54,8 @@ module OpenNebula
|
||||
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 SHUTDOWN_UNDEPLOY EPILOG_UNDEPLOY PROLOG_UNDEPLOY}
|
||||
HOTPLUG_SAVEAS_SUSPENDED SHUTDOWN_UNDEPLOY EPILOG_UNDEPLOY
|
||||
PROLOG_UNDEPLOY BOOT_UNDEPLOY}
|
||||
|
||||
SHORT_VM_STATES={
|
||||
"INIT" => "init",
|
||||
@@ -100,19 +101,23 @@ module OpenNebula
|
||||
"HOTPLUG_SAVEAS_SUSPENDED" => "hotp",
|
||||
"SHUTDOWN_UNDEPLOY" => "shut",
|
||||
"EPILOG_UNDEPLOY" => "epil",
|
||||
"PROLOG_UNDEPLOY" => "prol"
|
||||
"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
|
||||
@@ -137,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)
|
||||
|
||||
@@ -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,77 +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, false);
|
||||
}
|
||||
else if (action == "poweroff-hard")
|
||||
{
|
||||
rc = dm->poweroff(id, true);
|
||||
}
|
||||
else if (action == "undeploy")
|
||||
{
|
||||
rc = dm->undeploy(id, false);
|
||||
}
|
||||
else if (action == "undeploy-hard")
|
||||
{
|
||||
rc = dm->undeploy(id, true);
|
||||
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)
|
||||
@@ -405,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,
|
||||
|
||||
@@ -56,7 +56,8 @@ VNC_STATES = [
|
||||
28, #HOTPLUG_SAVEAS_SUSPENDED
|
||||
29 #SHUTDOWN_UNDEPLOY
|
||||
#30, #EPILOG_UNDEPLOY
|
||||
#31 #PROLOG_UNDEPLOY
|
||||
#31, #PROLOG_UNDEPLOY
|
||||
#32 #BOOT_UNDEPLOY
|
||||
]
|
||||
|
||||
class OpenNebulaVNC
|
||||
|
||||
@@ -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,6 +88,14 @@ module OpenNebulaJSON
|
||||
super(params['host_id'])
|
||||
end
|
||||
|
||||
def undeploy(params=Hash.new)
|
||||
super(params['hard'])
|
||||
end
|
||||
|
||||
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)
|
||||
|
||||
+182
-127
@@ -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,36 +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 786, ../sass/app.scss */
|
||||
/* line 811, ../sass/app.scss */
|
||||
.transparent_table, .transparent_table tr {
|
||||
background: none !important;
|
||||
border: 0px !important;
|
||||
}
|
||||
|
||||
/* line 791, ../sass/app.scss */
|
||||
/* 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;
|
||||
}
|
||||
@@ -36,8 +36,8 @@ function showTab(tabname,highlight_tab){
|
||||
//we no longer expect #tab_id here, but simply tab_id
|
||||
//So safety check - remove # from #tab_id if present to ensure compatibility
|
||||
|
||||
$('tbody input.check_item:checked').click();
|
||||
$('td').removeClass('markrowchecked markrowselected');
|
||||
//$('tbody input.check_item:checked').click();
|
||||
//$('td').removeClass('markrowchecked markrowselected');
|
||||
last_select_row = null;
|
||||
|
||||
if (tabname.indexOf('#') == 0)
|
||||
@@ -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");
|
||||
|
||||
@@ -72,8 +72,8 @@ var create_acl_tmpl =
|
||||
<small id="create_vnet_header">'+tr("Create ACL")+'</small>\
|
||||
</h3>\
|
||||
</div>\
|
||||
<form id="create_acl_form" action="">\
|
||||
<div class="reveal-body">\
|
||||
<form id="create_acl_form" action="">\
|
||||
<div class="row">\
|
||||
<div class="four columns">\
|
||||
<label class="inline right" for="applies">'+tr("This rule applies to")+':</label>\
|
||||
@@ -149,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" : {
|
||||
@@ -430,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');
|
||||
@@ -611,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 ]
|
||||
},
|
||||
@@ -619,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">\
|
||||
@@ -153,17 +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="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
|
||||
@@ -184,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({
|
||||
@@ -1812,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);
|
||||
|
||||
|
||||
@@ -79,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>\
|
||||
|
||||
@@ -69,14 +69,13 @@ var datastores_tab_content = '\
|
||||
</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>\
|
||||
</div>\
|
||||
<form id="create_datastore_form" action="" class="creation">\
|
||||
<div class="reveal-body">\
|
||||
<form id="create_datastore_form" action="" class="creation">\
|
||||
<div class="row">\
|
||||
<div class="three columns">\
|
||||
<label class="right inline" for="name" >' + tr("Name") + ':</label>\
|
||||
@@ -265,15 +264,16 @@ var create_datastore_tmpl =
|
||||
</div>\
|
||||
</div>\
|
||||
</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>\
|
||||
</form>\
|
||||
</div>';
|
||||
</form>';
|
||||
|
||||
var datastore_image_table_tmpl='<thead>\
|
||||
<tr>\
|
||||
@@ -763,7 +763,7 @@ function setupCreateDatastoreDialog(){
|
||||
var dialog = $create_datastore_dialog;
|
||||
dialog.html(create_datastore_tmpl);
|
||||
|
||||
dialog.addClass("reveal-modal large");
|
||||
dialog.addClass("reveal-modal large max-height");
|
||||
|
||||
setupTips(dialog);
|
||||
|
||||
@@ -986,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(){
|
||||
|
||||
@@ -150,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">\
|
||||
@@ -319,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() {
|
||||
@@ -386,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",
|
||||
@@ -546,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">\
|
||||
<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>\
|
||||
@@ -633,26 +610,6 @@ function updateFileInfo(request,img){
|
||||
Sunstone.runAction("File.showinfo", img_info.ID);
|
||||
});
|
||||
|
||||
// Listener for edit link for persistency change
|
||||
$("#div_edit_persistency").live("click", function() {
|
||||
var value_str = $(".value_td_persistency").text();
|
||||
$(".value_td_persistency").html(
|
||||
'<select id="persistency_select">\
|
||||
<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").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");
|
||||
@@ -946,103 +903,10 @@ function is_persistent_file(id){
|
||||
return $(data).is(':checked');
|
||||
};
|
||||
|
||||
function setupFileCloneDialog(){
|
||||
//Append to DOM
|
||||
dialogs_context.append('<div id="file_clone_dialog" title="'+tr("Clone an file")+'"></div>');
|
||||
var dialog = $('#file_clone_dialog',dialogs_context);
|
||||
|
||||
//Put HTML in place
|
||||
|
||||
var html = '<div class="panel">\
|
||||
<h3>\
|
||||
<small id="create_vnet_header">'+tr("Clone File")+'</small>\
|
||||
</h3>\
|
||||
</div>\
|
||||
<form>\
|
||||
<div class="row">\
|
||||
<div class="clone_one"></div>\
|
||||
<div class="clone_several">'+tr("Several file are selected, please choose prefix to name the new copies")+':</div>\
|
||||
<br>\
|
||||
</div>\
|
||||
<div class="row">\
|
||||
<div class="columns two">\
|
||||
<label class="clone_one inline right">'+tr("Name")+':</label>\
|
||||
<label class="clone_several inline right">'+tr("Prefix")+':</label>\
|
||||
</div>\
|
||||
<div class="columns ten">\
|
||||
<input type="text" name="name"></input>\
|
||||
</div>\
|
||||
</div>\
|
||||
<hr>\
|
||||
<div class="form_buttons row">\
|
||||
<button class="button radius right" id="file_clone_button" value="File.clone">\
|
||||
'+tr("Clone")+'\
|
||||
</button>\
|
||||
<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
|
||||
</div>\
|
||||
<a class="close-reveal-modal">×</a>\
|
||||
</form>\
|
||||
';
|
||||
|
||||
dialog.html(html);
|
||||
|
||||
//Convert into jQuery
|
||||
//dialog.dialog({
|
||||
// autoOpen:false,
|
||||
// width:375,
|
||||
// modal:true,
|
||||
// resizable:false
|
||||
//});
|
||||
dialog.addClass("reveal-modal");
|
||||
|
||||
//$('button',dialog).button();
|
||||
|
||||
$('form',dialog).submit(function(){
|
||||
var name = $('input', this).val();
|
||||
var sel_elems = fileElements();
|
||||
if (!name || !sel_elems.length)
|
||||
notifyError('A name or prefix is needed!');
|
||||
if (sel_elems.length > 1){
|
||||
for (var i=0; i< sel_elems.length; i++)
|
||||
//If we are cloning several files we
|
||||
//use the name as prefix
|
||||
Sunstone.runAction('Image.clone',
|
||||
sel_elems[i],
|
||||
name+getFileName(sel_elems[i]));
|
||||
} else {
|
||||
Sunstone.runAction('Image.clone',sel_elems[0],name)
|
||||
};
|
||||
dialog.trigger("reveal:close")
|
||||
setTimeout(function(){
|
||||
Sunstone.runAction('Image.refresh');
|
||||
}, 1500);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
function popUpFileCloneDialog(){
|
||||
var dialog = $('#file_clone_dialog');
|
||||
var sel_elems = fileElements();
|
||||
//show different text depending on how many elements are selected
|
||||
if (sel_elems.length > 1){
|
||||
$('.clone_one',dialog).hide();
|
||||
$('.clone_several',dialog).show();
|
||||
$('input',dialog).val('Copy of ');
|
||||
}
|
||||
else {
|
||||
$('.clone_one',dialog).show();
|
||||
$('.clone_several',dialog).hide();
|
||||
$('input',dialog).val('Copy of '+getFileName(sel_elems[0]));
|
||||
};
|
||||
|
||||
$(dialog).reveal();
|
||||
}
|
||||
|
||||
//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 ]
|
||||
},
|
||||
@@ -1053,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(){
|
||||
@@ -1071,7 +931,6 @@ $(document).ready(function(){
|
||||
|
||||
setupCreateFileDialog();
|
||||
setupTips($create_file_dialog);
|
||||
setupFileCloneDialog();
|
||||
setFileAutorefresh();
|
||||
|
||||
initCheckAllBoxes(dataTable_files);
|
||||
|
||||
@@ -265,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 = {
|
||||
@@ -793,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([
|
||||
|
||||
@@ -76,14 +76,13 @@ var hosts_tab_content = '\
|
||||
</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>\
|
||||
<form id="create_host_form" action="" class="">\
|
||||
<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("Hostname") + ':</label>\
|
||||
@@ -179,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;
|
||||
@@ -935,7 +936,7 @@ function setupCreateHostDialog(){
|
||||
// modal: true,
|
||||
// width: 500
|
||||
//});
|
||||
dialog.addClass("reveal-modal");
|
||||
dialog.addClass("reveal-modal max-height");
|
||||
|
||||
//$('button',dialog).button();
|
||||
|
||||
@@ -1037,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 ]
|
||||
},
|
||||
@@ -1045,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>\
|
||||
@@ -70,10 +70,10 @@ var images_tab_content = '\
|
||||
</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>\
|
||||
@@ -81,7 +81,6 @@ var create_image_tmpl =
|
||||
</dl>\
|
||||
<ul class="tabs-content">\
|
||||
<li id="img_easyTab" class="active">\
|
||||
<div class="reveal-body">\
|
||||
<div class="row vm_param">\
|
||||
<div class="six columns">\
|
||||
<div class="row">\
|
||||
@@ -199,7 +198,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">\
|
||||
@@ -254,13 +253,14 @@ var create_image_tmpl =
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
<hr>\
|
||||
<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">\
|
||||
@@ -270,12 +270,14 @@ var create_image_tmpl =
|
||||
</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>\
|
||||
</div>\
|
||||
</li>\
|
||||
</ul>\
|
||||
<a class="close-reveal-modal">×</a>\
|
||||
@@ -826,7 +828,7 @@ function setupCreateImageDialog(){
|
||||
// width: 520,
|
||||
// height: height
|
||||
//});
|
||||
dialog.addClass("reveal-modal large");
|
||||
dialog.addClass("reveal-modal large max-height");
|
||||
|
||||
$('.advanced',dialog).hide();
|
||||
|
||||
@@ -1251,7 +1253,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 ]
|
||||
},
|
||||
@@ -1262,11 +1263,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(){
|
||||
|
||||
@@ -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
|
||||
} : ""
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -69,9 +69,9 @@ var templates_tab_content = '\
|
||||
var create_template_tmpl = '<div class="panel">'+
|
||||
'<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="reveal-body">'+
|
||||
'<form class="custom creation">'+
|
||||
'<div class="reveal-body">'+
|
||||
'<div class="row">'+
|
||||
'<div class="">'+
|
||||
'<div class="columns three">'+
|
||||
'<dl id="template_create_tabs" class="tabs vertical">'+
|
||||
'</dl>'+
|
||||
@@ -81,8 +81,7 @@ var create_template_tmpl = '<div class="panel">'+
|
||||
'</ul>'+
|
||||
'</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>'+
|
||||
@@ -91,7 +90,8 @@ var create_template_tmpl = '<div class="panel">'+
|
||||
'<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>'+
|
||||
'</div>'+
|
||||
'<a class="close-reveal-modal">×</a>'+
|
||||
'</form>';
|
||||
'</form>'+
|
||||
'</div>';
|
||||
|
||||
|
||||
var update_template_tmpl =
|
||||
@@ -554,7 +554,7 @@ 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">'+
|
||||
@@ -789,7 +789,7 @@ function generate_disk_tab_content(str_disk_tab_id, str_datatable_id){
|
||||
'</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">'+
|
||||
@@ -873,7 +873,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">'+
|
||||
@@ -1141,7 +1141,7 @@ function generate_nic_tab_content(str_nic_tab_id, str_datatable_id){
|
||||
'</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">'+
|
||||
@@ -1150,7 +1150,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">'+
|
||||
@@ -1163,7 +1163,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">'+
|
||||
@@ -1193,7 +1193,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>'+
|
||||
@@ -1218,7 +1218,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>'+
|
||||
@@ -2997,7 +2997,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");
|
||||
@@ -4153,12 +4153,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] }
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
@@ -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(){
|
||||
|
||||
@@ -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>\
|
||||
@@ -1313,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>'
|
||||
};
|
||||
@@ -1459,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>\
|
||||
@@ -1969,8 +2018,8 @@ function setupAttachDiskDialog(){
|
||||
<small id="">'+tr("Attach new disk")+'</small>\
|
||||
</h3>\
|
||||
</div>\
|
||||
<form id="attach_disk_form" action="">\
|
||||
<div class="reveal-body">\
|
||||
<form id="attach_disk_form" action="">\
|
||||
<div class="row centered">\
|
||||
<div class="four columns">\
|
||||
<label class="inline right" for="vm_id">'+tr("Virtual Machine ID")+':</label>\
|
||||
@@ -1983,16 +2032,17 @@ function setupAttachDiskDialog(){
|
||||
</div>\
|
||||
</div>' +
|
||||
generate_disk_tab_content("attach_disk", "attach_disk") +
|
||||
'</div>\
|
||||
'<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")
|
||||
@@ -2232,8 +2282,8 @@ function setupAttachNicDialog(){
|
||||
<small id="">'+tr("Attach new nic")+'</small>\
|
||||
</h3>\
|
||||
</div>\
|
||||
<form id="attach_nic_form" action="">\
|
||||
<div class="reveal-body">\
|
||||
<form id="attach_nic_form" action="">\
|
||||
<div class="row centered">\
|
||||
<div class="four columns">\
|
||||
<label class="inline right" for="vm_id">'+tr("Virtual Machine ID")+':</label>\
|
||||
@@ -2246,16 +2296,17 @@ function setupAttachNicDialog(){
|
||||
</div>\
|
||||
</div>' +
|
||||
generate_nic_tab_content("attach_nic", "attach_nic") +
|
||||
'</div>\
|
||||
'<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")
|
||||
@@ -2405,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">\
|
||||
@@ -2432,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();
|
||||
@@ -2844,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>\
|
||||
');
|
||||
@@ -2859,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();
|
||||
@@ -2902,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;
|
||||
}
|
||||
|
||||
@@ -2925,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 ]
|
||||
},
|
||||
@@ -2933,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>\
|
||||
@@ -66,12 +66,12 @@ var vnets_tab_content = '\
|
||||
</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>\
|
||||
@@ -79,7 +79,6 @@ var create_vn_tmpl =
|
||||
<ul class="tabs-content">\
|
||||
<li class="active" id="easyTab">\
|
||||
<form id="create_vn_form_easy" action="" class="creation">\
|
||||
<div class="reveal-body">\
|
||||
<div class="row">\
|
||||
<div class="three columns">\
|
||||
<label class="right inline" for="name" >' + tr("Name") + ':</label>\
|
||||
@@ -317,7 +316,7 @@ var create_vn_tmpl =
|
||||
</div>\
|
||||
</fieldset>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class="reveal-footer">\
|
||||
<hr>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button success radius right" id="create_vn_submit_easy" value="vn/create">\
|
||||
@@ -326,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">\
|
||||
<form id="create_vn_form_manual" action="">\
|
||||
<div class="reveal-body">\
|
||||
<h4><small>'+tr("Write the Virtual Network template here")+'</small></h4>\
|
||||
<textarea id="template" rows="15" style="width:100%;"></textarea>\
|
||||
</div>\
|
||||
<div class="reveal-footer">\
|
||||
<hr>\
|
||||
<div class="form_buttons">\
|
||||
<button class="button success right radius" id="create_vn_submit_manual" value="vn/create">\
|
||||
@@ -342,11 +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!\');">\
|
||||
@@ -972,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();
|
||||
@@ -1320,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(){
|
||||
|
||||
@@ -341,9 +341,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');
|
||||
@@ -443,7 +443,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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1112,7 +1112,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();
|
||||
|
||||
@@ -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,12 +801,16 @@ 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 ) {
|
||||
@@ -880,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>');
|
||||
@@ -920,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
|
||||
@@ -790,4 +815,25 @@ div.time-picker li.selected {
|
||||
|
||||
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,7 +86,9 @@
|
||||
</div>
|
||||
|
||||
<div id="menu" class="outer-west">
|
||||
<div id="logo">
|
||||
<div class="ui-layout-content">
|
||||
|
||||
<div id="logo" class="header">
|
||||
<img src="images/opennebula-sunstone-v4.0-small.png"/>
|
||||
</div>
|
||||
<div class="menu-navZ">
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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,20 @@ 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";
|
||||
}
|
||||
else
|
||||
{
|
||||
obj_template->add("TEMPLATE_NAME", prefix);
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
Reference in new issue
Block a user