| 23 | | my $clients = HoneyClient::Manager::Database::get_broken_clients($args); |
|---|
| 24 | | |
|---|
| 25 | | while (my ($cid, $id) = each %{$clients}) { |
|---|
| 26 | | |
|---|
| 27 | | $LOG->info("Deleting VM (" . $cid . ")"); |
|---|
| 28 | | |
|---|
| 29 | | $LOG->info("Executing: vmware-cmd " . $datastore_path . "/" . $cid . "/*.vmx stop hard"); |
|---|
| 30 | | system("vmware-cmd " . $datastore_path . "/" . $cid . "/*.vmx stop hard"); |
|---|
| 31 | | |
|---|
| 32 | | $LOG->info("Executing: vmware-cmd " . $datastore_path . "/" . $cid . "/*.cfg stop hard"); |
|---|
| 33 | | system("vmware-cmd " . $datastore_path . "/" . $cid . "/*.cfg stop hard"); |
|---|
| 34 | | |
|---|
| 35 | | $LOG->info("Executing: vmware-cmd -s unregister " . $datastore_path . "/" . $cid . "/*.vmx"); |
|---|
| 36 | | system("vmware-cmd -s unregister " . $datastore_path . "/" . $cid . "/*.vmx"); |
|---|
| 37 | | |
|---|
| 38 | | $LOG->info("Executing: vmware-cmd -s unregister " . $datastore_path . "/" . $cid . "/*.cfg"); |
|---|
| 39 | | system("vmware-cmd -s unregister " . $datastore_path . "/" . $cid . "/*.cfg"); |
|---|
| 40 | | |
|---|
| 41 | | $LOG->info("Executing: rm -rf " . $datastore_path . "/" . $cid); |
|---|
| 42 | | system("rm -rf " . $datastore_path . "/" . $cid); |
|---|
| 43 | | |
|---|
| 44 | | $LOG->info("Executing: rm -f " . $snapshot_path . "/" . $cid . "*"); |
|---|
| 45 | | system("rm -f " . $snapshot_path . "/" . $cid . "*"); |
|---|
| 46 | | |
|---|
| 47 | | HoneyClient::Manager::Database::set_client_deleted($id); |
|---|
| 48 | | |
|---|
| 49 | | print "\n"; |
|---|
| 50 | | } |
|---|
| 51 | | |
|---|
| | 23 | exit HoneyClient::Manager::Database::client_exists($args); |
|---|