How to attach static IP to a virtual machine using gcloud? - networking

Trying to attach existing reserved IP address to a new virtual machine using gcloud
it's easy to do in the console, can't find a way how to do it using gcloud

See:
link
gcloud compute instances create [INSTANCE_NAME] --address [IP_ADDRESS]

Related

Openstack Kolla Ansible reconfigure all compute node to enable provider network

May I ask how to reconfigure all compute node to enable provider network in Kolla Ansible openstack?
As I know, openstack will support to create provider network while kolla-ansible deploy success.
Because it enable the relevant composes default in all-in-one or multinode file, something like this:
# Neutron
[neutron-server:children]
control
[neutron-dhcp-agent:children]
neutron
[neutron-l3-agent:children]
neutron
While neutron-l3-agent enable default, you could also create Self-service network not only Provider networks.
IIUC, you could create the provider network and launch instance with this network, like the documentation describe:
$ openstack network create --share --external \
--provider-physical-network provider \
--provider-network-type flat provider
One more thing, your network infrastructure (such as switch or router) should configure correctly at first while you using it.

How to access instance from outside?

I installed openstack using packstack. But I don't know how to configure network.
I want to access my instance using ssh like this.
Is it possible to do this?
By default, Packstack creates an "external" network that is entirely contained inside the host. This is great for creating a cloud without any knowledge of the network environment, but prevents you from accessing instances from outside.
Configure your Packstack so that its external network is your network. This is documented at https://www.rdoproject.org/networking/neutron-with-existing-external-network/.
Actually, without external network its not possible.Your instance should have external(public) ip.I'm using this way but you have other option like proxy.
if your Centos7 machine can connect your instance;
Use HaProxy at Centos machine and proxy instance ssh port to specific centos7 port and connect using this port.I'm using this way on microstack.

How to create network-truststore.jks for differenct nodes running on different virtual machine

How to create network-truststore.jks for different nodes running on different virtual machines on google cloud.
you could use something like the CENM to create a private network. It provides a PKI tool which is configurable, and you could use this tool to create all the required certificates.
Another option is to use the network-bootstrapper tool to create a local network and then copy individual node folders created in build/nodes folder to individual VM's. Make sure you change the IP address in node.conf to the correct VM's public address.

Google Cloud Engine - Change External IP address from CA to SG

I have google cloud compute engine which is centOS 7. It was located in asia-southeast1 (SG). However, I checked the external IP it was on the Mountain View, CA.
Is it possible to change the IP where it can be located to Singapore?
Thanks,
Edmhar
Sure. At this moment you need to:
1 Reserve a new IP in the wanted region.
2 Stop your VM.
3 Assign the new IP to your VM.
4 Re-Start your VM
It is easier to do it through the console, but will take more time. If you decide to do it with gcloud. You need to delete the access and Assign the new one.
Delete access
gcloud compute instances describe [INSTANCE_NAME]
gcloud compute instances delete-access-config [INSTANCE_NAME] \
--access-config-name "[ACCESS_CONFIG_NAME]"
Define the new IP reserved ( here you specify the actual IP x.x.x.x, not its name)
gcloud compute instances add-access-config [INSTANCE_NAME] \
--access-config-name "[ACCESS_CONFIG_NAME]" --address [IP_ADDRESS]
Assign the IP to the VM
gcloud compute instances add-access-config [INSTANCE_NAME] \
--access-config-name "[ACCESS_CONFIG_NAME]"
The official documentation has also the step by step.
https://cloud.google.com/compute/docs/configure-ip-addresses

Openstack allow api access from vm

We are currently using Openstack newtown. We can access the API using client on public endpoint from any computer, but the vm don't have access to it, they can ping the IP and dns name but can't curl or access using openstack-client. How can we allow connection from VM to API ?
Assuming your public API endpoint is externally accessible, the network on which your virtual machine resides will need external access. This can be achieved in a few different ways, depending on your current configuration. You can create a Neutron provider network/subnet which will provide access to a physical network and gateway to the outside world. You can then boot your instance directly on the provider network. More information on Neutron provider networks can be found at docs.openstack.org.
The problem is that floating IP don't give the route of my external network.
I add route using neutron and now all is working perfectly. for info the command is:
neutron router-update demo-routeur --routes type=dict list=true destination=192.168.0.27/27,nexthop=10.0.0.1

Resources