mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-11 04:58:16 +03:00
feature #662: Do not drop hosts with running vms
This commit is contained in:
parent
b6ff150f5e
commit
d6017d4ba4
@ -139,6 +139,19 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
int drop(PoolObjectSQL * objsql, string& error_msg)
|
||||
{
|
||||
Host * host = static_cast<Host *>(objsql);
|
||||
|
||||
if ( host->get_share_running_vms() > 0 )
|
||||
{
|
||||
error_msg = "Can not remove a host with running VMs";
|
||||
return -1;
|
||||
}
|
||||
|
||||
return PoolSQL::drop(objsql, error_msg);
|
||||
};
|
||||
|
||||
/**
|
||||
* Dumps the HOST pool in XML format. A filter can be also added to the
|
||||
* query
|
||||
|
Loading…
x
Reference in New Issue
Block a user