Ask OpenStack: Q&A Site for OpenStack Users and Developers - Latest question feedhttps://ask.openstack.org/en/questions/Questions and answers OpenStack CommunityenCopyright of the authors unless stated otherwiseThu, 06 Sep 2018 08:31:49 -0500heat template for Mitaka release with a loophttps://ask.openstack.org/en/question/116026/heat-template-for-mitaka-release-with-a-loop/Hi team,
My heat template looks like this:
---
description: "blah
blah"
heat_template_version: 2016-04-08
parameters:
flavor_name:
default: SMALL
type: string
image_id:
default: centos
type: string
public_net:
default: d8772e7a-07b1-4273-beb6-860fb54e54c1
type: string
subnetwork:
default: b4cb500a-aa47-4f74-8fe4-d68ddc94c94b
type: string
secgroup_id:
default: default
type: string
resources:
server1:
properties:
flavor:
get_param: flavor_name
image:
get_param: image_id
name: Server1
networks:
-
port:
get_resource: port1x10
type: "OS::Nova::Server"
port1:
properties:
name: port1
fixed_ips:
- subnet_id: { get_param: subnetwork }
- subnet_id: { get_param: subnetwork }
- subnet_id: { get_param: subnetwork }
- subnet_id: { get_param: subnetwork }
- subnet_id: { get_param: subnetwork }
- subnet_id: { get_param: subnetwork }
- subnet_id: { get_param: subnetwork }
- subnet_id: { get_param: subnetwork }
- subnet_id: { get_param: subnetwork }
network_id:
get_param: public_net
security_groups:
-
get_param: secgroup_id
type: "OS::Neutron::Port"
My "mission" to remove repeating lines: "**- subnet_id: { get_param: subnetwork }**"
I was looking at *count: 180*
but count is not recognised in here...
I found
repeat:
for_each:
var: list
template:
- subnet_id: { get_param: subnetwork }
But how to make this list so I could add like 180 or 110 and 70 IP's to the port... ?
Any ideas?BiG_NoBoDyThu, 06 Sep 2018 08:31:49 -0500https://ask.openstack.org/en/question/116026/How to get the IP address of Host Machine from VM launched on it?https://ask.openstack.org/en/question/106609/how-to-get-the-ip-address-of-host-machine-from-vm-launched-on-it/ I have VMs running on my Openstack Cloud setup. I wan't to get the IP address of host machine from VM for some application purpose. How can I determine it.MohanMon, 15 May 2017 00:55:10 -0500https://ask.openstack.org/en/question/106609/HEAT syntax for multiple fixed_ips as a parameterhttps://ask.openstack.org/en/question/95212/heat-syntax-for-multiple-fixed_ips-as-a-parameter/ I am trying to create a HEAT template that will use 'allowed_address_pairs' and neutron ports to support the concept of a virtual IP address shared between instances for an application similar to VRRP.
I've followed the examples from http://superuser.openstack.org/articles/implementing-high-availability-instances-with-neutron-using-vrrp and from https://github.com/nvpnathan/heat/blob/master/allowed-address-pairs.yaml to come up with my own template to achieve this, and it works great for a single virtual IP address.
Here is what that template looks like:
heat_template_version: 2013-05-23
description: Simple template using allowed_address_pairs for a virtual IP
parameters:
image:
type: string
label: Image name or ID
description: Image to be used for compute instance
default: "cirros"
flavor:
type: string
label: Flavor
description: Type of instance (flavor) to be used
default: "t1.small"
key:
type: string
label: Key name
description: Name of key-pair to be used for compute instance
default: "mykey"
ext_network:
type: string
label: External network name or ID
description: External network that can assign a floating IP
default: "provider"
test_virtual_ip:
type: string
label: Virtual IP address
description: Virtual IP address that can be used on different instances
default: "192.168.10.101"
resources:
# Create the internal test network
test_net:
type: OS::Neutron::Net
properties:
admin_state_up: true
name: test_net
# Create a subnet on the test network
test_subnet:
type: OS::Neutron::Subnet
properties:
name: test_subnet
cidr: 192.168.10.2/24
enable_dhcp: true
allocation_pools: [{end: 192.168.10.99, start: 192.168.10.10}]
gateway_ip: 192.168.10.1
network_id: { get_resource: test_net }
# Create router for the test network
test_router:
type: OS::Neutron::Router
properties:
admin_state_up: true
name: test_router
external_gateway_info: { "network": { get_param: ext_network }}
# Create router interface and attach to subnet
test_router_itf:
type: OS::Neutron::RouterInterface
properties:
router_id: { get_resource: test_router }
subnet_id: { get_resource: test_subnet }
# Create extra port for a virtual IP address
test_vip_port:
type: OS::Neutron::Port
properties:
network_id: { get_resource: test_net }
fixed_ips:
- ip_address: { get_param: test_virtual_ip }
# Create instance ports that have an internal IP and the virtual IP
instance1_test_vip_port:
type: OS::Neutron::Port
properties:
admin_state_up: true
network_id: { get_resource: test_net }
allowed_address_pairs:
- ip_address: { get_param: test_virtual_ip}
security_groups:
- default
# Create instances
test_instance_1:
type: OS::Nova::Server
properties:
name: instance1
image: { get_param: image }
flavor: { get_param: flavor }
key_name: { get_param: key }
networks:
- port: { get_resource: instance1_test_vip_port }
user_data_format: RAW
user_data: |
#cloud-config
password: mysecret
chpasswd: { expire: False }
ssh_pwauth: True
final_message: "The system is up after $UPTIME sec"
outputs:
instance1_ip:
description: IP address of the first instance
value: { get_attr: [test_instance_1, first_address] }
So far so good. Now I need to take this to the next level and assign multiple IP addresses that can be used as virtual IPs within an instance. The problem is that it is not known in advance how many will be needed when the instance is launched, so it needs to be a parameter and cannot simply be hard-coded as
- ip_address: {get_param: ip1}
- ip_address: {get_param: ip2}
and so on
In other words, the parameter test_virtual_ip needs to be a list of IP addresses rather than a single IP address, e.g. "191.168.10.101, 192.168.10.102, 192.168.10.103"
This impacts the definitions for test_vip_port and instance1_test_vip_port, but I can't figure out the correct syntax.
I tried this:
...
# Create extra port for a virtual IP address
test_vip_port:
type: OS::Neutron::Port
properties:
network_id: { get_resource: test_net }
fixed_ips: [{ get_param: test_virtual_ip }]
# Create instance ports that have an internal IP and the virtual IP
instance1_test_vip_port:
type: OS::Neutron::Port
properties:
admin_state_up: true
network_id: { get_resource: test_net }
allowed_address_pairs: [{ get_param: test_virtual_ip}]
security_groups:
- default
...
But get error "unicode object has no attribute get" when I try to launch the stack.
What is the proper syntax for providing a list of IP addresses as a parameter to the **OS::Neutron::Port::fixed_ips** and **OS::Neutron::Port::allowed_address_pairs** ?domcTue, 02 Aug 2016 18:11:44 -0500https://ask.openstack.org/en/question/95212/fixed_ips use subnet name rather than IDhttps://ask.openstack.org/en/question/89900/fixed_ips-use-subnet-name-rather-than-id/Hi,
I wanted to use the subnet name rather than the id. the example bellow works with the subnet_id.
is there a way to make is work with the name?
int_port_mts1:
type: OS::Neutron::Port
properties:
admin_state_up: true
network: int_net
fixed_ips:
- subnet_id: f1770223-31d9-4b5b-9d62-c73c7f8dd67f
- subnet_id: 0f61d891-4de1-497b-9565-2194d9aa38a5
ghawadThu, 17 Mar 2016 17:15:27 -0500https://ask.openstack.org/en/question/89900/fixed_ips using subnet namehttps://ask.openstack.org/en/question/89898/fixed_ips-using-subnet-name/Hi,
I wanted to use the subnet name rather than the id. the example bellow works with the subnet_id.
is there a way to make is work with the name?
int_port_mts1:
type: OS::Neutron::Port
properties:
admin_state_up: true
network: int_net
fixed_ips:
- subnet_id: f1770223-31d9-4b5b-9d62-c73c7f8dd67f
- subnet_id: 0f61d891-4de1-497b-9565-2194d9aa38a5
ghawadThu, 17 Mar 2016 17:12:49 -0500https://ask.openstack.org/en/question/89898/Designate: How is multitenancy achieved and how to use designate as nameserver in OpenStack VMshttps://ask.openstack.org/en/question/86407/designate-how-is-multitenancy-achieved-and-how-to-use-designate-as-nameserver-in-openstack-vms/I am running OpenStack Liberty and was able to get Designate running (I had no luck with the Designate's dashboard extension). I am using Bind9 as backend under Ubuntu 14.04.
I require automatic DNS resolution for VMs within each tenant and Designate's sink service seems to be a perfect candidate to solve the problem. I must admit, that I have many questions in my mind and maybe I got everything wrong with Designate.
1. **Multitenancy:** How is multitenancy achieved in Designate? Has each tenant its private Bind server? Is there a single central Bind server that is shared among the tenants? How is multitenancy working in the single case?
2. **Designate in OpenStack VMs:** How can I configure Neutron or Nova in that way that the VMs get their tenant-specific Nameserver for DNS resolution? Is this possible with the current implementation state of Designate? Are there any tutorials available?
3. **Designate Sink:** The configuration for the Designate Sink Service requires a `domain_id`. Does this mean,that all IPs and VMs' FQDN from all tenants are stored within this common domain or is this domain created for each tenant? In the central case, how is multitenancy achieved? Each tenant should only see its own IPs. Sharing Neutron's Floating IPs seems to be a nice way, but would that not cause name collisions? All VMs in each tenant get the same domain name. When they get the same hostname, we have one FQDN resolving to two different IPs.
I know, it's a lot... Maybe someone can help me in understanding Designate's principle. This service is really cool and I want to use it.Herr-HernerFri, 18 Dec 2015 02:27:00 -0600https://ask.openstack.org/en/question/86407/subnet vs network to set in the OS::Neutron::Porthttps://ask.openstack.org/en/question/46127/subnet-vs-network-to-set-in-the-osneutronport/in the OS::Neutron::Port defination
heat_template_version: 2013-05-23
...
resources:
...
the_resource:
type: OS::Neutron::Port
properties:
admin_state_up: Boolean
allowed_address_pairs: [{"ip_address": String, "mac_address": String}, {"ip_address": String, "mac_address": String}, ...]
device_id: String
device_owner: String
**fixed_ips**: [{"subnet_id": String, "subnet": String, "ip_address": String}, {"subnet_id": String, "subnet": String, "ip_address": String}, ...]
mac_address: String
name: String
**network: String**
security_groups: [Value, Value, ...]
value_specs: {...}
Both the network and subnet are optional Properties
Is that true if I have both information I would rather just use the subnet (as it shall belong to one network) if I use static IP?Eric GHWed, 27 Aug 2014 21:52:44 -0500https://ask.openstack.org/en/question/46127/Why are VMs assigned a FIXED IP from every available network?https://ask.openstack.org/en/question/43494/why-are-vms-assigned-a-fixed-ip-from-every-available-network/I have a working Grizzly with nova-network (flat DHCP mode) that we use for our development labs and it works great with a single FIXED network. However, it's time to expand. My plan is to have one controller, that can spin up VM in either the old dev lab or on new compute nodes that will use a second FIXED network.
When I add the second network and start a VM in the WebUI (Horizon) the VM grabs an IP from both fixed networks:
nova-manage network create --multi_host='T' 10.17.64.0/24 --num_networks 1 --network_size 256 --fixed_range_v4=10.17.64.0/24 --fixed_cidr=10.17.64.0/24 --bridge_interface=br64 --bridge=br64 --dns1=8.8.8.8 --dns2=8.8.4.4
I tried using the `--project_id=` argument, but that didn't work.
Is this just a problem with Horizon not allowing me to select a network. It seems that when you don't specify a network when creating a VM it will automatically assign a private IP address from each available nova-network.
jfarschmanWed, 23 Jul 2014 18:12:49 -0500https://ask.openstack.org/en/question/43494/Can't boot instances in new tenant, fixed ipshttps://ask.openstack.org/en/question/27833/cant-boot-instances-in-new-tenant-fixed-ips/Hi All -- I can't create new instances in new tenants. The instance comes up as an error.
I'm running a small OpenStack Essex (yup back on Essex). I added a new tenant, but that new tenant can't create instances, they end up in an ERROR status.
$ nova list
+--------------------------------------+------------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+------------+--------+------------+-------------+----------+
| e2ebe076-a765-4816-8cd6-0195b8d1ed73 | isttest2-1 | ERROR | deleting | NOSTATE | |
| 34017d0c-f6e4-4db8-8816-597a1e99ee8e | isttest2-2 | ERROR | deleting | NOSTATE | |
| a7231b73-b9f9-4a79-8338-3687e4133633 | isttest2-5 | ERROR | deleting | NOSTATE | |
+--------------------------------------+------------+--------+------------+-------------+----------+
This is a traceback I get on the compute nodes.
2014-04-21 17:35:05 TRACE nova.compute.manager [instance: e1f0d1ef-ede5-4c6e-b47b-9454aacbecb4] Traceback (most recent call last):
2014-04-21 17:35:05 TRACE nova.compute.manager [instance: e1f0d1ef-ede5-4c6e-b47b-9454aacbecb4] File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 617, in _spawn
2014-04-21 17:35:05 TRACE nova.compute.manager [instance: e1f0d1ef-ede5-4c6e-b47b-9454aacbecb4] self._legacy_nw_info(network_info), block_device_info)
2014-04-21 17:35:05 TRACE nova.compute.manager [instance: e1f0d1ef-ede5-4c6e-b47b-9454aacbecb4] File "/usr/lib/python2.7/dist-packages/nova/exception.py", line 114, in wrapped
2014-04-21 17:35:05 TRACE nova.compute.manager [instance: e1f0d1ef-ede5-4c6e-b47b-9454aacbecb4] return f(*args, **kw)
2014-04-21 17:35:05 TRACE nova.compute.manager [instance: e1f0d1ef-ede5-4c6e-b47b-9454aacbecb4] File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/connection.py", line 946, in spawn
2014-04-21 17:35:05 TRACE nova.compute.manager [instance: e1f0d1ef-ede5-4c6e-b47b-9454aacbecb4] block_device_info=block_device_info)
2014-04-21 17:35:05 TRACE nova.compute.manager [instance: e1f0d1ef-ede5-4c6e-b47b-9454aacbecb4] File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/connection.py", line 1568, in to_xml
2014-04-21 17:35:05 TRACE nova.compute.manager [instance: e1f0d1ef-ede5-4c6e-b47b-9454aacbecb4] rescue, block_device_info)
2014-04-21 17:35:05 TRACE nova.compute.manager [instance: e1f0d1ef-ede5-4c6e-b47b-9454aacbecb4] File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/connection.py", line 1451, in _prepare_xml_info
2014-04-21 17:35:05 TRACE nova.compute.manager [instance: e1f0d1ef-ede5-4c6e-b47b-9454aacbecb4] nics.append(self.vif_driver.plug(instance, network, mapping))
2014-04-21 17:35:05 TRACE nova.compute.manager [instance: e1f0d1ef-ede5-4c6e-b47b-9454aacbecb4] File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/vif.py", line 99, in plug
2014-04-21 17:35:05 TRACE nova.compute.manager [instance: e1f0d1ef-ede5-4c6e-b47b-9454aacbecb4] return self._get_configurations(network, mapping)
2014-04-21 17:35:05 TRACE nova.compute.manager [instance: e1f0d1ef-ede5-4c6e-b47b-9454aacbecb4] File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/vif.py", line 69, in _get_configurations
2014-04-21 17:35:05 TRACE nova.compute.manager [instance: e1f0d1ef-ede5-4c6e-b47b-9454aacbecb4] 'ip_address': mapping['ips'][0]['ip'],
2014-04-21 17:35:05 TRACE nova.compute.manager [instance: e1f0d1ef-ede5-4c6e-b47b-9454aacbecb4] IndexError: list index out of range
2014-04-21 17:35:05 TRACE nova.compute.manager [instance: e1f0d1ef-ede5-4c6e-b47b-9454aacbecb4]
I believe it is similar to this bug: https://bugs.launchpad.net/nova/+bug/1036672
NOTE: When I first created the OpenStack cluster, I created 100 networks, some of which I deleted, and then later on, after adding new tenants, created new networks. But the new tenant is not able to use the new network.
I think I need to perhaps clean up the fixed_ips table in nova? If so I'm not exactly sure what to do. Can I just delete the entries in fixed_ips and then will nova-network recreate them?
Thanks for any help.serverascodeTue, 22 Apr 2014 10:53:29 -0500https://ask.openstack.org/en/question/27833/