<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi Simon<br>
      <br>
      There is an existing Launchpad bug for this issue:<br>
      <meta http-equiv="content-type" content="text/html;
        charset=ISO-8859-1">
      <a href="https://bugs.launchpad.net/heat/+bug/1096013">https://bugs.launchpad.net/heat/+bug/1096013</a><br>
      <br>
      I've added your email to the comments.  I'll most likely be
      working on this area next so I'll let you know when there is a
      change in the current behavior.<br>
      <br>
      cheers<br>
      <br>
      On 02/05/2013 10:40 PM, Simon Pasquier wrote:<br>
    </div>
    <blockquote
cite="mid:CAPrrXedw7ygWrJT2JgJZ+qMsmrJ1m-AHf=C_EcJFuhYV-sePQg@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi all,
        <div><br>
        </div>
        <div style="">I have some questions regarding the integration of
          Quantum in Heat:</div>
        <div style="">- I haven't found a way to attach an instance
          resource to a Quantum port that already exists. Is it
          possible?<br>
        </div>
        <div style="">- When I create a Quantum port in my template and
          binds the instance to that port, why does Heat still create an
          additional port to the tenant-owned network?</div>
        <div style=""><br>
        </div>
        <div style="">I have created a very simple template to test:</div>
        <div style=""><br>
        </div>
        <div style="">
          <div>{</div>
          <div>  "AWSTemplateFormatVersion" : "2010-09-09",</div>
          <div><br>
          </div>
          <div>  "Description" : "Test creation of Quantum resources
            with a very simple instance",</div>
          <div><br>
          </div>
          <div>  "Parameters" : {</div>
          <div><br>
          </div>
          <div>    "KeyName" : {</div>
          <div>      "Description" : "Name of an existing EC2 KeyPair to
            enable SSH access to the instances",</div>
          <div>      "Type" : "String"</div>
          <div>    },</div>
          <div><br>
          </div>
          <div>    "NetworkUuid" : {</div>
          <div>      "Description" : "Network UUID",</div>
          <div>      "Type" : "String"</div>
          <div>    },</div>
          <div><br>
          </div>
          <div>    "SubnetUuid" : {</div>
          <div>      "Description" : "Network UUID",</div>
          <div>      "Type" : "String"</div>
          <div>    }</div>
          <div>  },</div>
          <div><br>
          </div>
          <div>  "Resources" : {</div>
          <div>    "QuantumPort": {</div>
          <div>      "Type": "OS::Quantum::Port",</div>
          <div>      "Properties": {</div>
          <div>        "network_id": { "Ref" : "NetworkUuid" },</div>
          <div>        "device_id": { "Ref": "CirrosInstance" },</div>
          <div>        "fixed_ips": [{</div>
          <div>          "subnet_id": { "Ref" : "SubnetUuid" },</div>
          <div>          "ip_address": "10.0.0.100"</div>
          <div>        }]</div>
          <div>      }</div>
          <div>    },</div>
          <div><br>
          </div>
          <div>    "DefaultSecurityGroup" : {</div>
          <div>      "Type" : "AWS::EC2::SecurityGroup",</div>
          <div>      "Properties" : {</div>
          <div>        "GroupDescription" : "Enable ICMP plus SSH
            access",</div>
          <div>        "SecurityGroupIngress" : [</div>
          <div>          {"IpProtocol" : "icmp", "FromPort" : "-1",
            "ToPort" : "-1", "CidrIp" : "<a moz-do-not-send="true"
              href="http://0.0.0.0/0">0.0.0.0/0</a>"},</div>
          <div>          {"IpProtocol" : "tcp", "FromPort" : "22",
            "ToPort" : "22", "CidrIp" : "<a moz-do-not-send="true"
              href="http://0.0.0.0/0">0.0.0.0/0</a>"}</div>
          <div>        ]</div>
          <div>      }</div>
          <div>    },</div>
          <div><br>
          </div>
          <div>    "CirrosInstance": {</div>
          <div>      "Type": "AWS::EC2::Instance",</div>
          <div>      "Properties": {</div>
          <div>        "ImageId" : "cirros-0.3.0-x86_64-uec",</div>
          <div>        "InstanceType"   : "m1.nano",</div>
          <div>        "KeyName"        : { "Ref" : "KeyName" },</div>
          <div>        "SecurityGroups" : [ {"Ref" :
            "DefaultSecurityGroup"} ]</div>
          <div>      }</div>
          <div>    }</div>
          <div>  },</div>
          <div><br>
          </div>
          <div>  "Outputs" : {</div>
          <div>    "InstanceIPAddress" : {</div>
          <div>      "Value" : { "Fn::GetAtt" : ["CirrosInstance",
            "PrivateIp"] },</div>
          <div>      "Description": "Private IP address of the instance"</div>
          <div>    }</div>
          <div>  }</div>
          <div>}</div>
          <div><br>
          </div>
        </div>
        <div style="">For my tests, I use devstack and the Open vSwitch
          plugin. After the stack is created, the instance is up and
          running but it is connected to 2 ports:<br>
        </div>
        <div style=""><br>
        </div>
        <div style="">
          <div style="">
            <div>$ heat stack-show cirros<br>
            </div>
          </div>
          <div style="">
            <div>+----------------------+-----------------------------------------------------------------------------------------------------------------+</div>
            <div>| Property             | Value                        
                                                                       
                                      |</div>
            <div>+----------------------+-----------------------------------------------------------------------------------------------------------------+</div>
            <div>| capabilities         | []                            
                                                                       
                                     |</div>
            <div>| creation_time        | 2013-02-05T09:11:39Z          
                                                                       
                                     |</div>
            <div>| description          | Test creation of Quantum
              resources with a very simple                              
                                          |</div>
            <div>|                      | instance                      
                                                                       
                                     |</div>
            <div>| disable_rollback     | True                          
                                                                       
                                     |</div>
            <div>| id                   |
              8c161ed2-691e-42e8-a872-e90f26a83ac5                      
                                                                   |</div>
            <div>| links                | <a moz-do-not-send="true"
href="http://192.168.1.94:8004/v1/bc7d29521a444d59b1d68f1e0a81ce90/stacks/cirros/8c161ed2-691e-42e8-a872-e90f26a83ac5">http://192.168.1.94:8004/v1/bc7d29521a444d59b1d68f1e0a81ce90/stacks/cirros/8c161ed2-691e-42e8-a872-e90f26a83ac5</a>
              |</div>
            <div>| notification_topics  | []                            
                                                                       
                                     |</div>
            <div>| outputs              | [                            
                                                                       
                                      |</div>
            <div>|                      |   {                          
                                                                       
                                      |</div>
            <div>|                      |     "output_value":
              "10.0.0.3",                                              
                                                |</div>
            <div>|                      |     "description": "Private IP
              address of the instance",                                
                                     |</div>
            <div>|                      |     "output_key":
              "InstanceIPAddress"                                      
                                                  |</div>
            <div>|                      |   }                          
                                                                       
                                      |</div>
            <div>|                      | ]                            
                                                                       
                                      |</div>
            <div>| parameters           | {                            
                                                                       
                                      |</div>
            <div>|                      |   "NetworkUuid":
              "e5b6584f-9ca8-4219-b2d4-1a2f56a502fe",                  
                                                   |</div>
            <div>|                      |   "SubnetUuid":
              "1aa32a3e-ec28-44aa-867c-fcb4f774fa43",                  
                                                    |</div>
            <div>|                      |   "AWS::StackName": "cirros",
                                                                       
                                      |</div>
            <div>|                      |   "KeyName": "test",          
                                                                       
                                     |</div>
            <div>|                      |   "AWS::Region":
              "ap-southeast-1"                                          
                                                  |</div>
            <div>|                      | }                            
                                                                       
                                      |</div>
            <div>| stack_name           | cirros                        
                                                                       
                                     |</div>
            <div>| stack_status         | CREATE_COMPLETE              
                                                                       
                                      |</div>
            <div>| stack_status_reason  | Stack successfully created    
                                                                       
                                     |</div>
            <div>| template_description | Test creation of Quantum
              resources with a very simple                              
                                          |</div>
            <div>|                      | instance                      
                                                                       
                                     |</div>
            <div>| timeout_mins         | 60                            
                                                                       
                                     |</div>
            <div>| updated_time         | 2013-02-05T09:12:02Z          
                                                                       
                                     |</div>
            <div>+----------------------+-----------------------------------------------------------------------------------------------------------------+</div>
            <div>$ nova show cirros.CirrosInstance<br>
            </div>
          </div>
          <div>
            <div>+-------------------------------------+----------------------------------------------------------------+</div>
            <div>| Property                            | Value          
                                                             |</div>
            <div>+-------------------------------------+----------------------------------------------------------------+</div>
            <div>| OS-DCF:diskConfig                   | MANUAL        
                                                              |</div>
            <div>| OS-EXT-SRV-ATTR:host                | controller    
                                                              |</div>
            <div>| OS-EXT-SRV-ATTR:hypervisor_hostname | controller    
                                                              |</div>
            <div>| OS-EXT-SRV-ATTR:instance_name       |
              instance-00000015                                        
                   |</div>
            <div>| OS-EXT-STS:power_state              | 1              
                                                             |</div>
            <div>| OS-EXT-STS:task_state               | None          
                                                              |</div>
            <div>| OS-EXT-STS:vm_state                 | active        
                                                              |</div>
            <div>| accessIPv4                          |                
                                                             |</div>
            <div>| accessIPv6                          |                
                                                             |</div>
            <div>| config_drive                        |                
                                                             |</div>
            <div>| created                             |
              2013-02-05T09:11:43Z                                      
                  |</div>
            <div>| flavor                              | m1.nano (42)  
                                                              |</div>
            <div>| hostId                              |
              495aafe7667bb70bb90e80cbfff9921d2929d909bef01bb93189b631  
                  |</div>
            <div>| id                                  |
              46f1542b-3c4c-4849-bf05-488aba266e06                      
                  |</div>
            <div>| image                               |
              cirros-0.3.0-x86_64-uec
              (3fecb845-3833-4731-beb6-cee4b6aca969) |</div>
            <div>| key_name                            | test          
                                                              |</div>
            <div>| metadata                            | {}            
                                                              |</div>
            <div>| name                                |
              cirros.CirrosInstance                                    
                   |</div>
            <div>| private network                     | 10.0.0.3,
              10.0.0.100                                           |</div>
            <div>| progress                            | 0              
                                                             |</div>
            <div>| security_groups                     | [{u'name':
              u'cirros.DefaultSecurityGroup'}]                    |</div>
            <div>| status                              | ACTIVE        
                                                              |</div>
            <div>| tenant_id                           |
              bc7d29521a444d59b1d68f1e0a81ce90                          
                  |</div>
            <div>| updated                             |
              2013-02-05T09:12:00Z                                      
                  |</div>
            <div>| user_id                             |
              b8827fae4f7c4a0194b77ea3784d25d7                          
                  |</div>
            <div>+-------------------------------------+----------------------------------------------------------------+</div>
          </div>
          <div><br>
          </div>
          <div style="">And the port created by the heat template is in
            DOWN state:</div>
          <div style=""><br>
          </div>
          <div>
            <div>$ quantum port-show
              e22bda12-e062-4c13-ad99-85f0ea994e9e</div>
            <div>+----------------------+-----------------------------------------------------------------------------------+</div>
            <div>| Field                | Value                        
                                                                  |</div>
            <div>+----------------------+-----------------------------------------------------------------------------------+</div>
            <div>| admin_state_up       | True                          
                                                                 |</div>
            <div>| binding:capabilities | {"port_filter": false}        
                                                                 |</div>
            <div>| binding:vif_type     | ovs                          
                                                                  |</div>
            <div>| device_id            |
              46f1542b-3c4c-4849-bf05-488aba266e06                      
                                     |</div>
            <div>| device_owner         |                              
                                                                  |</div>
            <div>| fixed_ips            | {"subnet_id":
              "1aa32a3e-ec28-44aa-867c-fcb4f774fa43", "ip_address":
              "10.0.0.100"} |</div>
            <div>| id                   |
              e22bda12-e062-4c13-ad99-85f0ea994e9e                      
                                     |</div>
            <div>| mac_address          | fa:16:3e:04:8a:56            
                                                                  |</div>
            <div>| name                 | QuantumPort                  
                                                                  |</div>
            <div>| network_id           |
              e5b6584f-9ca8-4219-b2d4-1a2f56a502fe                      
                                     |</div>
            <div>| status               | DOWN                          
                                                                 |</div>
            <div>| tenant_id            |
              bc7d29521a444d59b1d68f1e0a81ce90                          
                                     |</div>
            <div>+----------------------+-----------------------------------------------------------------------------------+</div>
          </div>
          <div><br>
          </div>
          <div style="">Thanks in advance for the answers,</div>
          <div><br>
          </div>
          <div style="">Simon</div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Mailing list: <a class="moz-txt-link-freetext" href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a>
Post to     : <a class="moz-txt-link-abbreviated" href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a>
Unsubscribe : <a class="moz-txt-link-freetext" href="https://launchpad.net/~openstack">https://launchpad.net/~openstack</a>
More help   : <a class="moz-txt-link-freetext" href="https://help.launchpad.net/ListHelp">https://help.launchpad.net/ListHelp</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>