Author: fapeeler Date: Mon Jun 28 18:56:10 2010 New Revision: 958679 URL: http://svn.apache.org/viewvc?rev=958679&view=rev Log: VCL-351
extended to account for at least 2 more virtual adapters Modified: incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm?rev=958679&r1=958678&r2=958679&view=diff ============================================================================== --- incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm Mon Jun 28 18:56:10 2010 @@ -247,6 +247,8 @@ $SUBROUTINE_MAPPINGS{vmhost_profile_nas_ $SUBROUTINE_MAPPINGS{vmhost_profile_name} = '$self->request_data->{reservation}{RESERVATION_ID}{computer}{vmhost}{vmprofile}{profilename}'; $SUBROUTINE_MAPPINGS{vmhost_profile_virtualswitch0} = '$self->request_data->{reservation}{RESERVATION_ID}{computer}{vmhost}{vmprofile}{virtualswitch0}'; $SUBROUTINE_MAPPINGS{vmhost_profile_virtualswitch1} = '$self->request_data->{reservation}{RESERVATION_ID}{computer}{vmhost}{vmprofile}{virtualswitch1}'; +$SUBROUTINE_MAPPINGS{vmhost_profile_virtualswitch2} = '$self->request_data->{reservation}{RESERVATION_ID}{computer}{vmhost}{vmprofile}{virtualswitch2}'; +$SUBROUTINE_MAPPINGS{vmhost_profile_virtualswitch3} = '$self->request_data->{reservation}{RESERVATION_ID}{computer}{vmhost}{vmprofile}{virtualswitch3}'; $SUBROUTINE_MAPPINGS{vmhost_profile_vmdisk} = '$self->request_data->{reservation}{RESERVATION_ID}{computer}{vmhost}{vmprofile}{vmdisk}'; $SUBROUTINE_MAPPINGS{vmhost_profile_vmpath} = '$self->request_data->{reservation}{RESERVATION_ID}{computer}{vmhost}{vmprofile}{vmpath}'; $SUBROUTINE_MAPPINGS{vmhost_profile_username} = '$self->request_data->{reservation}{RESERVATION_ID}{computer}{vmhost}{vmprofile}{username}'; Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm?rev=958679&r1=958678&r2=958679&view=diff ============================================================================== --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm Mon Jun 28 18:56:10 2010 @@ -130,6 +130,8 @@ sub load { my $datastorepath4vmx = $self->data->get_vmhost_profile_datastorepath_4vmx; my $virtualswitch0 = $self->data->get_vmhost_profile_virtualswitch0; my $virtualswitch1 = $self->data->get_vmhost_profile_virtualswitch1; + my $virtualswitch2 = $self->data->get_vmhost_profile_virtualswitch2; + my $virtualswitch3 = $self->data->get_vmhost_profile_virtualswitch3; my $vmtype = $vmtype_name; my $requestedimagename = $self->data->get_image_name; @@ -151,6 +153,21 @@ sub load { # Assemble a consistent prefix for notify messages my $notify_prefix = "req=$request_id, res=$reservation_id:"; + my $vmware_throttle = 0; + + #get Throttle value from database if set + my $variable_name = $self->data->get_management_node_hostname() . "|vmware|throttle"; + if($self->data->is_variable_set($variable_name)){ + notify($ERRORS{'DEBUG'}, 0, "throttle is set for $variable_name"); + #fetch variable + $vmware_throttle = $self->data->get_variable($variable_name); + + } + else{ + notify($ERRORS{'DEBUG'}, 0, "throttle is not set for $variable_name"); + $vmware_throttle = 0; + } + #$VMWARErepository #if (!($vm{vmhost}{ok})) { @@ -655,6 +672,17 @@ sub load { push(@vmxfile, "Ethernet1.connectionType = \"custom\"\n"); push(@vmxfile, "Ethernet1.vnet = \"$virtualswitch1\"\n"); + + if(defined($virtualswitch2) && ($virtualswitch2)){ + push(@vmxfile, "Ethernet2.present = \"TRUE\"\n"); + push(@vmxfile, "Ethernet2.connectionType = \"custom\"\n"); + push(@vmxfile, "Ethernet2.vnet = \"$virtualswitch2\"\n"); + } + if(defined($virtualswitch3) && ($virtualswitch3)){ + push(@vmxfile, "Ethernet3.present = \"TRUE\"\n"); + push(@vmxfile, "Ethernet3.connectionType = \"custom\"\n"); + push(@vmxfile, "Ethernet3.vnet = \"$virtualswitch3\"\n"); + } } push(@vmxfile, "ethernet0.address = \"$vmclient_eth0MAC\"\n"); Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=958679&r1=958678&r2=958679&view=diff ============================================================================== --- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Mon Jun 28 18:56:10 2010 @@ -5461,6 +5461,8 @@ sub get_vmhost_info { vmprofile.vmpath AS vmprofile_vmpath, vmprofile.virtualswitch0 AS vmprofile_virtualswitch0, vmprofile.virtualswitch1 AS vmprofile_virtualswitch1, + vmprofile.virtualswitch2 AS vmprofile_virtualswitch2, + vmprofile.virtualswitch3 AS vmprofile_virtualswitch3, vmprofile.vmdisk AS vmprofile_vmdisk, vmprofile.username AS vmprofile_username, vmprofile.password AS vmprofile_password,