Ubuntu – How to give a Juju charm a static ip address – wordpress

jujukvmlxcnetworking

I have a wordpress charm installed via juju. In order for me to access this charm through public ip, I port forwarded the ip into my server's public ip address. Recently, the ip address of the wordpress changed and brought my site down. I figured, this is due to the fact that the juju charm is on DHCP rather than static IP address. Is there a way to give the charm a satic ip address? Or is there any other way for me to deploy this charm?

I'm using local. public-address used to be 10.0.3.15 for wordpress and now it changed to 10.0.3.158

environment: local
machines:
  "0":
    agent-state: started
    agent-version: 1.20.1.1
    dns-name: localhost
    instance-id: localhost
    series: trusty
    state-server-member-status: has-vote
  "1":
    agent-state: started
    agent-version: 1.20.1.1
    dns-name: 10.0.3.32
    instance-id: madfresco-local-machine-1
    series: trusty
    hardware: arch=amd64
  "2":
    agent-state: started
    agent-version: 1.20.1.1
    dns-name: 10.0.3.158
    instance-id: madfresco-local-machine-2
    series: precise
    hardware: arch=amd64
services:
  mysql:
    charm: cs:trusty/mysql-3
    exposed: false
    relations:
      cluster:
      - mysql
      db:
      - wordpress
    units:
      mysql/0:
        agent-state: started
        agent-version: 1.20.1.1
        machine: "1"
        public-address: 10.0.3.32
  wordpress:
    charm: cs:precise/wordpress-25
    exposed: true
    relations:
      db:
      - mysql
      loadbalancer:
      - wordpress
    units:
      wordpress/0:
        agent-state: started
        agent-version: 1.20.1.1
        machine: "2"
        open-ports:
        - 80/tcp
        public-address: 10.0.3.158

Not too sure if this will help but I found these machine logs:

2014-08-06 08:14:10 ERROR juju.state.api.watcher watcher.go:68 error trying to stop watcher: connection is shut down
2014-08-06 08:14:10 ERROR juju.state.api.watcher watcher.go:68 error trying to stop watcher: connection is shut down
2014-08-06 08:14:11 ERROR juju.worker runner.go:207 fatal "deployer": connection is shut down
2014-08-06 08:14:11 ERROR juju.worker runner.go:207 fatal "upgrader": connection is shut down
2014-08-06 08:14:11 ERROR juju.worker runner.go:207 fatal "2-container-watcher": connection is shut down
2014-08-06 08:14:11 ERROR juju.worker runner.go:207 fatal "authenticationworker": connection is shut down
2014-08-06 08:14:11 ERROR juju.worker runner.go:207 fatal "machiner": connection is shut down
2014-08-06 08:21:35 INFO juju.cmd supercommand.go:37 running jujud [1.20.1.1-precise-amd64 gc]
2014-08-06 08:21:36 INFO juju.cmd.jujud machine.go:156 machine agent machine-2 start (1.20.1.1-precise-amd64 [gc])
2014-08-06 08:21:36 DEBUG juju.agent agent.go:377 read agent config, format "1.18"
2014-08-06 08:21:36 INFO juju.worker runner.go:260 start "statestarter"
2014-08-06 08:21:36 INFO juju.worker runner.go:260 start "termination"
2014-08-06 08:21:36 INFO juju.worker runner.go:260 start "api"
2014-08-06 08:21:36 INFO juju.state.api apiclient.go:242 dialing "wss://10.0.3.1:17070/"
2014-08-06 08:21:36 INFO juju.state.api apiclient.go:176 connection established to "wss://10.0.3.1:17070/"
2014-08-06 08:21:43 INFO juju.worker runner.go:260 start "upgrader"
2014-08-06 08:21:43 INFO juju.worker runner.go:260 start "upgrade-steps"
2014-08-06 08:21:43 INFO juju.worker runner.go:260 start "machiner"
2014-08-06 08:21:43 INFO juju.cmd.jujud machine.go:800 upgrade to 1.20.1.1-precise-amd64 already completed.
2014-08-06 08:21:43 INFO juju.cmd.jujud machine.go:781 upgrade to 1.20.1.1-precise-amd64 completed.
2014-08-06 08:21:43 INFO juju.worker runner.go:260 start "apiaddressupdater"
2014-08-06 08:21:43 INFO juju.worker runner.go:260 start "logger"
2014-08-06 08:21:43 INFO juju.worker runner.go:260 start "machineenvironmentworker"
2014-08-06 08:21:43 INFO juju.worker runner.go:260 start "rsyslog"
2014-08-06 08:21:43 DEBUG juju.worker.machineenvironment machineenvironmentworker.go:71 write system files: true
2014-08-06 08:21:43 INFO juju.worker runner.go:260 start "authenticationworker"
2014-08-06 08:21:43 DEBUG juju.worker.rsyslog worker.go:75 starting rsyslog worker mode 1 for "machine-2" "madfresco-local"
2014-08-06 08:21:43 DEBUG juju.worker.logger logger.go:35 initial log config: "<root>=DEBUG"
2014-08-06 08:21:43 DEBUG juju.worker.logger logger.go:60 logger setup
2014-08-06 08:21:43 INFO juju.worker.machiner machiner.go:86 setting addresses for machine-2 to ["local-machine:127.0.0.1" "local-cloud:10.0.3.158" "local-machine:::1" "fe80::$
2014-08-06 08:21:44 DEBUG juju.worker.logger logger.go:45 reconfiguring logging from "<root>=DEBUG" to "<root>=WARNING;unit=DEBUG"
2014-08-06 08:21:44 WARNING juju.cmd.jujud machine.go:357 determining kvm support: exit status 1
no kvm containers possible

Best Answer

You cannot do that currently, but there is some more sophisticated networking support coming up in juju for Ubuntu 15.04 (perhaps sooner).

Related Question