harep: pure function to detect brokeness with instances
harep: pure function to detect brokeness with instances

Add a 'detectBroken' function that determines whether an instance is in an
unhealthy state, and what's needed to repair it. The repair is specified as
an AutoRepairType constant, and a list of opcodes. The opcodes will only be
executed (in following patches) if the repair type is allowed by the policy.

Signed-off-by: Dato Simó <16293852a0900193fe70fa7d24f714f37ba99a56@google.com>
Reviewed-by: Iustin Pop <acf83a5274f31a43af6b914614365999469c1a31@google.com>

ganeti/ganeti,dimara/ganeti,mbakke/ganeti,ganeti-github-testing/ganeti-test-1,mbakke/ganeti,leshchevds/ganeti,yiannist/ganeti,ganeti-github-testing/ganeti-test-1,ganeti/ganeti,apyrgio/snf-ganeti,grnet/snf-ganeti,onponomarev/ganeti,apyrgio/ganeti,yiannist/ganeti,apyrgio/ganeti,onponomarev/ganeti,apyrgio/snf-ganeti,yiannist/ganeti,dimara/ganeti,leshchevds/ganeti,andir/ganeti,leshchevds/ganeti,grnet/snf-ganeti,mbakke/ganeti,andir/ganeti,ganeti/ganeti,andir/ganeti,bitemyapp/ganeti,bitemyapp/ganeti