diff --git a/Anvil/Tools/Get.pm b/Anvil/Tools/Get.pm index 340187ba..f29f2819 100644 --- a/Anvil/Tools/Get.pm +++ b/Anvil/Tools/Get.pm @@ -1255,11 +1255,13 @@ FROM ip_addresses b WHERE a.host_uuid = b.ip_address_host_uuid +AND + a.host_key != 'DELETED' AND b.ip_address_note != 'DELETED' AND - b.ip_address_address = ".$anvil->Database->quote($ip_address)."; -"; + b.ip_address_address = ".$anvil->Database->quote($ip_address)." +;"; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { query => $query }}); my $results = $anvil->Database->query({query => $query, source => $THIS_FILE, line => __LINE__}); my $count = @{$results}; diff --git a/tools/anvil-provision-server b/tools/anvil-provision-server index 0b034790..1da6ddd7 100755 --- a/tools/anvil-provision-server +++ b/tools/anvil-provision-server @@ -162,12 +162,16 @@ sub run_jobs $anvil->data->{job}{short_host_name} = $anvil->Get->short_host_name; $anvil->data->{job}{node1_short_host_name} = $anvil->data->{hosts}{host_uuid}{$node1_host_uuid}{short_host_name}; $anvil->data->{job}{node2_short_host_name} = $anvil->data->{hosts}{host_uuid}{$node2_host_uuid}{short_host_name}; + $anvil->data->{job}{drbd_local_node_id} = $host_uuid eq $node1_host_uuid ? 0 : 1; + $anvil->data->{job}{drbd_peer_node_id} = $host_uuid eq $node1_host_uuid ? 1 : 0; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { 'job::node1_host_uuid' => $anvil->data->{job}{node1_host_uuid}, 'job::node2_host_uuid' => $anvil->data->{job}{node2_host_uuid}, 'job::node1_short_host_name' => $anvil->data->{job}{node1_short_host_name}, 'job::node2_short_host_name' => $anvil->data->{job}{node2_short_host_name}, 'job::short_host_name' => $anvil->data->{job}{short_host_name}, + 'job::drbd_local_node_id' => $anvil->data->{job}{drbd_local_node_id}, + 'job::drbd_peer_node_id' => $anvil->data->{job}{drbd_peer_node_id}, }}); # We convert to extents as it ensure clean boundaries and, being based on bytes in both cases, gets @@ -676,7 +680,7 @@ sub startup_resource }); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "job_0195"}); - my $shell_call = $anvil->data->{path}{exe}{drbdsetup}." net-options ".$anvil->data->{job}{server_name}." 1 --set-defaults --_name=".$anvil->data->{job}{peer_short_name}." --protocol=C --fencing=dont-care"; + my $shell_call = $anvil->data->{path}{exe}{drbdsetup}." net-options ".$anvil->data->{job}{server_name}." ".$anvil->data->{job}{drbd_peer_node_id}." --set-defaults --_name=".$anvil->data->{job}{peer_short_name}." --protocol=C --fencing=dont-care"; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { shell_call => $shell_call }}); my ($output, $return_code) = $anvil->System->call({shell_call => $shell_call}); diff --git a/tools/test.pl b/tools/test.pl index 77f8141b..37a210f4 100755 --- a/tools/test.pl +++ b/tools/test.pl @@ -26,6 +26,6 @@ $anvil->Get->switches; $anvil->Database->connect({debug => 3}); $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, key => "log_0132"}); -$anvil->Cluster->assemble_storage_groups({debug => 2, anvil_uuid => '1aded871-fcb1-4473-9b97-6e9c246fc568'}); +$anvil->DRBD->gather_data({debug => 2}); $anvil->nice_exit({exit_code => 0});