Comment 0 for bug 1525792

Revision history for this message
Ray Wang (raywang) wrote :

While using juju-deployer to deploy an environment with yaml file, and put openstack services into the containers. Chances are that some of the containers may not be able to created due to the race conditions.

$ juju status
"24":
    agent-state: started
    agent-version: 1.26-alpha2
    dns-name: computron.maas
    instance-id: /MAAS/api/1.0/nodes/node-cc90fd10-94aa-11e5-9b5b-525400355405/
    series: wily
    containers:
      24/lxc/0:
        agent-state: error
        agent-state-info: 'failed to retrieve the template to clone: template container
          "juju-wily-lxc-template" did not stop'
        instance-id: pending
        series: wily
      24/lxc/1:
        agent-state: error
        agent-state-info: lxc container cloning failed
        instance-id: pending
        series: wily
      24/lxc/2:
        agent-state: error
        agent-state-info: lxc container cloning failed
        instance-id: pending
        series: wily
      24/lxc/3:
        agent-state: error
        agent-state-info: lxc container cloning failed
        instance-id: pending
        series: wily
      24/lxc/4:
        agent-state: error
        agent-state-info: lxc container cloning failed
        instance-id: pending
        series: wily
      24/lxc/5:
        agent-state: error
....

ubuntu@computron:~$ sudo lxc-ls
juju-machine-24-lxc-6 juju-machine-24-lxc-7 juju-wily-lxc-template

ubuntu@computron:~$ sudo lxc-info --name juju-wily-lxc-template
Name: juju-wily-lxc-template
State: STOPPED

ubuntu@computron:~$ sudo lxc-info --name juju-machine-24-lxc-7
Name: juju-machine-24-lxc-7
State: RUNNING
PID: 20357
IP: 10.0.3.1
IP: 10.231.64.84
CPU use: 54.91 seconds
BlkIO use: 16.00 KiB
Memory use: 616.50 MiB
KMem use: 0 bytes
Link: veth1TOM1S
 TX bytes: 2.57 MiB
 RX bytes: 85.18 MiB
 Total bytes: 87.76 MiB

ubuntu@computron:~$ sudo lxc-clone juju-wily-lxc-template test
locale: Cannot set LC_ALL to default locale: No such file or directory
Created container test as copy of juju-wily-lxc-template

ubuntu@computron:~$ sudo lxc-ls
juju-machine-24-lxc-6 juju-machine-24-lxc-7 juju-wily-lxc-template test

ubuntu@computron:~$ sudo lxc-info --name test
Name: test
State: STOPPED

ubuntu@computron:~$ sudo lxc-start --name test

ubuntu@computron:~$ sudo lxc-info --name test
Name: test
State: RUNNING
PID: 74124
IP: 10.231.64.172
CPU use: 0.60 seconds
BlkIO use: 424.00 KiB
Memory use: 30.33 MiB
KMem use: 0 bytes
Link: veth3U8J1J
 TX bytes: 1.33 KiB
 RX bytes: 2.50 KiB
 Total bytes: 3.84 KiB

In that case, I can clone the template manually, but juju-deployer fail to create because of the template is not stopped, so I guess there might be race condition in this situation