Comment 0 for bug 1454515

Revision history for this message
Zhenyu Zheng (zhengzhenyu) wrote :

The property "instance.disable_terminate" is initialized using:

disable_terminate = Column(Boolean(), default=False)
in \nova\db\sqlalchemy\models.py

This property is then used in

1) compute\api:

def _delete(self, context, instance, delete_type, cb, **instance_attrs):
        if instance.disable_terminate:
            LOG.info(_LI('instance termination disabled'),
                     instance=instance)
            return

2) nova\api\ec2.py:

def _format_attr_disable_api_termination(instance, result):
            result['disableApiTermination'] = instance.disable_terminate

Since there are no API provided to modify this property, it is always "False".

There are two ways to fix this:

1) Add methods to modify this property in servers/create api and servers/update api
to make it actually functional.

2) Remove this property and modify nova\api\ec2.py, set result['disableApiTermination'] = False