Switch to using memorycache from oslo.

Change-Id: I11ee70b36f06bc4a45b5ff207e53a331891a6bfa
Implement rules_exist method for quantum security group driver

Originally I thought the quantum security group driver should
not enforce rules exist on the nova-api side and instead it should
just forward the request to quantum which would return the error.
That said there is no extra cost to doing this on the nova-api side
as nova-api already queries for the group before adding the rule.

In addition, rules_exists() is used in revoke_security_group_ingress()
for the ec2 compat APIs so this needs to be implemented.

This patch moves create_security_group_rule() and rule_exists() from
nova/compute/api.py to nova/network/security_group/security_group_base.py
as the same code can be leveraged in both places.

Fixes bug 1136345

Change-Id: I444ffc2b53b30ed496b6e3250433d14f316e594d
Set vm_state to ERROR on net deallocate failure.

If deallocate_network_for_instance from network.api fails while trying
to terminate an instance, set the vm_state to ERROR.  Previously it
still completely failed at this point, but the instance vm_state was
still ACTIVE but the task_state was stuck in deleting.  Now it will be
ERROR/deleting.

Fix bug 1110221.

Change-Id: I181a11c8de667fa462e1a2cb75b2c8ae41410273
Merge "Switch to using memorycache from oslo."
Merge "Implement rules_exist method for quantum security group driver"
Merge "Set vm_state to ERROR on net deallocate failure."