samuli-silvius's profile - activity

2018-12-03 04:41:17 -0600 received badge  Famous Question (source)
2018-12-03 04:41:17 -0600 received badge  Notable Question (source)
2018-12-03 04:41:17 -0600 received badge  Popular Question (source)
2016-07-05 02:10:43 -0600 received badge  Popular Question (source)
2016-01-21 04:53:52 -0600 received badge  Famous Question (source)
2015-02-18 20:57:58 -0600 received badge  Notable Question (source)
2015-02-18 20:57:58 -0600 received badge  Popular Question (source)
2013-08-08 10:37:48 -0600 asked a question Mechanism to detect compute node HW failure?

Does Openstack (e.g. nova compute) have a notification (of any kind; message, db-update, file...) if physical HW running compute node services is powered off?

How and when Openstack controller node notices that one of the compute node HW is down? VM instances status running in shutdown node will be somehow updated to database? But how about the whole node? Should it be just digged out from database by polling e.g. following tables: ... instances compute_nodes compute_node_stats ... (any other...?) and try to figure out if all VM's on some node is down we should do some actions (move VMs to another compute node)?

2013-07-01 09:31:13 -0600 asked a question Port is removed in instance delete and causes instance start failure with HARestarter

Using grizzly version from heta/opensatck.

Ports on template also removed when instance is deleted, is that normal? I have HARestarter policy and few alarms for instances in the template and when I issue heat-wacth command from command line:

heat-watch set-state teststack.Test_Instance_1_killed ALARM

Related instance is deleted ok, but it will also delete Port from with instance is dependent on. That will cause Instance start to fail as Port is not found.

See below my template and heat-engine.log and nova-api.log.

Template: { "AWSTemplateFormatVersion" : "2010-09-09",

"Description" : "Test template.",

"Parameters" : {

 "KeyName" : {
   "Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances",
   "Type" : "String"
 },

 "InstanceType" : {
   "Description" : "test instance type",
   "Type" : "String",
   "Default" : "m1.small",
   "AllowedValues" : [ "m1.small" ],
   "ConstraintDescription" : "must be a valid EC2 instance type."
 },

 "DemoDistribution": {
   "Default": "DemoV1",
   "Description" : "Demo distribution of choice",
   "Type": "String",
   "AllowedValues" : [ "DemoV1" ]
 }

},

"Mappings" : { "AWSInstanceType2Arch" : { "m1.small" : { "Arch" : "64" } }, "DistroArch2AMI": { "DemoV1" : { "64" : "ubuntu1304-v5-amd64" } } },

"Resources" : {

"private-network": {
  "Type": "OS::Quantum::Net"
},

"public-network": {
  "Type": "OS::Quantum::Net",
  "Properties": {
"value_specs": {"router:external" : true}
  }
},

"private-subnet": { "Type": "OS::Quantum::Subnet", "DependsOn" : "private-network", "Properties": { "network_id": { "Ref" : "private-network" }, "ip_version": 4, "cidr": "10.0.0.0/24", "gateway_ip": "10.0.0.1", "allocation_pools": [{"start": "10.0.0.2", "end": "10.0.0.20"}] } },

"public-subnet": { "Type": "OS::Quantum::Subnet", "DependsOn" : "public-network", "Properties": { "network_id": { "Ref" : "public-network" }, "ip_version": 4, "cidr": "192.168.0.0/24", "gateway_ip": "192.168.0.1", "allocation_pools": [{"start": "192.168.0.2", "end": "192.168.0.20"}] } },

"private-port": {
  "Type": "OS::Quantum::Port",
  "DependsOn" : "private-subnet",
  "Properties": {
    "network_id": { "Ref" : "private-network" }
  }
},

"private-port2": {
  "Type": "OS::Quantum::Port",
  "DependsOn" : "private-subnet",
  "Properties": {
    "network_id": { "Ref" : "private-network" }
  }
},

"router": {
"Type": "OS::Quantum::Router",
    "DependsOn" : "public-subnet"
},

 "router_interface": {
   "Type": "OS::Quantum::RouterInterface",
   "DependsOn" : "router",
   "Properties": {
     "router_id": { "Ref" : "router" },
     "subnet_id": { "Ref" : "private-subnet" }
   }
 },

"router_gateway_external": {
  "Type": "OS::Quantum::RouterGateway",
  "DependsOn" : "router_interface",
  "Properties": {
    "router_id": { "Ref" : "router" },
    "network_id": { "Ref" : "public-network" }
  }
},

 "testInst1": {
   "Type": "AWS::EC2::Instance",
   "Metadata" : {
     "AWS::CloudFormation::Init" : {
     }
   },
   "Properties": {

     "ImageId" : { "Fn::FindInMap" : [ "DistroArch2AMI", { "Ref" : "DemoDistribution" },
                       { "Fn::FindInMap" : [ "AWSInstanceType2Arch", { "Ref" : "InstanceType" }, "Arch" ] } ] },
     "InstanceType"   : { "Ref" : "InstanceType" },
     "KeyName"        : { "Ref" : "KeyName" },
 "NetworkInterfaces" : [ { "Ref" : "private-port" } ]
   } 
 },

"testInst2": {
   "Type": "AWS::EC2::Instance",
   "Metadata" : {
     "AWS::CloudFormation::Init" : {
     }
   },
   "Properties": {

     "ImageId" : { "Fn::FindInMap" : [ "DistroArch2AMI", { "Ref" : "DemoDistribution" },
                       { "Fn::FindInMap" : [ "AWSInstanceType2Arch", { "Ref" : "InstanceType" }, "Arch" ] } ] },
     "InstanceType"   : { "Ref" : "InstanceType" },
     "KeyName"        : { "Ref" : "KeyName" },
 "NetworkInterfaces" : [ { "Ref" : "private-port2" } ]
   } 
 },

"Test_Instance_1_RestartPolicy" : {
  "Type" : "OS::Heat::HARestarter",
  "Properties" : {
    "InstanceId" : { "Ref" : "testInst1" }
  }
},  
"Test_Instance_2_RestartPolicy" : {
  "Type" : "OS::Heat::HARestarter",
  "Properties" : {
    "InstanceId" : { "Ref" : "testInst2" }
  }
},

"AllFailureAlarm": {
 "Type": "AWS::CloudWatch::Alarm",
 "Properties": {
    "AlarmDescription": "Restart all instances",
    "MetricName": "VmInstanceFailure",
    "Namespace": "CGC/Vm",
    "Statistic": "SampleCount",
    "Period": "300",
    "EvaluationPeriods": "1",
    "Threshold": "2",
    "ComparisonOperator": "GreaterThanThreshold",
    "AlarmActions": [ { "Ref": "Test_Instance_1_RestartPolicy" }, { "Ref": "Test_Instance_2_RestartPolicy" } ]
  }
},  

"Test_Instance_1_killed": {
 "Type": "AWS::CloudWatch::Alarm",
 "Properties": {
    "AlarmDescription": "Restart the specific instance",
    "MetricName": "VmInstanceFailure",
    "Namespace": "CGC/Vm",
    "Statistic": "SampleCount",
    "Period": "300",
    "EvaluationPeriods": "1",
    "Threshold": "2",
    "ComparisonOperator": "GreaterThanThreshold",
    "AlarmActions": [ { "Ref": "Test_Instance_1_RestartPolicy" } ]
  }
},  

"Test_Instance_2_killed": {
 "Type": "AWS::CloudWatch::Alarm",
 "Properties": {
    "AlarmDescription": "Restart the specific instance",
    "MetricName": "VmInstanceFailure",
    "Namespace": "CGC/Vm",
    "Statistic": "SampleCount",
    "Period": "300",
    "EvaluationPeriods": "1",
    "Threshold": "2",
    "ComparisonOperator": "GreaterThanThreshold",
    "AlarmActions": [ { "Ref": "Test_Instance_2_RestartPolicy" } ]
  }
}

} }

heat-engine.log: 2013-07-01 19:57:14.279 12829 INFO heat.engine.watchrule [-] WATCH: stack:0d2f4fe7-c4f8-4c31-91d8-c92b0c83cba3, watch_name:teststack.Test_Instance_1_killed ALARM 2013-07-01 19:57:14.360 12829 DEBUG heat.engine.watchrule [-] Overriding state NODATA for watch teststack.Test_Instance_1_killed with ALARM set_watch_state ... (more)

2013-07-01 09:16:47 -0600 answered a question How to fill context for rpc call when calling heat engine

Hi,

I got it working like you suggested, putting my code running inside the heat-engine. Then there is no problem with passwords read from database with " db_api.user_creds_get(rs.stack.user_creds_id)".

But we will be working on to better solution (ceilometer integration) as suggested by you. Hope we could contribute at some point.

2013-06-27 09:31:54 -0600 answered a question How to fill context for rpc call when calling heat engine

Thanks for your replies so far!

For a short time solution I could try to integrate the whole functionality inside heat-engine as proposed. But this future solution sounds better as later we would also like to consume ceilometer meters concerning stack instances.

Our current use case is to get immediate info (nova notification) about instance stopped (e.g. killed with kill -9) and restart it if certain MetricName/Namespace defined in Alarm for that instance (having restarter policy also).

Is there already some ready code + examples templates about "webhook" way to get notifications to heat? Does that solution use ceilometer current (grizzly) api or does that need changes to ceilometer also?

This area heat-ceilometer and getting "fault management" and "performance management" related online information could be the area where to contribute if getting familiar enough to these plans.

2013-06-25 05:56:41 -0600 asked a question How to fill context for rpc call when calling heat engine

I have created heat extension which listens nova notifications "notifications.info" and does actions for instances in stacks accordingly (e.g. instance stopped could restart instance in stack). After received the notification I'm calling heat engine through RPC mechanism (i.e. using heat/heat/rpc/client.py and EngineClient class from there).

The problem is how to fill the context parameter correctly when calling heat engine? E.g. when I call set_watch_state(ctxt, watch_name, state) i.e. want to set alarm (whihc has restarter policy in my template). How to fill ctxt parameter correctly concerning passwords?

I can get stack related context from heat db with

        rs = db_api.resource_get_by_physical_resource_id(None, instance_id)
        if not rs:
            LOG.debug("No stack found for stopped instance '%s'. Do nothing." % instance_id)
            return                

        user_creds = db_api.user_creds_get(rs.stack.user_creds_id)
        stack_context = context.RequestContext.from_dict(user_creds)

with instanceId and then use stack_context successfully in any further db reads etc. But when using the same context in rpc call it fails to utf8 encoding as "password" and "service_password" are in some odd format when read from db.

Everything works if I in the code assign stack_context.password = "root" #my admin password happens to be root stack_context.service_password = "" # just set it empty to avoid utf8 encoding error

So how I get the password correctly?