lost and found ( for me ? )

Ubuntu 14.04 : some examples of CLI(juju, lxc-ls, virsh etc) after installing Openstack Kilo within single machine via openstack-installer

Here  are some examples of CLI(juju, lxc-ls, virsh) after installing Openstack Kilo via openstack-installer.

Reference
https://github.com/juju/cheatsheet
http://ronaldbradford.com/blog/tracking-the-ubuntu-openstack-installation-process-2015-06-02/

[ juju status ]

log into the container.
$ hostname
openstack-single-hattori

$ whoami
ubuntu

$ JUJU_HOME=~/.cloud-install/juju juju status | head -3
environment: local
machines:
 "0":

$ JUJU_HOME=~/.cloud-install/juju juju status
environment: local
machines:
 "0":
   agent-state: started

keystone
$ JUJU_HOME=~/.cloud-install/juju juju status keystone
environment: local
machines:
 "1":
   agent-state: started
   agent-version: 1.25.0.1
   instance-id: ubuntu-local-machine-1
   series: trusty

$ JUJU_HOME=~/.cloud-install/juju juju status neutron-gateway
environment: local
machines:
 "3":
   agent-state: started
   agent-version: 1.25.0.1
   dns-name: 10.0.6.188
   instance-id: ubuntu-local-machine-3
   series: trusty

$ JUJU_HOME=~/.cloud-install/juju juju status nova-compute
environment: local
machines:
 "2":
   agent-state: started
   agent-version: 1.25.0.1

$ JUJU_HOME=~/.cloud-install/juju juju status glance
environment: local
machines:
 "1":
   agent-state: started
   agent-version: 1.25.0.1
   instance-id: ubuntu-local-machine-1

JUJU_HOME=~/.cloud-install/juju juju status openstack-dashboard
environment: local
machines:
 "1":
   agent-state: started
   agent-version: 1.25.0.1
   instance-id: ubuntu-local-machine-1
   series: trusty
   containers:
     1/lxc/4:

[ configuration ]


ubuntu@openstack-single-hattori:~$ cat .cloud-install/config.yaml
config_file: /home/ubuntu/.cloud-install/config.yaml
container_ip: 10.0.3.191
container_name: openstack-single-hattori
current_state: 2
deploy_complete: true
gui_started: true
install_type: Single
lxc_network: 10.0.6.0/24
openstack_password: ubuntu
openstack_release: kilo
postproc_complete: true
relations_complete: true
ubuntu_series: trusty
upstream_ppa: true


[ juju ssh ]

neutron-openvswitch
$ JUJU_HOME=~/.cloud-install/juju juju ssh neutron-openvswitch/0
ubuntu@ubuntu-local-machine-2:~$
ubuntu@ubuntu-local-machine-2:~$ ls /etc/neutron/
api-paste.ini  fwaas_driver.ini  l3_agent.ini  neutron.conf  plugins  policy.d  policy.json  rootwrap.conf  rootwrap.d

glance
$ JUJU_HOME=~/.cloud-install/juju juju ssh glance/0
ubuntu@ubuntu-local-machine-1-lxc-7:~$

keystone
$ JUJU_HOME=~/.cloud-install/juju juju ssh keystone/0
ubuntu@ubuntu-local-machine-1-lxc-1:~$

mySQL
ubuntu@openstack-single-hattori:~$ JUJU_HOME=~/.cloud-install/juju juju ssh mysql/0
ubuntu@ubuntu-local-machine-1-lxc-0:~$

[ juju run ]

$ JUJU_HOME=~/.cloud-install/juju juju run "uname -a" --all
- MachineId: "0"
 ReturnCode: 255
 Stderr: "Permission denied (publickey,password).\r\n"
 Stdout: ""
- Error: missing host address
 MachineId: "1"
 Stdout: ""
- MachineId: 1/lxc/0
 Stdout: |
   Linux ubuntu-local-machine-1-lxc-0 3.13.0-68-generic #111-Ubuntu SMP Fri Nov 6 18:17:06 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

[ virsh ]


ubuntu@openstack-single-hattori:~$ virsh list --all
Id    Name                           State
----------------------------------------------------
2     ubuntu-local-machine-2         running
3     ubuntu-local-machine-1         running
4     ubuntu-local-machine-3         running


access to the instance 2 over SSH

ubuntu@openstack-single-hattori:~$ JUJU_HOME=~/.cloud-install/juju juju ssh 2
Last login: Wed Nov 11 16:39:09 2015 from 10.0.6.1
ubuntu@ubuntu-local-machine-2:~$


---

Having looked at an output of juju status, it seems that ubuntu-local-machine-1 does not have an IP..
but, containers inside this machine have an IP..



ubuntu@openstack-single-hattori:~$ JUJU_HOME=~/.cloud-install/juju juju status


 "1":
   agent-state: started
   agent-version: 1.25.0.1
   instance-id: ubuntu-local-machine-1
   series: trusty
   containers:
     1/lxc/0:
       agent-state: started
       agent-version: 1.25.0.1
       dns-name: 10.0.6.248
       instance-id: ubuntu-local-machine-1-lxc-0
       series: trusty
       hardware: arch=amd64
     1/lxc/1:
       agent-state: started
       agent-version: 1.25.0.1
       dns-name: 10.0.6.53
       instance-id: ubuntu-local-machine-1-lxc-1
       series: trusty
       hardware: arch=amd64


 "2":
   agent-state: started
   agent-version: 1.25.0.1
   dns-name: 10.0.6.159
   instance-id: ubuntu-local-machine-2
   series: trusty
   hardware: arch=amd64 cpu-cores=1 mem=4096M root-disk=40960M
 "3":
   agent-state: started
   agent-version: 1.25.0.1
   dns-name: 10.0.6.202
   instance-id: ubuntu-local-machine-3
   series: trusty
   hardware: arch=amd64 cpu-cores=1 mem=2048M root-disk=20480M


access to the machine 1 over SSH.
I can't..

ubuntu@openstack-single-hattori:~$ JUJU_HOME=~/.cloud-install/juju juju ssh 1
ERROR error fetching address for machine "1": public no address
ubuntu@openstack-single-hattori:~$

how over 2 and 3?
ok.

ubuntu@openstack-single-hattori:~$ JUJU_HOME=~/.cloud-install/juju juju ssh 2
Last login: Wed Nov 11 16:54:24 2015 from 10.0.6.1
ubuntu@ubuntu-local-machine-2:~$


ubuntu@openstack-single-hattori:~$ JUJU_HOME=~/.cloud-install/juju juju ssh 3
Last login: Wed Nov 11 16:54:34 2015 from 10.0.6.1
ubuntu@ubuntu-local-machine-3:~$


Can I access to a container running within ‘ubuntu-local-machine-1’?
I can access to a container inside 'ubuntu-local-machine-1'.

ubuntu@openstack-single-hattori:~$ JUJU_HOME=~/.cloud-install/juju juju ssh 1/lxc/0
Last login: Wed Nov 11 16:58:26 2015 from 10.0.6.1
ubuntu@ubuntu-local-machine-1-lxc-0:~$



list VMs.

ubuntu@openstack-single-hattori:~$ virsh list --all
Id    Name                           State
----------------------------------------------------
2     ubuntu-local-machine-2         running
3     ubuntu-local-machine-1         running
4     ubuntu-local-machine-3         running


check MAC address of ubuntu-local-machine-1.

ubuntu@openstack-single-hattori:~$ virsh dumpxml ubuntu-local-machine-1 | grep 'mac address' -i
     <mac address='52:54:00:b4:a7:ca'/>


check ARP table of that MAC.
It seems that ubuntu-local-machine-1 has 10.0.6.13.

ubuntu@openstack-single-hattori:~$ arp -an | grep 'a7:ca'
? (10.0.6.13) at 52:54:00:b4:a7:ca [ether] on lxcbr0


ubuntu@openstack-single-hattori:~$ ping 10.0.6.13 -c 1
PING 10.0.6.13 (10.0.6.13) 56(84) bytes of data.
64 bytes from 10.0.6.13: icmp_seq=1 ttl=64 time=0.483 ms

--- 10.0.6.13 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.483/0.483/0.483/0.000 ms


okay, I wab able to access to ubuntu-local-machine-1 over SSH.

ubuntu@openstack-single-hattori:~$ ssh ubuntu@10.0.6.13
ubuntu@ubuntu-local-machine-1:~$


ubuntu@ubuntu-local-machine-1:~$ sudo lxc-ls -f
NAME                          STATE    IPV4        IPV6  AUTOSTART  
------------------------------------------------------------------
juju-trusty-lxc-template      STOPPED  -           -     NO         
ubuntu-local-machine-1-lxc-0  RUNNING  10.0.6.248  -     YES        
ubuntu-local-machine-1-lxc-1  RUNNING  10.0.6.53   -     YES        
ubuntu-local-machine-1-lxc-2  RUNNING  10.0.6.57   -     YES        
ubuntu-local-machine-1-lxc-3  RUNNING  10.0.6.179  -     YES        
ubuntu-local-machine-1-lxc-4  RUNNING  10.0.6.214  -     YES        
ubuntu-local-machine-1-lxc-5  RUNNING  10.0.6.95   -     YES        
ubuntu-local-machine-1-lxc-6  RUNNING  10.0.6.236  -     YES        
ubuntu-local-machine-1-lxc-7  RUNNING  10.0.6.234  -     YES        
ubuntu@ubuntu-local-machine-1:~$


ubuntu@ubuntu-local-machine-1:~$ sudo ls /var/lib/lxc
juju-trusty-lxc-template      ubuntu-local-machine-1-lxc-4
ubuntu-local-machine-1-lxc-0  ubuntu-local-machine-1-lxc-5
ubuntu-local-machine-1-lxc-1  ubuntu-local-machine-1-lxc-6
ubuntu-local-machine-1-lxc-2  ubuntu-local-machine-1-lxc-7
ubuntu-local-machine-1-lxc-3


“10.0.6.13” has been assigned to lxcbr0.

ubuntu@ubuntu-local-machine-1:~$ sudo ifconfig -a
eth0      Link encap:Ethernet  HWaddr 52:54:00:b4:a7:ca  
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:97916 errors:0 dropped:0 overruns:0 frame:0
         TX packets:93333 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:24107050 (24.1 MB)  TX bytes:26656183 (26.6 MB)

lo        Link encap:Local Loopback  
         inet addr:127.0.0.1  Mask:255.0.0.0
         inet6 addr: ::1/128 Scope:Host
         UP LOOPBACK RUNNING  MTU:65536  Metric:1
         RX packets:40 errors:0 dropped:0 overruns:0 frame:0
         TX packets:40 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:0
         RX bytes:3136 (3.1 KB)  TX bytes:3136 (3.1 KB)

lxcbr0    Link encap:Ethernet  HWaddr 52:54:00:b4:a7:ca  
         inet addr:10.0.6.13  Bcast:10.0.6.255  Mask:255.255.255.0
         inet6 addr: fe80::5054:ff:feb4:a7ca/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:1004 errors:0 dropped:0 overruns:0 frame:0
         TX packets:788 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:0
         RX bytes:138468 (138.4 KB)  TX bytes:110531 (110.5 KB)

veth550D6S Link encap:Ethernet  HWaddr fe:d8:3d:92:31:9f  
         inet6 addr: fe80::fcd8:3dff:fe92:319f/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:29590 errors:0 dropped:0 overruns:0 frame:0
         TX packets:29963 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:6511233 (6.5 MB)  TX bytes:8901993 (8.9 MB)

veth8QI172 Link encap:Ethernet  HWaddr fe:e8:91:90:10:37  
         inet6 addr: fe80::fce8:91ff:fe90:1037/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:12117 errors:0 dropped:0 overruns:0 frame:0
         TX packets:10791 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:7135001 (7.1 MB)  TX bytes:2644237 (2.6 MB)

vethHVDEX9 Link encap:Ethernet  HWaddr fe:1a:69:ea:e5:49  
         inet6 addr: fe80::fc1a:69ff:feea:e549/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:6790 errors:0 dropped:0 overruns:0 frame:0
         TX packets:6664 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:1751588 (1.7 MB)  TX bytes:901387 (901.3 KB)

vethIVADJO Link encap:Ethernet  HWaddr fe:1a:5c:9c:64:b4  
         inet6 addr: fe80::fc1a:5cff:fe9c:64b4/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:65832 errors:0 dropped:0 overruns:0 frame:0
         TX packets:70028 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:21369538 (21.3 MB)  TX bytes:16137546 (16.1 MB)

vethJDH2WL Link encap:Ethernet  HWaddr fe:d9:fa:21:2c:01  
         inet6 addr: fe80::fcd9:faff:fe21:2c01/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:17001 errors:0 dropped:0 overruns:0 frame:0
         TX packets:15989 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:4158490 (4.1 MB)  TX bytes:3625523 (3.6 MB)

vethM6HE8R Link encap:Ethernet  HWaddr fe:64:69:01:a1:85  
         inet6 addr: fe80::fc64:69ff:fe01:a185/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:8323 errors:0 dropped:0 overruns:0 frame:0
         TX packets:8819 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:1965730 (1.9 MB)  TX bytes:3887159 (3.8 MB)

vethRTS4MD Link encap:Ethernet  HWaddr fe:a7:a3:13:00:c7  
         inet6 addr: fe80::fca7:a3ff:fe13:c7/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:68903 errors:0 dropped:0 overruns:0 frame:0
         TX packets:62980 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:16157285 (16.1 MB)  TX bytes:18702056 (18.7 MB)

vethSS9W0A Link encap:Ethernet  HWaddr fe:f2:12:53:0a:5e  
         inet6 addr: fe80::fcf2:12ff:fe53:a5e/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:59176 errors:0 dropped:0 overruns:0 frame:0
         TX packets:69343 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:14119224 (14.1 MB)  TX bytes:15993975 (15.9 MB)

ubuntu@ubuntu-local-machine-1:~$ sudo grep -v ^# /etc/network/interfaces

auto lo
iface lo inet loopback

source /etc/network/interfaces.d/*.cfg



ubuntu@ubuntu-local-machine-1:~$ sudo brctl show
bridge name bridge id STP enabled interfaces
lxcbr0 8000.525400b4a7ca no eth0
veth550D6S
veth8QI172
vethHVDEX9
vethIVADJO
vethJDH2WL
vethM6HE8R
vethRTS4MD
vethSS9W0A
ubuntu@ubuntu-local-machine-1:~$

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.