Author: fapeeler
Date: Thu Jul 15 19:13:50 2010
New Revision: 964545
URL: http://svn.apache.org/viewvc?rev=964545&view=rev
Log:
VCL-224
moved VMWARE_MAC_ETHX_GENERATED to database
Only affected prov modules are legacy vmware esx modules
Modified:
incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm
incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esx.pm
incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esxthin.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=964545&r1=964544&r2=964545&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/DataStructure.pm Thu Jul 15
19:13:50 2010
@@ -254,6 +254,8 @@ $SUBROUTINE_MAPPINGS{vmhost_profile_vmdi
$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}';
$SUBROUTINE_MAPPINGS{vmhost_profile_password} =
'$self->request_data->{reservation}{RESERVATION_ID}{computer}{vmhost}{vmprofile}{password}';
+$SUBROUTINE_MAPPINGS{vmhost_profile_eth0generated} =
'$self->request_data->{reservation}{RESERVATION_ID}{computer}{vmhost}{vmprofile}{eth0generated}';
+$SUBROUTINE_MAPPINGS{vmhost_profile_eth1generated} =
'$self->request_data->{reservation}{RESERVATION_ID}{computer}{vmhost}{vmprofile}{eth1generated}';
#$SUBROUTINE_MAPPINGS{vmhost_typeid} =
'$self->request_data->{reservation}{RESERVATION_ID}{computer}{vmhost}{vmprofile}{vmtypeid}';
$SUBROUTINE_MAPPINGS{vmhost_type_id} =
'$self->request_data->{reservation}{RESERVATION_ID}{computer}{vmhost}{vmprofile}{vmtype}{id}';
Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esx.pm
URL:
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esx.pm?rev=964545&r1=964544&r2=964545&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esx.pm
(original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esx.pm Thu
Jul 15 19:13:50 2010
@@ -162,6 +162,8 @@ sub load {
my $vmhost_username = $self->data->get_vmhost_profile_username();
my $vmhost_password = $self->data->get_vmhost_profile_password();
+ my $vmhost_eth0generated =
$self->data->get_vmhost_profile_eth0generated();
+ my $vmhost_eth1generated =
$self->data->get_vmhost_profile_eth1generated();
$vmhost_hostname =~ /([-_a-zA-Z0-9]*)(\.?)/;
my $vmhost_shortname = $1;
@@ -310,7 +312,7 @@ sub load {
push(@vmxfile, "ethernet0.wakeOnPcktRcv = \"false\"\n");
push(@vmxfile, "ethernet1.wakeOnPcktRcv = \"false\"\n");
- if ($VMWARE_MAC_ETH0_GENERATED) {
+ if ($vmhost_eth0generated) {
# Let vmware host define the MAC addresses
notify($ERRORS{'OK'}, 0, "eth0 MAC address set for vmware
generated");
push(@vmxfile, "ethernet0.addressType = \"generated\"\n");
@@ -321,7 +323,7 @@ sub load {
push(@vmxfile, "ethernet0.address = \"$vmclient_eth0MAC\"\n");
push(@vmxfile, "ethernet0.addressType = \"static\"\n");
}
- if ($VMWARE_MAC_ETH1_GENERATED) {
+ if (vmhost_eth1generated) {
# Let vmware host define the MAC addresses
notify($ERRORS{'OK'}, 0, "eth1 MAC address set for vmware
generated $vmclient_eth0MAC");
push(@vmxfile, "ethernet1.addressType = \"generated\"\n");
@@ -416,7 +418,7 @@ sub load {
my $arpstatus = 0;
my $client_ip;
- if ($VMWARE_MAC_ETH0_GENERATED) {
+ if ($vmhost_eth0generated) {
# allowing vmware to generate the MAC address
# find out what MAC got assigned
# find out what IP address is assigned to this MAC
@@ -478,7 +480,7 @@ sub load {
# Add new entry to /etc/hosts for $computer_shortname
`echo -e "$client_ip\t$computer_shortname" >> /etc/hosts`;
- } ## end if ($VMWARE_MAC_ETH0_GENERATED)
+ } ## end if ($vmhost_eth0generated)
else {
notify($ERRORS{'OK'}, 0, "IP is known for $computer_shortname");
}
Modified:
incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esxthin.pm
URL:
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esxthin.pm?rev=964545&r1=964544&r2=964545&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esxthin.pm
(original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/esxthin.pm
Thu Jul 15 19:13:50 2010
@@ -172,6 +172,10 @@ sub load {
my $vmhost_username = $self->data->get_vmhost_profile_username();
my $vmhost_password = $self->data->get_vmhost_profile_password();
+
+ my $vmhost_eth0generated =
$self->data->get_vmhost_profile_eth0generated();
+ my $vmhost_eth1generated =
$self->data->get_vmhost_profile_eth1generated();
+
$vmhost_hostname =~ /([-_a-zA-Z0-9]*)(\.?)/;
my $vmhost_shortname = $1;
@@ -379,7 +383,7 @@ sub load {
push(@vmxfile, "ethernet0.wakeOnPcktRcv = \"false\"\n");
push(@vmxfile, "ethernet1.wakeOnPcktRcv = \"false\"\n");
- if ($VMWARE_MAC_ETH0_GENERATED) {
+ if ($vmhost_eth0generated) {
# Let vmware host define the MAC addresses
notify($ERRORS{'OK'}, 0, "eth0 MAC address set for vmware
generated");
push(@vmxfile, "ethernet0.addressType = \"generated\"\n");
@@ -390,7 +394,7 @@ sub load {
push(@vmxfile, "ethernet0.address = \"$vmclient_eth0MAC\"\n");
push(@vmxfile, "ethernet0.addressType = \"static\"\n");
}
- if ($VMWARE_MAC_ETH1_GENERATED) {
+ if ($vmhost_eth1generated) {
# Let vmware host define the MAC addresses
notify($ERRORS{'OK'}, 0, "eth1 MAC address set for vmware
generated $vmclient_eth0MAC");
push(@vmxfile, "ethernet1.addressType = \"generated\"\n");
@@ -480,7 +484,7 @@ sub load {
my $arpstatus = 0;
my $client_ip;
- if ($VMWARE_MAC_ETH0_GENERATED) {
+ if ($vmhost_eth0generated) {
# allowing vmware to generate the MAC address
# find out what MAC got assigned
# find out what IP address is assigned to this MAC
@@ -542,7 +546,7 @@ sub load {
# Add new entry to /etc/hosts for $computer_shortname
`echo -e "$client_ip\t$computer_shortname" >> /etc/hosts`;
- } ## end if ($VMWARE_MAC_ETH0_GENERATED)
+ } ## end if ($vmhost_eth0generated)
else {
notify($ERRORS{'OK'}, 0, "IP is known for $computer_shortname");
}
Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm
URL:
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=964545&r1=964544&r2=964545&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Thu Jul 15 19:13:50 2010
@@ -231,8 +231,6 @@ our @EXPORT = qw(
$SYSADMIN
$TOOLS
$VERBOSE
- $VMWARE_MAC_ETH0_GENERATED
- $VMWARE_MAC_ETH1_GENERATED
$WRTPASS
$WRTUSER
$XMLRPC_USER
@@ -255,7 +253,6 @@ INIT {
our ($FQDN) = 0;
our ($MYSQL_SSL, $MYSQL_SSL_CERT);
our ($IPCONFIGURATION, $DNSserver, $GATEWAY, $NETMASK, $ETHDEVICE) = 0;
- our ($VMWARE_MAC_ETH0_GENERATED, $VMWARE_MAC_ETH1_GENERATED);
our ($WINDOWS_ROOT_PASSWORD);
our ($XMLRPC_USER, $XMLRPC_PASS, $XMLRPC_URL);
@@ -456,20 +453,7 @@ INIT {
$PROCESSNAME = $1;
}
- #vmware settings
- #$VMWARE_MAC_ETHO_GENERATED
- if ($l =~ /^VMWARE_MAC_ETH0_GENERATED=(yes|no)/i) {
- $VMWARE_MAC_ETH0_GENERATED = 1 if ($1 =~
/yes/i);
- $VMWARE_MAC_ETH0_GENERATED = 0 if ($1 =~ /no/i);
- }
-
- #$VMWARE_MAC_ETH1_GENERATED
- if ($l =~ /^VMWARE_MAC_ETH1_GENERATED=(yes|no)/i) {
- $VMWARE_MAC_ETH1_GENERATED = 1 if ($1 =~
/yes/i);
- $VMWARE_MAC_ETH1_GENERATED = 0 if ($1 =~ /no/i);
- }
-
if ($l =~ /^windows_root_password=(.*)/i) {
$WINDOWS_ROOT_PASSWORD = $1;
}
@@ -5346,6 +5330,8 @@ sub get_vmhost_info {
vmprofile.vmdisk AS vmprofile_vmdisk,
vmprofile.username AS vmprofile_username,
vmprofile.password AS vmprofile_password,
+ vmprofile.vmware_mac_eth0_generated AS vmprofile_eth0generated,
+ vmprofile.vmware_mac_eth1_generated AS vmprofile_eth1generated,
vmtype.id AS vmtype_id,
vmtype.name AS vmtype_name,