1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-25 06:03:36 +03:00

Added context for VMware

Fix again for ARCH --> ARCHITECTURE
This commit is contained in:
Tino Vázquez 2010-10-04 15:24:25 +02:00
parent 7b4e49407d
commit e8987b2315

View File

@ -38,6 +38,7 @@ int LibVirtDriver::deployment_description_vmware(
string arch = "";
const VectorAttribute * disk;
const VectorAttribute * context;
string type = "";
string target = "";
@ -143,7 +144,7 @@ int LibVirtDriver::deployment_description_vmware(
if ( arch.empty() )
{
get_default("OS","ARCH",arch);
get_default("OS","ARCHITECTURE",arch);
}
if (arch.empty())
@ -245,6 +246,33 @@ int LibVirtDriver::deployment_description_vmware(
file << "\t</devices>" << endl;
attrs.clear();
// ------------------------------------------------------------------------
// Context Device
// ------------------------------------------------------------------------
if ( vm->get_template_attribute("CONTEXT",attrs) == 1 )
{
context = dynamic_cast<const VectorAttribute *>(attrs[0]);
target = context->vector_value("TARGET");
if ( !target.empty() )
{
file << "\t\t<disk type='file' device='cdrom'>" << endl;
file << "\t\t\t<source file='[" << datastore <<"] " << vm->get_oid()
<< "/disk." << num << "'/>" << 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.");
}
}
attrs.clear();
// ------------------------------------------------------------------------