diff --git a/share/scripts/centos-5/net-vmcontext/vmcontext b/share/scripts/centos-5/net-vmcontext/vmcontext index a8ec7663dc..e68bb2ffa9 100755 --- a/share/scripts/centos-5/net-vmcontext/vmcontext +++ b/share/scripts/centos-5/net-vmcontext/vmcontext @@ -1,6 +1,6 @@ #!/bin/bash # -# chkconfig: 2345 10 90 +# chkconfig: 2345 9 90 # description: network reconfigure # # -------------------------------------------------------------------------- # diff --git a/src/im_mad/im_ssh/one_im_ssh.rb b/src/im_mad/im_ssh/one_im_ssh.rb index 0ab0b31794..57dd1514c8 100755 --- a/src/im_mad/im_ssh/one_im_ssh.rb +++ b/src/im_mad/im_ssh/one_im_ssh.rb @@ -49,7 +49,7 @@ class InformationManager < OpenNebulaDriver @config = read_configuration @hypervisor = hypervisor - @remote_dir = @config['SCRIPTS_REMOTE_DIR'] || '/tmp/one' + @remote_dir = @config['SCRIPTS_REMOTE_DIR'] # register actions register_action(:MONITOR, method("action_monitor")) diff --git a/src/image/Image.cc b/src/image/Image.cc index 2a8e837254..3924c389b2 100644 --- a/src/image/Image.cc +++ b/src/image/Image.cc @@ -434,9 +434,9 @@ int Image::drop(SqlDB * db) ostream& operator<<(ostream& os, Image& image) { - string image_str; + string image_str; - os << image.to_xml(image_str); + os << image.to_xml(image_str); return os; } @@ -571,20 +571,25 @@ int Image::disk_attribute( VectorAttribute * disk, { string bus; string target; + string driver; ostringstream iid; *img_type = type; bus = disk->vector_value("BUS"); target = disk->vector_value("TARGET"); + driver = disk->vector_value("DRIVER"); iid << oid; string template_bus; string template_target; string prefix; + string template_driver; get_template_attribute("BUS", template_bus); get_template_attribute("TARGET", template_target); + get_template_attribute("DRIVER", template_driver); + get_template_attribute("DEV_PREFIX", prefix); //-------------------------------------------------------------------------- @@ -612,7 +617,16 @@ int Image::disk_attribute( VectorAttribute * disk, } else if (!template_bus.empty()) { - new_disk.insert(make_pair("BUS",template_bus)); + new_disk.insert(make_pair("BUS",template_bus)); + } + + if (!driver.empty()) + { + new_disk.insert(make_pair("DRIVER",driver)); + } + else if (!template_driver.empty()) + { + new_disk.insert(make_pair("DRIVER",template_driver)); } //--------------------------------------------------------------------------- @@ -714,4 +728,3 @@ string Image::sha1_digest(const string& pass) /* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */ - diff --git a/src/mad/ruby/ActionManager.rb b/src/mad/ruby/ActionManager.rb index a7feb2893c..2c7a1b4cd5 100644 --- a/src/mad/ruby/ActionManager.rb +++ b/src/mad/ruby/ActionManager.rb @@ -183,7 +183,7 @@ private if ENV['ONE_LOCATION'] one_config=ENV['ONE_LOCATION']+'/var/config' else - one_config='/var/log/one/config' + one_config='/var/lib/one/config' end config=Hash.new diff --git a/src/nebula/NebulaTemplate.cc b/src/nebula/NebulaTemplate.cc index a38f592fd2..c9c1a5bd17 100644 --- a/src/nebula/NebulaTemplate.cc +++ b/src/nebula/NebulaTemplate.cc @@ -52,6 +52,7 @@ NebulaTemplate::NebulaTemplate(string& etc_location, string& var_location) # PORT # DB # VNC_BASE_PORT +# SCRIPTS_REMOTE_DIR #******************************************************************************* */ // MONITOR_INTERVAL @@ -94,6 +95,13 @@ NebulaTemplate::NebulaTemplate(string& etc_location, string& var_location) attribute = new SingleAttribute("PORT",value); conf_default.insert(make_pair(attribute->name(),attribute)); + + //SCRIPTS_REMOTE_DIR + value = "/var/tmp/one"; + + attribute = new SingleAttribute("SCRIPTS_REMOTE_DIR",value); + conf_default.insert(make_pair(attribute->name(),attribute)); + /* #******************************************************************************* # Physical Networks configuration @@ -188,4 +196,3 @@ int NebulaTemplate::load_configuration() return 0; } - diff --git a/src/vmm/LibVirtDriverKVM.cc b/src/vmm/LibVirtDriverKVM.cc index f40ebbca98..4fdd14a4c1 100644 --- a/src/vmm/LibVirtDriverKVM.cc +++ b/src/vmm/LibVirtDriverKVM.cc @@ -49,6 +49,8 @@ int LibVirtDriver::deployment_description_kvm( string target = ""; string bus = ""; string ro = ""; + string driver = ""; + string default_driver = ""; bool readonly; const VectorAttribute * nic; @@ -245,6 +247,13 @@ int LibVirtDriver::deployment_description_kvm( file << "\t\t/usr/bin/kvm" << endl; } + get_default("DISK","DRIVER",default_driver); + + if (default_driver.empty()) + { + default_driver = "raw"; + } + num = vm->get_template_attribute("DISK",attrs); for (int i=0; i < num ;i++) @@ -260,6 +269,7 @@ int LibVirtDriver::deployment_description_kvm( target = disk->vector_value("TARGET"); ro = disk->vector_value("READONLY"); bus = disk->vector_value("BUS"); + driver = disk->vector_value("DRIVER"); if (target.empty()) { @@ -278,6 +288,8 @@ int LibVirtDriver::deployment_description_kvm( } } + // ---- Disk type and source for the image ---- + if (type.empty() == false) { transform(type.begin(),type.end(),type.begin(),(int(*)(int))toupper); @@ -302,8 +314,12 @@ int LibVirtDriver::deployment_description_kvm( << i << "'/>" << endl; } + // ---- target device to map the disk ---- + file << "\t\t\t" << endl; @@ -313,11 +329,26 @@ int LibVirtDriver::deployment_description_kvm( file << "/>" << endl; } + // ---- readonly attribute for the disk ---- + if (readonly) { file << "\t\t\t" << endl; } + // ---- Image Format using qemu driver ---- + + file << "\t\t\t" << endl; + } + else + { + file << default_driver << "'/>" << endl; + } + file << "\t\t" << endl; } @@ -331,6 +362,7 @@ int LibVirtDriver::deployment_description_kvm( { context = dynamic_cast(attrs[0]); target = context->vector_value("TARGET"); + driver = context->vector_value("DRIVER"); if ( !target.empty() ) { @@ -339,6 +371,18 @@ int LibVirtDriver::deployment_description_kvm( << num << "'/>" << endl; file << "\t\t\t" << endl; file << "\t\t\t" << endl; + + file << "\t\t\t" << endl; + } + else + { + file << default_driver << "'/>" << endl; + } + file << "\t\t" << endl; } else @@ -587,4 +631,3 @@ error_disk: file.close(); return -1; } - diff --git a/src/vmm/XenDriver.cc b/src/vmm/XenDriver.cc index 53894ffd8d..01b528d5c2 100644 --- a/src/vmm/XenDriver.cc +++ b/src/vmm/XenDriver.cc @@ -49,12 +49,15 @@ int XenDriver::deployment_description( string target = ""; string ro = ""; string type = ""; + string driver = ""; + string default_driver = ""; string mode; const VectorAttribute * nic; string mac = ""; string bridge = ""; + string model = ""; const VectorAttribute * graphics; @@ -216,6 +219,13 @@ int XenDriver::deployment_description( num = vm->get_template_attribute("DISK",attrs); + get_default("DISK","DRIVER",default_driver); + + if (default_driver.empty()) + { + default_driver = "tap:aio:"; + } + file << "disk = [" << endl; for (int i=0; i < num ;i++) @@ -230,6 +240,7 @@ int XenDriver::deployment_description( target = disk->vector_value("TARGET"); type = disk->vector_value("TYPE"); ro = disk->vector_value("READONLY"); + driver = disk->vector_value("DRIVER"); if ( target.empty() ) { @@ -253,13 +264,20 @@ int XenDriver::deployment_description( } } - if ( type == "BLOCK" ) + if ( !driver.empty() ) { - file << " 'phy:"; + file << " '" << driver; } else { - file << " 'tap:aio:"; + if ( type == "BLOCK" ) + { + file << " 'phy:"; + } + else + { + file << " '" << default_driver; + } } file << vm->get_remote_dir() << "/disk." << i << "," @@ -278,12 +296,22 @@ int XenDriver::deployment_description( { context = dynamic_cast(attrs[0]); target = context->vector_value("TARGET"); + driver = context->vector_value("DRIVER"); if ( !target.empty() ) { - file << " " - << "'tap:aio:" << vm->get_remote_dir() << "/disk." << num <<"," - << target << "," + file << " '"; + + if ( !driver.empty() ) + { + file << driver; + } + else + { + file << default_driver; + } + + file << vm->get_remote_dir() << "/disk." << num <<","<< target <<"," << "r'," << endl; } else @@ -320,10 +348,17 @@ int XenDriver::deployment_description( mac = nic->vector_value("MAC"); bridge = nic->vector_value("BRIDGE"); + model = nic->vector_value("MODEL"); + + if( !model.empty() ) + { + file << "type=" << model; + pre_char = ','; + } if( !mac.empty() ) { - file << "mac=" << mac; + file << pre_char << "mac=" << mac; pre_char = ','; } diff --git a/src/vmm_mad/ssh/one_vmm_ssh.rb b/src/vmm_mad/ssh/one_vmm_ssh.rb index ed37db0fee..014eda5090 100755 --- a/src/vmm_mad/ssh/one_vmm_ssh.rb +++ b/src/vmm_mad/ssh/one_vmm_ssh.rb @@ -47,7 +47,7 @@ class SshDriver < VirtualMachineDriver @config = read_configuration @hypervisor = hypervisor - @remote_dir = @config['SCRIPTS_REMOTE_DIR'] || '/tmp/one' + @remote_dir = @config['SCRIPTS_REMOTE_DIR'] end # ------------------------------------------------------------------------ # diff --git a/src/vmm_mad/ssh/vmm_ssh_kvm.conf b/src/vmm_mad/ssh/vmm_ssh_kvm.conf index 7ba58ee1f4..17b50215d5 100644 --- a/src/vmm_mad/ssh/vmm_ssh_kvm.conf +++ b/src/vmm_mad/ssh/vmm_ssh_kvm.conf @@ -6,13 +6,11 @@ # - cpu # - vcpu # - features [acpi, pae] +# - disk [driver ] #VCPU = 1 #MEMORY = 128 -#OS = [ kernel="/vmlinuz", initrd="/initrd.img", root="sda1", boot=hd,kernel_cmd="ro"] -OS = [ boot = "hd" ] +OS = [ boot = "hd" ] +FEATURES = [ PAE = "no", ACPI = "yes" ] -FEATURES = [ - PAE=no, - ACPI=yes -] +DISK = [ driver = "raw" ] diff --git a/src/vmm_mad/ssh/vmm_ssh_xen.conf b/src/vmm_mad/ssh/vmm_ssh_xen.conf index 573d8209fa..8d41b2770b 100644 --- a/src/vmm_mad/ssh/vmm_ssh_xen.conf +++ b/src/vmm_mad/ssh/vmm_ssh_xen.conf @@ -5,9 +5,10 @@ # - os [kernel,initrd,root,kernel_cmd] # - memory # - vcpu +# - disk[driver] #VCPU = 1 #MEMORY = 128 #OS = [ kernel="/vmlinuz", initrd="/initrd.img", root="sda1", kernel_cmd="ro" ] CREDIT = 256 - +DISK = [ driver = "tap:aio:" ]