mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-03 01:17:41 +03:00
feature #3848: Remove VN_MAD from Host in oned. Remove VMWare driver in
core
This commit is contained in:
parent
7816a7912b
commit
67ba59ada1
@ -276,7 +276,6 @@ public:
|
||||
const string& hostname,
|
||||
int cid,
|
||||
const string& vmm,
|
||||
const string& vnm,
|
||||
const string& tmm,
|
||||
const string& ds_location,
|
||||
int ds_id,
|
||||
@ -323,7 +322,6 @@ private:
|
||||
int cid;
|
||||
|
||||
string vmm_mad_name;
|
||||
string vnm_mad_name;
|
||||
string tm_mad_name;
|
||||
|
||||
string ds_location;
|
||||
|
@ -215,15 +215,6 @@ public:
|
||||
return vmm_mad_name;
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves VNM mad name
|
||||
* @return string vnm mad name
|
||||
*/
|
||||
const string& get_vnm_mad() const
|
||||
{
|
||||
return vnm_mad_name;
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieves IM mad name
|
||||
* @return string im mad name
|
||||
@ -535,11 +526,6 @@ private:
|
||||
*/
|
||||
string vmm_mad_name;
|
||||
|
||||
/**
|
||||
* Name of the VN driver used to manage networking in this host
|
||||
*/
|
||||
string vnm_mad_name;
|
||||
|
||||
/**
|
||||
* If Host State = MONITORED last time it got fully monitored or 1 Jan 1970
|
||||
* Host State = MONITORING* last time it got a signal to be monitored
|
||||
@ -590,7 +576,6 @@ private:
|
||||
const string& hostname,
|
||||
const string& im_mad_name,
|
||||
const string& vmm_mad_name,
|
||||
const string& vnm_mad_name,
|
||||
int cluster_id,
|
||||
const string& cluster_name);
|
||||
|
||||
|
@ -51,7 +51,6 @@ public:
|
||||
const string& hostname,
|
||||
const string& im_mad_name,
|
||||
const string& vmm_mad_name,
|
||||
const string& vnm_mad_name,
|
||||
int cluster_id,
|
||||
const string& cluster_name,
|
||||
string& error_str);
|
||||
@ -273,7 +272,7 @@ private:
|
||||
*/
|
||||
PoolObjectSQL * create()
|
||||
{
|
||||
return new Host(-1,"","","","",-1,"");
|
||||
return new Host(-1,"","","",-1,"");
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -27,54 +27,35 @@ class LibVirtDriver : public VirtualMachineManagerDriver
|
||||
{
|
||||
public:
|
||||
|
||||
LibVirtDriver(
|
||||
int userid,
|
||||
const map<string,string> &attrs,
|
||||
bool sudo,
|
||||
VirtualMachinePool * pool,
|
||||
const string _emulator):
|
||||
VirtualMachineManagerDriver(userid, attrs,sudo,pool),
|
||||
emulator(_emulator)
|
||||
LibVirtDriver(int userid, const map<string,string> &attrs, bool sudo,
|
||||
VirtualMachinePool * pool, const string& emu)
|
||||
:VirtualMachineManagerDriver(userid, attrs,sudo,pool), emulator(emu)
|
||||
{};
|
||||
|
||||
~LibVirtDriver(){};
|
||||
|
||||
private:
|
||||
static const char * vmware_vnm_name;
|
||||
static const float CGROUP_BASE_CPU_SHARES;
|
||||
|
||||
static const float CGROUP_BASE_CPU_SHARES;
|
||||
static const int CEPH_DEFAULT_PORT;
|
||||
|
||||
static const int CEPH_DEFAULT_PORT;
|
||||
static const int GLUSTER_DEFAULT_PORT;
|
||||
|
||||
static const int GLUSTER_DEFAULT_PORT;
|
||||
static const int ISCSI_DEFAULT_PORT;
|
||||
|
||||
static const int ISCSI_DEFAULT_PORT;
|
||||
|
||||
int deployment_description(
|
||||
const VirtualMachine * vm,
|
||||
const string& file_name) const
|
||||
int deployment_description(const VirtualMachine * vm, const string& fn) const
|
||||
{
|
||||
int rc = -1;
|
||||
|
||||
if (emulator == "kvm" || emulator == "qemu" )
|
||||
{
|
||||
rc = deployment_description_kvm(vm,file_name);
|
||||
}
|
||||
else if (emulator == "vmware")
|
||||
{
|
||||
rc = deployment_description_vmware(vm,file_name);
|
||||
rc = deployment_description_kvm(vm, fn);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int deployment_description_kvm(
|
||||
const VirtualMachine * vm,
|
||||
const string& file_name) const;
|
||||
|
||||
int deployment_description_vmware(
|
||||
const VirtualMachine * vm,
|
||||
const string& file_name) const;
|
||||
int deployment_description_kvm(const VirtualMachine * v, const string& f) const;
|
||||
|
||||
const string emulator;
|
||||
};
|
||||
|
@ -71,7 +71,6 @@ protected:
|
||||
int hid,
|
||||
string& name,
|
||||
string& vmm,
|
||||
string& vnm,
|
||||
int& cluster_id,
|
||||
string& ds_location,
|
||||
bool& is_public_cloud,
|
||||
@ -101,7 +100,6 @@ protected:
|
||||
int cid,
|
||||
const string& hostname,
|
||||
const string& vmm_mad,
|
||||
const string& vnm_mad,
|
||||
const string& tm_mad,
|
||||
const string& ds_location,
|
||||
int ds_id,
|
||||
|
@ -536,7 +536,6 @@ public:
|
||||
int cid,
|
||||
const string& hostname,
|
||||
const string& vmm_mad,
|
||||
const string& vnm_mad,
|
||||
const string& tm_mad,
|
||||
const string& ds_location,
|
||||
int ds_id);
|
||||
@ -595,26 +594,6 @@ public:
|
||||
return previous_history->vmm_mad_name;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the VNM driver name for the current host. The hasHistory()
|
||||
* function MUST be called before this one.
|
||||
* @return the VNM mad name
|
||||
*/
|
||||
const string & get_vnm_mad() const
|
||||
{
|
||||
return history->vnm_mad_name;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the VNM driver name for the previous host. The hasPreviousHistory()
|
||||
* function MUST be called before this one.
|
||||
* @return the VNM mad name
|
||||
*/
|
||||
const string & get_previous_vnm_mad() const
|
||||
{
|
||||
return previous_history->vnm_mad_name;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the datastore ID of the system DS for the host. The hasHistory()
|
||||
* function MUST be called before this one.
|
||||
|
@ -229,9 +229,7 @@ private:
|
||||
* Function to format a VMM Driver message in the form:
|
||||
* <VMM_DRIVER_ACTION_DATA>
|
||||
* <HOST> hostname </HOST>
|
||||
* <NET_DRV> net_drv </NET_DRV>
|
||||
* <MIGR_HOST> m_hostname </MIGR_HOST>
|
||||
* <MIGR_NET_DRV> m_net_drv </MIGR_NET_DRV>
|
||||
* <DOMAIN> domain_id </DOMAIN>
|
||||
* <DEPLOYMENT_FILE> dfile </DEPLOYMENT_FILE>
|
||||
* <CHECKPOINT_FILE> cfile </CHECKPOINT_FILE>
|
||||
@ -244,9 +242,7 @@ private:
|
||||
* </VMM_DRIVER_ACTION_DATA>
|
||||
*
|
||||
* @param hostname of the host to perform the action
|
||||
* @param net_drv name of the vlan driver
|
||||
* @param m_hostname name of the host to migrate the VM
|
||||
* @param m_net_drv name of the vlan driver
|
||||
* @param domain domain id as returned by the hypervisor
|
||||
* @param dfile deployment file to boot the VM
|
||||
* @param cfile checkpoint file to save the VM
|
||||
@ -260,9 +256,7 @@ private:
|
||||
*/
|
||||
string * format_message(
|
||||
const string& hostname,
|
||||
const string& net_drv,
|
||||
const string& m_hostname,
|
||||
const string& m_net_drv,
|
||||
const string& domain,
|
||||
const string& ldfile,
|
||||
const string& rdfile,
|
||||
|
@ -34,11 +34,15 @@ class VirtualNetworkPool : public PoolSQL
|
||||
{
|
||||
public:
|
||||
|
||||
VirtualNetworkPool(SqlDB * db, const string& str_mac_prefix, int default_size,
|
||||
vector<const SingleAttribute *>& restricted_attrs,
|
||||
vector<const VectorAttribute *>& hook_mads, const string& remotes_location,
|
||||
const vector<const SingleAttribute *>& _inherit_attrs,
|
||||
const VectorAttribute * vlan_conf, const VectorAttribute * vxlan_conf);
|
||||
VirtualNetworkPool(SqlDB * db,
|
||||
const string& str_mac_prefix,
|
||||
int default_size,
|
||||
vector<const SingleAttribute *>& restricted_attrs,
|
||||
vector<const VectorAttribute *>& hook_mads,
|
||||
const string& remotes_location,
|
||||
const vector<const SingleAttribute *>& _inherit_attrs,
|
||||
const VectorAttribute * vlan_conf,
|
||||
const VectorAttribute * vxlan_conf);
|
||||
|
||||
~VirtualNetworkPool(){};
|
||||
|
||||
|
@ -32,7 +32,6 @@ Host::Host(
|
||||
const string& _hostname,
|
||||
const string& _im_mad_name,
|
||||
const string& _vmm_mad_name,
|
||||
const string& _vnm_mad_name,
|
||||
int _cluster_id,
|
||||
const string& _cluster_name):
|
||||
PoolObjectSQL(id,HOST,_hostname,-1,-1,"","",table),
|
||||
@ -40,21 +39,16 @@ Host::Host(
|
||||
state(INIT),
|
||||
im_mad_name(_im_mad_name),
|
||||
vmm_mad_name(_vmm_mad_name),
|
||||
vnm_mad_name(_vnm_mad_name),
|
||||
last_monitored(0),
|
||||
vm_collection("VMS")
|
||||
{
|
||||
string default_cpu; //TODO - Get these two from oned.conf
|
||||
string default_mem;
|
||||
|
||||
obj_template = new HostTemplate;
|
||||
|
||||
add_template_attribute("RESERVED_CPU", default_cpu);
|
||||
add_template_attribute("RESERVED_MEM", default_cpu);
|
||||
add_template_attribute("RESERVED_CPU", "");
|
||||
add_template_attribute("RESERVED_MEM", "");
|
||||
|
||||
replace_template_attribute("IM_MAD", im_mad_name);
|
||||
replace_template_attribute("VM_MAD", vmm_mad_name);
|
||||
replace_template_attribute("VN_MAD", vnm_mad_name);
|
||||
}
|
||||
|
||||
Host::~Host()
|
||||
@ -594,7 +588,6 @@ string& Host::to_xml(string& xml) const
|
||||
"<STATE>" << state << "</STATE>" <<
|
||||
"<IM_MAD>" << one_util::escape_xml(im_mad_name) << "</IM_MAD>" <<
|
||||
"<VM_MAD>" << one_util::escape_xml(vmm_mad_name) << "</VM_MAD>" <<
|
||||
"<VN_MAD>" << one_util::escape_xml(vnm_mad_name) << "</VN_MAD>" <<
|
||||
"<LAST_MON_TIME>" << last_monitored << "</LAST_MON_TIME>" <<
|
||||
"<CLUSTER_ID>" << cluster_id << "</CLUSTER_ID>" <<
|
||||
"<CLUSTER>" << cluster << "</CLUSTER>" <<
|
||||
@ -628,7 +621,6 @@ int Host::from_xml(const string& xml)
|
||||
|
||||
rc += xpath(im_mad_name, "/HOST/IM_MAD", "not_found");
|
||||
rc += xpath(vmm_mad_name, "/HOST/VM_MAD", "not_found");
|
||||
rc += xpath(vnm_mad_name, "/HOST/VN_MAD", "not_found");
|
||||
|
||||
rc += xpath<time_t>(last_monitored, "/HOST/LAST_MON_TIME", 0);
|
||||
|
||||
@ -688,7 +680,6 @@ int Host::post_update_template(string& error)
|
||||
string vcenter_password;
|
||||
string new_im_mad;
|
||||
string new_vm_mad;
|
||||
string new_vn_mad;
|
||||
|
||||
get_template_attribute("VCENTER_PASSWORD", vcenter_password);
|
||||
|
||||
@ -718,7 +709,6 @@ int Host::post_update_template(string& error)
|
||||
|
||||
get_template_attribute("IM_MAD", new_im_mad);
|
||||
get_template_attribute("VM_MAD", new_vm_mad);
|
||||
get_template_attribute("VN_MAD", new_vn_mad);
|
||||
|
||||
if (new_im_mad != ""){
|
||||
im_mad_name = new_im_mad;
|
||||
@ -728,13 +718,8 @@ int Host::post_update_template(string& error)
|
||||
vmm_mad_name = new_vm_mad;
|
||||
}
|
||||
|
||||
if (new_im_mad != ""){
|
||||
vnm_mad_name = new_vn_mad;
|
||||
}
|
||||
|
||||
replace_template_attribute("IM_MAD", im_mad_name);
|
||||
replace_template_attribute("VM_MAD", vmm_mad_name);
|
||||
replace_template_attribute("VN_MAD", vnm_mad_name);
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
@ -150,7 +150,6 @@ int HostPool::allocate (
|
||||
const string& hostname,
|
||||
const string& im_mad_name,
|
||||
const string& vmm_mad_name,
|
||||
const string& vnm_mad_name,
|
||||
int cluster_id,
|
||||
const string& cluster_name,
|
||||
string& error_str)
|
||||
@ -173,11 +172,6 @@ int HostPool::allocate (
|
||||
goto error_vmm;
|
||||
}
|
||||
|
||||
if ( vnm_mad_name.empty() )
|
||||
{
|
||||
goto error_vnm;
|
||||
}
|
||||
|
||||
host = get(hostname,false);
|
||||
|
||||
if ( host !=0)
|
||||
@ -192,7 +186,6 @@ int HostPool::allocate (
|
||||
hostname,
|
||||
im_mad_name,
|
||||
vmm_mad_name,
|
||||
vnm_mad_name,
|
||||
cluster_id,
|
||||
cluster_name);
|
||||
|
||||
@ -210,10 +203,6 @@ error_vmm:
|
||||
error_str = "VMM_MAD_NAME cannot be empty.";
|
||||
goto error_common;
|
||||
|
||||
error_vnm:
|
||||
error_str = "VNM_MAD_NAME cannot be empty.";
|
||||
goto error_common;
|
||||
|
||||
error_duplicated:
|
||||
oss << "NAME is already taken by HOST " << host->get_oid() << ".";
|
||||
error_str = oss.str();
|
||||
|
@ -631,12 +631,11 @@ int HostAllocate::pool_allocate(
|
||||
string host = xmlrpc_c::value_string(paramList.getString(1));
|
||||
string im_mad = xmlrpc_c::value_string(paramList.getString(2));
|
||||
string vmm_mad = xmlrpc_c::value_string(paramList.getString(3));
|
||||
string vnm_mad = xmlrpc_c::value_string(paramList.getString(4));
|
||||
|
||||
HostPool * hpool = static_cast<HostPool *>(pool);
|
||||
|
||||
return hpool->allocate(&id, host, im_mad, vmm_mad, vnm_mad,
|
||||
cluster_id, cluster_name, att.resp_msg);
|
||||
return hpool->allocate(&id, host, im_mad, vmm_mad, cluster_id, cluster_name,
|
||||
att.resp_msg);
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
@ -321,7 +321,6 @@ int RequestManagerVirtualMachine::get_host_information(
|
||||
int hid,
|
||||
string& name,
|
||||
string& vmm,
|
||||
string& vnm,
|
||||
int& cluster_id,
|
||||
string& ds_location,
|
||||
bool& is_public_cloud,
|
||||
@ -345,7 +344,6 @@ int RequestManagerVirtualMachine::get_host_information(
|
||||
|
||||
name = host->get_name();
|
||||
vmm = host->get_vmm_mad();
|
||||
vnm = host->get_vnm_mad();
|
||||
|
||||
cluster_id = host->get_cluster_id();
|
||||
|
||||
@ -439,7 +437,6 @@ int RequestManagerVirtualMachine::add_history(VirtualMachine * vm,
|
||||
int cid,
|
||||
const string& hostname,
|
||||
const string& vmm_mad,
|
||||
const string& vnm_mad,
|
||||
const string& tm_mad,
|
||||
const string& ds_location,
|
||||
int ds_id,
|
||||
@ -449,8 +446,7 @@ int RequestManagerVirtualMachine::add_history(VirtualMachine * vm,
|
||||
|
||||
VirtualMachinePool * vmpool = static_cast<VirtualMachinePool *>(pool);
|
||||
|
||||
vm->add_history(hid, cid, hostname, vmm_mad, vnm_mad, tm_mad, ds_location,
|
||||
ds_id);
|
||||
vm->add_history(hid, cid, hostname, vmm_mad, tm_mad, ds_location, ds_id);
|
||||
|
||||
if ( vmpool->update_history(vm) != 0 )
|
||||
{
|
||||
@ -786,7 +782,6 @@ void VirtualMachineDeploy::request_execute(xmlrpc_c::paramList const& paramList,
|
||||
|
||||
string hostname;
|
||||
string vmm_mad;
|
||||
string vnm_mad;
|
||||
int cluster_id;
|
||||
string ds_location;
|
||||
bool is_public_cloud;
|
||||
@ -820,7 +815,6 @@ void VirtualMachineDeploy::request_execute(xmlrpc_c::paramList const& paramList,
|
||||
if (get_host_information(hid,
|
||||
hostname,
|
||||
vmm_mad,
|
||||
vnm_mad,
|
||||
cluster_id,
|
||||
ds_location,
|
||||
is_public_cloud,
|
||||
@ -967,7 +961,6 @@ void VirtualMachineDeploy::request_execute(xmlrpc_c::paramList const& paramList,
|
||||
cluster_id,
|
||||
hostname,
|
||||
vmm_mad,
|
||||
vnm_mad,
|
||||
tm_mad,
|
||||
ds_location,
|
||||
ds_id,
|
||||
@ -1023,7 +1016,6 @@ void VirtualMachineMigrate::request_execute(xmlrpc_c::paramList const& paramList
|
||||
|
||||
string hostname;
|
||||
string vmm_mad;
|
||||
string vnm_mad;
|
||||
int cluster_id;
|
||||
set<int> ds_cluster_ids;
|
||||
string ds_location;
|
||||
@ -1066,7 +1058,6 @@ void VirtualMachineMigrate::request_execute(xmlrpc_c::paramList const& paramList
|
||||
if (get_host_information(hid,
|
||||
hostname,
|
||||
vmm_mad,
|
||||
vnm_mad,
|
||||
cluster_id,
|
||||
ds_location,
|
||||
is_public_cloud,
|
||||
@ -1306,7 +1297,6 @@ void VirtualMachineMigrate::request_execute(xmlrpc_c::paramList const& paramList
|
||||
cluster_id,
|
||||
hostname,
|
||||
vmm_mad,
|
||||
vnm_mad,
|
||||
tm_mad,
|
||||
ds_location,
|
||||
ds_id,
|
||||
|
@ -44,7 +44,6 @@ History::History(
|
||||
hostname(""),
|
||||
cid(-1),
|
||||
vmm_mad_name(""),
|
||||
vnm_mad_name(""),
|
||||
tm_mad_name(""),
|
||||
ds_location(""),
|
||||
ds_id(0),
|
||||
@ -69,7 +68,6 @@ History::History(
|
||||
const string& _hostname,
|
||||
int _cid,
|
||||
const string& _vmm,
|
||||
const string& _vnm,
|
||||
const string& _tmm,
|
||||
const string& _ds_location,
|
||||
int _ds_id,
|
||||
@ -80,7 +78,6 @@ History::History(
|
||||
hostname(_hostname),
|
||||
cid(_cid),
|
||||
vmm_mad_name(_vmm),
|
||||
vnm_mad_name(_vnm),
|
||||
tm_mad_name(_tmm),
|
||||
ds_location(_ds_location),
|
||||
ds_id(_ds_id),
|
||||
@ -300,26 +297,25 @@ string& History::to_xml(string& xml, bool database) const
|
||||
|
||||
oss <<
|
||||
"<HISTORY>" <<
|
||||
"<OID>" << oid << "</OID>" <<
|
||||
"<SEQ>" << seq << "</SEQ>" <<
|
||||
"<HOSTNAME>" << hostname << "</HOSTNAME>"<<
|
||||
"<HID>" << hid << "</HID>" <<
|
||||
"<CID>" << cid << "</CID>" <<
|
||||
"<STIME>" << stime << "</STIME>" <<
|
||||
"<ETIME>" << etime << "</ETIME>" <<
|
||||
"<VMMMAD>" << one_util::escape_xml(vmm_mad_name) << "</VMMMAD>"<<
|
||||
"<VNMMAD>" << one_util::escape_xml(vnm_mad_name) << "</VNMMAD>"<<
|
||||
"<TMMAD>" << one_util::escape_xml(tm_mad_name) << "</TMMAD>" <<
|
||||
"<DS_LOCATION>" << one_util::escape_xml(ds_location) << "</DS_LOCATION>" <<
|
||||
"<DS_ID>" << ds_id << "</DS_ID>" <<
|
||||
"<PSTIME>" << prolog_stime << "</PSTIME>"<<
|
||||
"<PETIME>" << prolog_etime << "</PETIME>"<<
|
||||
"<RSTIME>" << running_stime << "</RSTIME>"<<
|
||||
"<RETIME>" << running_etime << "</RETIME>"<<
|
||||
"<ESTIME>" << epilog_stime << "</ESTIME>"<<
|
||||
"<EETIME>" << epilog_etime << "</EETIME>"<<
|
||||
"<REASON>" << reason << "</REASON>"<<
|
||||
"<ACTION>" << action << "</ACTION>";
|
||||
"<OID>" << oid << "</OID>" <<
|
||||
"<SEQ>" << seq << "</SEQ>" <<
|
||||
"<HOSTNAME>" << hostname << "</HOSTNAME>"<<
|
||||
"<HID>" << hid << "</HID>" <<
|
||||
"<CID>" << cid << "</CID>" <<
|
||||
"<STIME>" << stime << "</STIME>" <<
|
||||
"<ETIME>" << etime << "</ETIME>" <<
|
||||
"<VMMMAD>" << one_util::escape_xml(vmm_mad_name)<<"</VMMMAD>"<<
|
||||
"<TMMAD>" << one_util::escape_xml(tm_mad_name) <<"</TMMAD>" <<
|
||||
"<DS_LOCATION>"<< one_util::escape_xml(ds_location) <<"</DS_LOCATION>"<<
|
||||
"<DS_ID>" << ds_id << "</DS_ID>" <<
|
||||
"<PSTIME>" << prolog_stime << "</PSTIME>"<<
|
||||
"<PETIME>" << prolog_etime << "</PETIME>"<<
|
||||
"<RSTIME>" << running_stime << "</RSTIME>"<<
|
||||
"<RETIME>" << running_etime << "</RETIME>"<<
|
||||
"<ESTIME>" << epilog_stime << "</ESTIME>"<<
|
||||
"<EETIME>" << epilog_etime << "</EETIME>"<<
|
||||
"<REASON>" << reason << "</REASON>"<<
|
||||
"<ACTION>" << action << "</ACTION>";
|
||||
|
||||
if ( database )
|
||||
{
|
||||
@ -349,7 +345,6 @@ int History::rebuild_attributes()
|
||||
rc += xpath<time_t>(stime , "/HISTORY/STIME", 0);
|
||||
rc += xpath<time_t>(etime , "/HISTORY/ETIME", 0);
|
||||
rc += xpath(vmm_mad_name , "/HISTORY/VMMMAD", "not_found");
|
||||
xpath(vnm_mad_name , "/HISTORY/VNMMAD", "dummy");
|
||||
rc += xpath(tm_mad_name , "/HISTORY/TMMAD", "not_found");
|
||||
rc += xpath(ds_location , "/HISTORY/DS_LOCATION", "not_found");
|
||||
rc += xpath(ds_id , "/HISTORY/DS_ID", 0);
|
||||
|
@ -1650,7 +1650,6 @@ void VirtualMachine::add_history(
|
||||
int cid,
|
||||
const string& hostname,
|
||||
const string& vmm_mad,
|
||||
const string& vnm_mad,
|
||||
const string& tm_mad,
|
||||
const string& ds_location,
|
||||
int ds_id)
|
||||
@ -1672,17 +1671,8 @@ void VirtualMachine::add_history(
|
||||
|
||||
to_xml_extended(vm_xml, 0);
|
||||
|
||||
history = new History(oid,
|
||||
seq,
|
||||
hid,
|
||||
hostname,
|
||||
cid,
|
||||
vmm_mad,
|
||||
vnm_mad,
|
||||
tm_mad,
|
||||
ds_location,
|
||||
ds_id,
|
||||
vm_xml);
|
||||
history = new History(oid, seq, hid, hostname, cid, vmm_mad, tm_mad,
|
||||
ds_location, ds_id, vm_xml);
|
||||
|
||||
history_records.push_back(history);
|
||||
};
|
||||
@ -1708,7 +1698,6 @@ void VirtualMachine::cp_history()
|
||||
history->hostname,
|
||||
history->cid,
|
||||
history->vmm_mad_name,
|
||||
history->vnm_mad_name,
|
||||
history->tm_mad_name,
|
||||
history->ds_location,
|
||||
history->ds_id,
|
||||
@ -1741,7 +1730,6 @@ void VirtualMachine::cp_previous_history()
|
||||
previous_history->hostname,
|
||||
previous_history->cid,
|
||||
previous_history->vmm_mad_name,
|
||||
previous_history->vnm_mad_name,
|
||||
previous_history->tm_mad_name,
|
||||
previous_history->ds_location,
|
||||
previous_history->ds_id,
|
||||
|
@ -161,24 +161,24 @@ int LibVirtDriver::deployment_description_kvm(
|
||||
|
||||
vector<const VectorAttribute *> nic;
|
||||
|
||||
string mac = "";
|
||||
string bridge = "";
|
||||
string bridge_ovs = "";
|
||||
string script = "";
|
||||
string model = "";
|
||||
string ip = "";
|
||||
string filter = "";
|
||||
string mac = "";
|
||||
string bridge = "";
|
||||
string vn_mad = "";
|
||||
string script = "";
|
||||
string model = "";
|
||||
string ip = "";
|
||||
string filter = "";
|
||||
|
||||
string default_filter = "";
|
||||
string default_model = "";
|
||||
|
||||
const VectorAttribute * graphics;
|
||||
|
||||
string listen = "";
|
||||
string port = "";
|
||||
string passwd = "";
|
||||
string keymap = "";
|
||||
string spice_options = "";
|
||||
string listen = "";
|
||||
string port = "";
|
||||
string passwd = "";
|
||||
string keymap = "";
|
||||
string spice_options = "";
|
||||
|
||||
const VectorAttribute * input;
|
||||
|
||||
@ -834,14 +834,14 @@ int LibVirtDriver::deployment_description_kvm(
|
||||
|
||||
for(int i=0; i<num; i++)
|
||||
{
|
||||
bridge = nic[i]->vector_value("BRIDGE");
|
||||
bridge_ovs = nic[i]->vector_value("BRIDGE_OVS");
|
||||
mac = nic[i]->vector_value("MAC");
|
||||
target = nic[i]->vector_value("TARGET");
|
||||
script = nic[i]->vector_value("SCRIPT");
|
||||
model = nic[i]->vector_value("MODEL");
|
||||
ip = nic[i]->vector_value("IP");
|
||||
filter = nic[i]->vector_value("FILTER");
|
||||
bridge = nic[i]->vector_value("BRIDGE");
|
||||
vn_mad = nic[i]->vector_value("VN_MAD");
|
||||
mac = nic[i]->vector_value("MAC");
|
||||
target = nic[i]->vector_value("TARGET");
|
||||
script = nic[i]->vector_value("SCRIPT");
|
||||
model = nic[i]->vector_value("MODEL");
|
||||
ip = nic[i]->vector_value("IP");
|
||||
filter = nic[i]->vector_value("FILTER");
|
||||
|
||||
if ( bridge.empty() )
|
||||
{
|
||||
@ -851,21 +851,14 @@ int LibVirtDriver::deployment_description_kvm(
|
||||
{
|
||||
file << "\t\t<interface type='bridge'>" << endl;
|
||||
|
||||
string * the_bridge = &bridge;
|
||||
|
||||
if ( vm->get_vnm_mad() == "ovswitch" )
|
||||
if (VirtualNetwork::str_to_driver(vn_mad) == VirtualNetwork::OVSWITCH)
|
||||
{
|
||||
|
||||
if ( !bridge_ovs.empty() )
|
||||
{
|
||||
the_bridge = &bridge_ovs;
|
||||
}
|
||||
|
||||
file << "\t\t\t<virtualport type='openvswitch'/>" << endl;
|
||||
}
|
||||
|
||||
file << "\t\t\t<source bridge="
|
||||
<< one_util::escape_xml_attr(*the_bridge) << "/>\n";
|
||||
<< one_util::escape_xml_attr(bridge) << "/>\n";
|
||||
}
|
||||
|
||||
if( !mac.empty() )
|
||||
|
@ -1,494 +0,0 @@
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* Copyright 2002-2015, OpenNebula Project, OpenNebula Systems */
|
||||
/* */
|
||||
/* 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. */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
#include "LibVirtDriver.h"
|
||||
|
||||
#include "Nebula.h"
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include <libgen.h>
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* LibVirtDriver :: VMware deployment generator */
|
||||
/* ************************************************************************** */
|
||||
|
||||
const char * LibVirtDriver::vmware_vnm_name = "vmware";
|
||||
|
||||
int LibVirtDriver::deployment_description_vmware(
|
||||
const VirtualMachine * vm,
|
||||
const string& file_name) const
|
||||
{
|
||||
ofstream file;
|
||||
|
||||
int num;
|
||||
|
||||
string vcpu;
|
||||
string memory;
|
||||
|
||||
int memory_in_kb = 0;
|
||||
|
||||
const VectorAttribute * os;
|
||||
|
||||
string arch = "";
|
||||
string guestOS = "";
|
||||
string pciBridge = "";
|
||||
string boot = "";
|
||||
|
||||
vector<string> boots;
|
||||
|
||||
const VectorAttribute * features;
|
||||
|
||||
vector<const VectorAttribute *> disk;
|
||||
const VectorAttribute * context;
|
||||
|
||||
string type = "";
|
||||
string target = "";
|
||||
string ro = "";
|
||||
string source = "";
|
||||
string driver = "";
|
||||
int disk_id;
|
||||
string default_driver = "";
|
||||
bool readonly;
|
||||
|
||||
vector<const VectorAttribute *> nic;
|
||||
|
||||
string network_id = "";
|
||||
string mac = "";
|
||||
string bridge = "";
|
||||
string script = "";
|
||||
string model = "";
|
||||
|
||||
string default_model = "";
|
||||
|
||||
const VectorAttribute * graphics;
|
||||
|
||||
string listen = "";
|
||||
string port = "";
|
||||
string passwd = "";
|
||||
string keymap = "";
|
||||
|
||||
vector<const VectorAttribute *> raw;
|
||||
string data;
|
||||
string default_raw;
|
||||
string data_vmx = "";
|
||||
|
||||
ostringstream metadata;
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
file.open(file_name.c_str(), ios::out);
|
||||
|
||||
if (file.fail() == true)
|
||||
{
|
||||
goto error_vmware_file;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Starting XML document
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
file << "<domain type='" << emulator << "'>" << endl;
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Domain name
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
file << "\t<name>one-" << vm->get_oid() << "</name>" << endl;
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// CPU
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
vm->get_template_attribute("VCPU", vcpu);
|
||||
|
||||
if(vcpu.empty())
|
||||
{
|
||||
get_default("VCPU", vcpu);
|
||||
}
|
||||
|
||||
if (!vcpu.empty())
|
||||
{
|
||||
file << "\t<vcpu>" << vcpu << "</vcpu>" << endl;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Memory
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
vm->get_template_attribute("MEMORY",memory);
|
||||
|
||||
if (!memory.empty())
|
||||
{
|
||||
memory_in_kb = atoi(memory.c_str()) * 1024;
|
||||
|
||||
file << "\t<memory>" << memory_in_kb << "</memory>" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
goto error_vmware_memory;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// OS and boot options
|
||||
// ------------------------------------------------------------------------
|
||||
os = vm->get_template_attribute("OS");
|
||||
|
||||
if( os != 0 )
|
||||
{
|
||||
arch = os->vector_value("ARCH");
|
||||
guestOS = os->vector_value("GUESTOS");
|
||||
boot = os->vector_value("BOOT");
|
||||
}
|
||||
|
||||
if ( arch.empty() )
|
||||
{
|
||||
get_default("OS","ARCH",arch);
|
||||
|
||||
if (arch.empty())
|
||||
{
|
||||
goto error_vmware_arch;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !guestOS.empty() )
|
||||
{
|
||||
metadata << "<guestos>" << guestOS << "</guestos>" << endl;
|
||||
}
|
||||
|
||||
if ( boot.empty() )
|
||||
{
|
||||
get_default("OS","BOOT",boot);
|
||||
}
|
||||
|
||||
// Start writing to the file with the info we got
|
||||
|
||||
file << "\t<os>" << endl;
|
||||
|
||||
file << "\t\t<type arch='" << arch << "'>hvm</type>" << endl;
|
||||
|
||||
if (!boot.empty())
|
||||
{
|
||||
boots = one_util::split(boot, ',');
|
||||
|
||||
for (vector<string>::const_iterator it=boots.begin(); it!=boots.end(); it++)
|
||||
{
|
||||
file << "\t\t<boot dev='" << *it << "'/>" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
file << "\t</os>" << endl;
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Features
|
||||
// ------------------------------------------------------------------------
|
||||
features = vm->get_template_attribute("FEATURES");
|
||||
|
||||
if ( features != 0 )
|
||||
{
|
||||
pciBridge = features->vector_value("PCIBRIDGE");
|
||||
|
||||
if (!pciBridge.empty())
|
||||
{
|
||||
metadata << "<pcibridge>" << pciBridge << "</pcibridge>";
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Disks
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
file << "\t<devices>" << endl;
|
||||
|
||||
get_default("DISK","DRIVER",default_driver);
|
||||
|
||||
num = vm->get_template_attribute("DISK", disk);
|
||||
|
||||
for (int i=0; i < num ;i++)
|
||||
{
|
||||
type = disk[i]->vector_value("TYPE");
|
||||
target = disk[i]->vector_value("TARGET");
|
||||
ro = disk[i]->vector_value("READONLY");
|
||||
source = disk[i]->vector_value("SOURCE");
|
||||
driver = disk[i]->vector_value("DRIVER");
|
||||
disk[i]->vector_value_str("DISK_ID", disk_id);
|
||||
|
||||
if (target.empty())
|
||||
{
|
||||
goto error_vmware_disk;
|
||||
}
|
||||
|
||||
readonly = false;
|
||||
|
||||
if ( !ro.empty() )
|
||||
{
|
||||
one_util::toupper(ro);
|
||||
|
||||
if ( ro == "YES" )
|
||||
{
|
||||
readonly = true;
|
||||
}
|
||||
}
|
||||
|
||||
one_util::toupper(type);
|
||||
|
||||
// ---- Disk type and source for the image ----
|
||||
|
||||
if ( type == "BLOCK" )
|
||||
{
|
||||
file << "\t\t<disk type='block' device='disk'>" << endl;
|
||||
file << "\t\t\t<source file='[" << vm->get_ds_id() << "] "
|
||||
<< vm->get_oid() << "/disk." << disk_id << "'/>" << endl;
|
||||
}
|
||||
else if ( type == "CDROM" )
|
||||
{
|
||||
file << "\t\t<disk type='file' device='cdrom'>" << endl;
|
||||
file << "\t\t\t<source file='[" << vm->get_ds_id() << "] "
|
||||
<< vm->get_oid() << "/disk." << disk_id << ".iso'/>" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
file << "\t\t<disk type='file' device='disk'>" << endl
|
||||
<< "\t\t\t<source file='[" << vm->get_ds_id() <<"] "
|
||||
<< vm->get_oid() << "/disk." << disk_id << "/disk.vmdk'/>" << endl;
|
||||
}
|
||||
|
||||
// ---- target device to map the disk ----
|
||||
|
||||
file << "\t\t\t<target dev='" << target << "'/>" << endl;
|
||||
|
||||
// ---- Image Format using qemu driver ----
|
||||
|
||||
if ( !driver.empty() )
|
||||
{
|
||||
file << "\t\t\t<driver name='" << driver << "'/>" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!default_driver.empty())
|
||||
{
|
||||
file << "\t\t\t<driver name='" <<
|
||||
default_driver << "'/>" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
// ---- readonly attribute for the disk ----
|
||||
|
||||
if (readonly)
|
||||
{
|
||||
file << "\t\t\t<readonly/>" << endl;
|
||||
}
|
||||
|
||||
file << "\t\t</disk>" << endl;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Context Device
|
||||
// ------------------------------------------------------------------------
|
||||
context = vm->get_template_attribute("CONTEXT");
|
||||
|
||||
if ( context != 0 )
|
||||
{
|
||||
target = context->vector_value("TARGET");
|
||||
|
||||
context->vector_value_str("DISK_ID", disk_id);
|
||||
|
||||
if ( !target.empty() )
|
||||
{
|
||||
file << "\t\t<disk type='file' device='cdrom'>" << endl;
|
||||
file << "\t\t\t<source file='[" << vm->get_ds_id() <<"] "
|
||||
<< vm->get_oid() << "/disk." << disk_id << ".iso'/>" << endl;
|
||||
file << "\t\t\t<target dev='" << target << "'/>" << endl;
|
||||
file << "\t\t\t<readonly/>" << endl;
|
||||
file << "\t\t</disk>" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
vm->log("VMM", Log::WARNING, "Could not find target device to"
|
||||
" attach context, will continue without it.");
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Network interfaces
|
||||
// ------------------------------------------------------------------------
|
||||
get_default("NIC", "MODEL", default_model);
|
||||
|
||||
num = vm->get_template_attribute("NIC", nic);
|
||||
|
||||
for(int i=0; i<num; i++)
|
||||
{
|
||||
network_id = nic[i]->vector_value("NETWORK_ID");
|
||||
mac = nic[i]->vector_value("MAC");
|
||||
target = nic[i]->vector_value("TARGET");
|
||||
script = nic[i]->vector_value("SCRIPT");
|
||||
model = nic[i]->vector_value("MODEL");
|
||||
|
||||
if (vm->get_vnm_mad() == LibVirtDriver::vmware_vnm_name)
|
||||
{
|
||||
bridge = "one-pg-";
|
||||
bridge.append(network_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
bridge = nic[i]->vector_value("BRIDGE");
|
||||
}
|
||||
|
||||
file << "\t\t<interface type='bridge'>" << endl;
|
||||
file << "\t\t\t<source bridge='" << bridge << "'/>" << endl;
|
||||
|
||||
if( !mac.empty() )
|
||||
{
|
||||
file << "\t\t\t<mac address='" << mac << "'/>" << endl;
|
||||
}
|
||||
|
||||
if( !target.empty() )
|
||||
{
|
||||
file << "\t\t\t<target dev='" << target << "'/>" << endl;
|
||||
}
|
||||
|
||||
if( !script.empty() )
|
||||
{
|
||||
file << "\t\t\t<script path='" << script << "'/>" << endl;
|
||||
}
|
||||
|
||||
string * the_model = 0;
|
||||
|
||||
if (!model.empty())
|
||||
{
|
||||
the_model = &model;
|
||||
}
|
||||
else if (!default_model.empty())
|
||||
{
|
||||
the_model = &default_model;
|
||||
}
|
||||
|
||||
if (the_model != 0)
|
||||
{
|
||||
file << "\t\t\t<model type='" << *the_model << "'/>" << endl;
|
||||
}
|
||||
|
||||
file << "\t\t</interface>" << endl;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Graphics
|
||||
// ------------------------------------------------------------------------
|
||||
graphics = vm->get_template_attribute("GRAPHICS");
|
||||
|
||||
if ( graphics != 0 )
|
||||
{
|
||||
type = graphics->vector_value("TYPE");
|
||||
listen = graphics->vector_value("LISTEN");
|
||||
port = graphics->vector_value("PORT");
|
||||
passwd = graphics->vector_value("PASSWD");
|
||||
keymap = graphics->vector_value("KEYMAP");
|
||||
|
||||
if ( type == "vnc" || type == "VNC" )
|
||||
{
|
||||
file << "\t\t<graphics type='vnc'";
|
||||
|
||||
if ( !listen.empty() )
|
||||
{
|
||||
file << " listen='" << listen << "'";
|
||||
}
|
||||
|
||||
if ( !port.empty() )
|
||||
{
|
||||
file << " port='" << port << "'";
|
||||
}
|
||||
|
||||
if ( !passwd.empty() )
|
||||
{
|
||||
file << " passwd='" << passwd << "'";
|
||||
}
|
||||
|
||||
if ( !keymap.empty() )
|
||||
{
|
||||
file << " keymap='" << keymap << "'";
|
||||
}
|
||||
|
||||
file << "/>" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
vm->log("VMM", Log::WARNING,
|
||||
"Not supported graphics type, ignored.");
|
||||
}
|
||||
}
|
||||
|
||||
file << "\t</devices>" << endl;
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Raw VMware attributes
|
||||
// ------------------------------------------------------------------------
|
||||
num = vm->get_template_attribute("RAW", raw);
|
||||
|
||||
for(int i=0; i<num;i++)
|
||||
{
|
||||
type = raw[i]->vector_value("TYPE");
|
||||
|
||||
one_util::toupper(type);
|
||||
|
||||
if ( type == "VMWARE" )
|
||||
{
|
||||
data = raw[i]->vector_value("DATA");
|
||||
file << "\t" << data << endl;
|
||||
|
||||
data_vmx = raw[i]->vector_value("DATA_VMX");
|
||||
if ( !data_vmx.empty() )
|
||||
{
|
||||
metadata << "<datavmx>" << data_vmx << "</datavmx>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
get_default("RAW", default_raw);
|
||||
|
||||
if ( !default_raw.empty() )
|
||||
{
|
||||
file << "\t" << default_raw << endl;
|
||||
}
|
||||
|
||||
if ( !metadata.str().empty() )
|
||||
{
|
||||
file << "\t<metadata>" << metadata.str() << "</metadata>" << endl;
|
||||
}
|
||||
|
||||
file << "</domain>" << endl;
|
||||
|
||||
file.close();
|
||||
|
||||
return 0;
|
||||
|
||||
error_vmware_file:
|
||||
vm->log("VMM", Log::ERROR, "Could not open VMWARE deployment file.");
|
||||
return -1;
|
||||
|
||||
error_vmware_arch:
|
||||
vm->log("VMM", Log::ERROR, "No ARCH defined and no default provided.");
|
||||
file.close();
|
||||
return -1;
|
||||
|
||||
error_vmware_memory:
|
||||
vm->log("VMM", Log::ERROR, "No MEMORY defined and no default provided.");
|
||||
file.close();
|
||||
return -1;
|
||||
|
||||
error_vmware_disk:
|
||||
vm->log("VMM", Log::ERROR, "Wrong target value in DISK.");
|
||||
file.close();
|
||||
return -1;
|
||||
}
|
@ -26,7 +26,6 @@ source_files=[
|
||||
'VirtualMachineManagerDriver.cc',
|
||||
'XenDriver.cc',
|
||||
'LibVirtDriverKVM.cc',
|
||||
'LibVirtDriverVMware.cc',
|
||||
'XMLDriver.cc'
|
||||
]
|
||||
|
||||
|
@ -347,9 +347,7 @@ void VirtualMachineManager::do_action(const string &action, void * arg)
|
||||
|
||||
string * VirtualMachineManager::format_message(
|
||||
const string& hostname,
|
||||
const string& net_drv,
|
||||
const string& m_hostname,
|
||||
const string& m_net_drv,
|
||||
const string& domain,
|
||||
const string& ldfile,
|
||||
const string& rdfile,
|
||||
@ -373,17 +371,15 @@ string * VirtualMachineManager::format_message(
|
||||
}
|
||||
|
||||
oss << "<VMM_DRIVER_ACTION_DATA>"
|
||||
<< "<HOST>" << hostname << "</HOST>"
|
||||
<< "<NET_DRV>" << net_drv << "</NET_DRV>";
|
||||
<< "<HOST>" << hostname << "</HOST>";
|
||||
|
||||
if (!m_hostname.empty())
|
||||
{
|
||||
oss << "<MIGR_HOST>" << m_hostname << "</MIGR_HOST>"
|
||||
<< "<MIGR_NET_DRV>"<< m_net_drv << "</MIGR_NET_DRV>";
|
||||
oss << "<MIGR_HOST>" << m_hostname << "</MIGR_HOST>";
|
||||
}
|
||||
else
|
||||
{
|
||||
oss << "<MIGR_HOST/><MIGR_NET_DRV/>";
|
||||
oss << "<MIGR_HOST/>";
|
||||
}
|
||||
|
||||
if (!domain.empty())
|
||||
@ -571,8 +567,6 @@ void VirtualMachineManager::deploy_action(int vid)
|
||||
// Invoke driver method
|
||||
drv_msg = format_message(
|
||||
vm->get_hostname(),
|
||||
vm->get_vnm_mad(),
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
vm->get_deployment_file(),
|
||||
@ -629,7 +623,7 @@ void VirtualMachineManager::save_action(
|
||||
VirtualMachine * vm;
|
||||
const VirtualMachineManagerDriver * vmd;
|
||||
|
||||
string hostname, vnm_mad, checkpoint_file;
|
||||
string hostname, checkpoint_file;
|
||||
string vm_tmpl;
|
||||
string * drv_msg;
|
||||
int ds_id;
|
||||
@ -666,14 +660,12 @@ void VirtualMachineManager::save_action(
|
||||
}
|
||||
|
||||
hostname = vm->get_previous_hostname();
|
||||
vnm_mad = vm->get_previous_vnm_mad();
|
||||
checkpoint_file = vm->get_previous_checkpoint_file();
|
||||
ds_id = vm->get_previous_ds_id();
|
||||
}
|
||||
else
|
||||
{
|
||||
hostname = vm->get_hostname();
|
||||
vnm_mad = vm->get_vnm_mad();
|
||||
checkpoint_file = vm->get_checkpoint_file();
|
||||
ds_id = vm->get_ds_id();
|
||||
}
|
||||
@ -681,8 +673,6 @@ void VirtualMachineManager::save_action(
|
||||
// Invoke driver method
|
||||
drv_msg = format_message(
|
||||
hostname,
|
||||
vnm_mad,
|
||||
"",
|
||||
"",
|
||||
vm->get_deploy_id(),
|
||||
"",
|
||||
@ -762,8 +752,6 @@ void VirtualMachineManager::shutdown_action(
|
||||
// Invoke driver method
|
||||
drv_msg = format_message(
|
||||
vm->get_hostname(),
|
||||
vm->get_vnm_mad(),
|
||||
"",
|
||||
"",
|
||||
vm->get_deploy_id(),
|
||||
"",
|
||||
@ -839,8 +827,6 @@ void VirtualMachineManager::reboot_action(
|
||||
// Invoke driver method
|
||||
drv_msg = format_message(
|
||||
vm->get_hostname(),
|
||||
vm->get_vnm_mad(),
|
||||
"",
|
||||
"",
|
||||
vm->get_deploy_id(),
|
||||
"",
|
||||
@ -911,8 +897,6 @@ void VirtualMachineManager::reset_action(
|
||||
// Invoke driver method
|
||||
drv_msg = format_message(
|
||||
vm->get_hostname(),
|
||||
vm->get_vnm_mad(),
|
||||
"",
|
||||
"",
|
||||
vm->get_deploy_id(),
|
||||
"",
|
||||
@ -984,8 +968,6 @@ void VirtualMachineManager::cancel_action(
|
||||
// Invoke driver method
|
||||
drv_msg = format_message(
|
||||
vm->get_hostname(),
|
||||
vm->get_vnm_mad(),
|
||||
"",
|
||||
"",
|
||||
vm->get_deploy_id(),
|
||||
"",
|
||||
@ -1062,8 +1044,6 @@ void VirtualMachineManager::cancel_previous_action(
|
||||
// Invoke driver method
|
||||
drv_msg = format_message(
|
||||
vm->get_previous_hostname(),
|
||||
vm->get_previous_vnm_mad(),
|
||||
"",
|
||||
"",
|
||||
vm->get_deploy_id(),
|
||||
"",
|
||||
@ -1111,7 +1091,6 @@ void VirtualMachineManager::cleanup_action(
|
||||
string tm_command = "";
|
||||
|
||||
string m_hostname = "";
|
||||
string m_net_drv = "";
|
||||
|
||||
const VirtualMachineManagerDriver * vmd;
|
||||
|
||||
@ -1141,7 +1120,6 @@ void VirtualMachineManager::cleanup_action(
|
||||
if ( cancel_previous && vm->hasPreviousHistory() )
|
||||
{
|
||||
m_hostname = vm->get_previous_hostname();
|
||||
m_net_drv = vm->get_previous_vnm_mad();
|
||||
}
|
||||
|
||||
if (!vm->get_host_is_cloud())
|
||||
@ -1157,9 +1135,7 @@ void VirtualMachineManager::cleanup_action(
|
||||
// Invoke driver method
|
||||
drv_msg = format_message(
|
||||
vm->get_hostname(),
|
||||
vm->get_vnm_mad(),
|
||||
m_hostname,
|
||||
m_net_drv,
|
||||
vm->get_deploy_id(),
|
||||
"",
|
||||
"",
|
||||
@ -1245,8 +1221,6 @@ void VirtualMachineManager::cleanup_previous_action(int vid)
|
||||
// Invoke driver method
|
||||
drv_msg = format_message(
|
||||
vm->get_previous_hostname(),
|
||||
vm->get_previous_vnm_mad(),
|
||||
"",
|
||||
"",
|
||||
vm->get_deploy_id(),
|
||||
"",
|
||||
@ -1330,9 +1304,7 @@ void VirtualMachineManager::migrate_action(
|
||||
// Invoke driver method
|
||||
drv_msg = format_message(
|
||||
vm->get_previous_hostname(),
|
||||
vm->get_previous_vnm_mad(),
|
||||
vm->get_hostname(),
|
||||
vm->get_vnm_mad(),
|
||||
vm->get_deploy_id(),
|
||||
"",
|
||||
"",
|
||||
@ -1439,8 +1411,6 @@ void VirtualMachineManager::restore_action(
|
||||
// Invoke driver method
|
||||
drv_msg = format_message(
|
||||
vm->get_hostname(),
|
||||
vm->get_vnm_mad(),
|
||||
"",
|
||||
"",
|
||||
vm->get_deploy_id(),
|
||||
"",
|
||||
@ -1521,8 +1491,6 @@ void VirtualMachineManager::poll_action(
|
||||
// Invoke driver method
|
||||
drv_msg = format_message(
|
||||
vm->get_hostname(),
|
||||
vm->get_vnm_mad(),
|
||||
"",
|
||||
"",
|
||||
vm->get_deploy_id(),
|
||||
"",
|
||||
@ -1696,8 +1664,6 @@ void VirtualMachineManager::timer_action()
|
||||
|
||||
drv_msg = format_message(
|
||||
vm->get_hostname(),
|
||||
vm->get_vnm_mad(),
|
||||
"",
|
||||
"",
|
||||
vm->get_deploy_id(),
|
||||
"",
|
||||
@ -1814,8 +1780,6 @@ void VirtualMachineManager::attach_action(
|
||||
// Invoke driver method
|
||||
drv_msg = format_message(
|
||||
vm->get_hostname(),
|
||||
vm->get_vnm_mad(),
|
||||
"",
|
||||
"",
|
||||
vm->get_deploy_id(),
|
||||
"",
|
||||
@ -1936,8 +1900,6 @@ void VirtualMachineManager::detach_action(
|
||||
// Invoke driver method
|
||||
drv_msg = format_message(
|
||||
vm->get_hostname(),
|
||||
vm->get_vnm_mad(),
|
||||
"",
|
||||
"",
|
||||
vm->get_deploy_id(),
|
||||
"",
|
||||
@ -2020,8 +1982,6 @@ void VirtualMachineManager::snapshot_create_action(int vid)
|
||||
|
||||
drv_msg = format_message(
|
||||
vm->get_hostname(),
|
||||
vm->get_vnm_mad(),
|
||||
"",
|
||||
"",
|
||||
vm->get_deploy_id(),
|
||||
"",
|
||||
@ -2100,8 +2060,6 @@ void VirtualMachineManager::snapshot_revert_action(int vid)
|
||||
|
||||
drv_msg = format_message(
|
||||
vm->get_hostname(),
|
||||
vm->get_vnm_mad(),
|
||||
"",
|
||||
"",
|
||||
vm->get_deploy_id(),
|
||||
"",
|
||||
@ -2180,8 +2138,6 @@ void VirtualMachineManager::snapshot_delete_action(int vid)
|
||||
|
||||
drv_msg = format_message(
|
||||
vm->get_hostname(),
|
||||
vm->get_vnm_mad(),
|
||||
"",
|
||||
"",
|
||||
vm->get_deploy_id(),
|
||||
"",
|
||||
@ -2291,8 +2247,6 @@ void VirtualMachineManager::disk_snapshot_create_action(int vid)
|
||||
// Invoke driver method
|
||||
drv_msg = format_message(
|
||||
vm->get_hostname(),
|
||||
vm->get_vnm_mad(),
|
||||
"",
|
||||
"",
|
||||
vm->get_deploy_id(),
|
||||
"",
|
||||
@ -2405,8 +2359,6 @@ void VirtualMachineManager::attach_nic_action(
|
||||
// Invoke driver method
|
||||
drv_msg = format_message(
|
||||
vm->get_hostname(),
|
||||
vm->get_vnm_mad(),
|
||||
"",
|
||||
"",
|
||||
vm->get_deploy_id(),
|
||||
"",
|
||||
@ -2491,8 +2443,6 @@ void VirtualMachineManager::detach_nic_action(
|
||||
// Invoke driver method
|
||||
drv_msg = format_message(
|
||||
vm->get_hostname(),
|
||||
vm->get_vnm_mad(),
|
||||
"",
|
||||
"",
|
||||
vm->get_deploy_id(),
|
||||
"",
|
||||
@ -2560,8 +2510,6 @@ int VirtualMachineManager::updatesg(VirtualMachine * vm, int sgid)
|
||||
// Invoke driver method
|
||||
drv_msg = format_message(
|
||||
vm->get_hostname(),
|
||||
vm->get_vnm_mad(),
|
||||
"",
|
||||
"",
|
||||
vm->get_deploy_id(),
|
||||
"",
|
||||
|
Loading…
Reference in New Issue
Block a user