| 1 | = Upgrade Notes for OpenVZ = |
| 2 | |
| 3 | == Upgrading Templates == |
| 4 | |
| 5 | Start an experiment with the templates to update in it. For example: |
| 6 | |
| 7 | {{{ |
| 8 | source tb_compat.tcl |
| 9 | set ns [new Simulator] |
| 10 | |
| 11 | set u1004x86 [$ns node] |
| 12 | tb-add-node-attribute $u1004x86 containers:openvz_template ubuntu-10.04-x86 |
| 13 | set u1004x8664 [$ns node] |
| 14 | tb-add-node-attribute $u1004x8664 containers:openvz_template ubuntu-10.04-x86_64 |
| 15 | set u1204x86 [$ns node] |
| 16 | tb-add-node-attribute $u1204x86 containers:openvz_template ubuntu-12.04-x86 |
| 17 | set u1204x8664 [$ns node] |
| 18 | tb-add-node-attribute $u1204x8664 containers:openvz_template ubuntu-12.04-x86_64 |
| 19 | |
| 20 | # Creation boilerplate |
| 21 | $ns rtptoto Static |
| 22 | $ns run |
| 23 | |
| 24 | }}} |
| 25 | |
| 26 | Stop one of the VMs: |
| 27 | |
| 28 | {{{ |
| 29 | $ sudo vzlist -n |
| 30 | $ sudo vzlist -n |
| 31 | CTID NPROC STATUS IP_ADDR NAME |
| 32 | 102 21 running - u1004x86 |
| 33 | 103 26 running - u1204x86 |
| 34 | 104 19 running - u1004x8664 |
| 35 | $ sudo vzctl stop 102 |
| 36 | }}} |
| 37 | |
| 38 | Pull the creation commands for that VM out of {{{/var/containers/config/openvz_create_commands.yaml}}}. You only need the creation and network setup commands, but it won't hurt to run them all. |
| 39 | |
| 40 | {{{ |
| 41 | vzctl create 101 --ostemplate ubuntu-12.04-x86_64 |
| 42 | /usr/sbin/vzctl set 101 --netif_add eth0,00:66:00:00:1c:2e,veth101.0,00:67:00:00:1c:2e --save |
| 43 | }}} |
| 44 | |
| 45 | You'll also need the IP address of that node. You can note it before or pull it from the extra_nodes table in the database. |
| 46 | |
| 47 | Start the VM and configure its networking |
| 48 | |
| 49 | {{{ |
| 50 | $ sudo vzctl 555 startA |
| 51 | }}} |
| 52 | At this point the virtual interface from the {{{---netif_add}}} will reappear. Add it back into the control bridge: |
| 53 | |
| 54 | {{{ |
| 55 | $ sudo brctl addif control0 veth101.0 |
| 56 | ~$ brctl show |
| 57 | bridge name bridge id STP enabled interfaces |
| 58 | control0 8000.0025906ad176 no eth0 |
| 59 | veth101.0 |
| 60 | veth102.0 |
| 61 | veth103.0 |
| 62 | veth104.0 |
| 63 | }}} |
| 64 | |
| 65 | Enter the VM and start its networking |
| 66 | {{{ |
| 67 | $ sudo vzctl 555 enter |
| 68 | root@pnode-0000:/# sudo ifconfig eth0 172.16.28.46 netmask 255.240.0.0 up |
| 69 | sudo: unable to resolve host pnode-0000.faber-templates.safer.isi.deterlab.net |
| 70 | root@pnode-0000:/# ip route add 192.168.0.0/22 dev eth0 scope link |
| 71 | root@pnode-0000:/# ip route add default via 192.168.1.254 dev eth0 |
| 72 | root@pnode-0000:/# ping users |
| 73 | PING users.isi.deterlab.net (192.168.253.1) 56(84) bytes of data. |
| 74 | 64 bytes from users.isi.deterlab.net (192.168.253.1): icmp_req=1 ttl=63 time=2.02 ms |
| 75 | 64 bytes from users.isi.deterlab.net (192.168.253.1): icmp_req=2 ttl=63 time=1.39 ms |
| 76 | }}} |
| 77 | |
| 78 | Now you have a functional, if minimal VM, and you can update the template in place. E.g: |
| 79 | |
| 80 | {{{ |
| 81 | root@pnode-0000:/# apt-get update |
| 82 | }}} |
| 83 | |
| 84 | |
| 85 | |
| 86 | In the host, add the |
| 87 | }}} |