1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

Automatic deregistering of VMWare VM if it cannot be powered on.

git-svn-id: http://svn.opennebula.org/one/trunk@683 3034c82b-c49b-4eb3-8279-a7acafdc01c0
This commit is contained in:
Constantino Vázquez Blanco 2009-07-13 17:07:25 +00:00
parent 9a15296c11
commit 93c88292bc

View File

@ -90,7 +90,7 @@ class OneVmmVmware extends Thread
hostName = null;
fileName = null;
// Read a line a parse it
// Read a line and parse it
try
{
str = in.readLine();
@ -163,6 +163,15 @@ class OneVmmVmware extends Thread
if(!dVM.shapeVM())
{
// Will try and deregister VM
try
{
oVM = new OperationsOverVM(arguments,hostName);
String vmName = pXML.getName() + "-" + vid_str;
oVM.deregisterVM(vmName);
}
catch(Exception e){}
throw new Exception("Error reconfiguring VM (" + pXML.getName() + ").");
}
@ -182,6 +191,14 @@ class OneVmmVmware extends Thread
if(!oVM.powerOn(pXML.getName() + "-" + vid_str))
{
// Will try and deregister VM
try
{
oVM = new OperationsOverVM(arguments,hostName);
String vmName = pXML.getName() + "-" + vid_str;
oVM.deregisterVM(vmName);
}
catch(Exception e){}
throw new Exception("Error powering on VM(" + pXML.getName() + ").");
}