Changes between Initial Version and Version 1 of UpgradeOpenvzNotes


Ignore:
Timestamp:
Dec 14, 2012 9:36:03 AM (11 years ago)
Author:
Ted Faber
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UpgradeOpenvzNotes

    v1 v1  
     1= Upgrade Notes for OpenVZ =
     2
     3== Upgrading Templates ==
     4
     5Start an experiment with the templates to update in it.  For example:
     6
     7{{{
     8source tb_compat.tcl
     9set ns [new Simulator]
     10
     11set u1004x86 [$ns node]
     12tb-add-node-attribute $u1004x86 containers:openvz_template ubuntu-10.04-x86
     13set u1004x8664 [$ns node]
     14tb-add-node-attribute $u1004x8664 containers:openvz_template ubuntu-10.04-x86_64
     15set u1204x86 [$ns node]
     16tb-add-node-attribute $u1204x86 containers:openvz_template ubuntu-12.04-x86
     17set u1204x8664 [$ns node]
     18tb-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
     26Stop 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
     38Pull 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{{{
     41vzctl 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
     45You'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
     47Start the VM and configure its networking
     48
     49{{{
     50$ sudo vzctl 555 startA
     51}}}
     52At 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
     57bridge name     bridge id               STP enabled     interfaces
     58control0                8000.0025906ad176       no              eth0
     59                                                        veth101.0
     60                                                        veth102.0
     61                                                        veth103.0
     62                                                        veth104.0
     63}}}
     64
     65Enter the VM and start its networking
     66{{{
     67$ sudo vzctl 555 enter
     68root@pnode-0000:/# sudo ifconfig eth0 172.16.28.46 netmask 255.240.0.0 up
     69sudo: unable to resolve host pnode-0000.faber-templates.safer.isi.deterlab.net
     70root@pnode-0000:/# ip route add 192.168.0.0/22 dev eth0  scope link
     71root@pnode-0000:/# ip route add default via 192.168.1.254 dev eth0
     72root@pnode-0000:/# ping users
     73PING users.isi.deterlab.net (192.168.253.1) 56(84) bytes of data.
     7464 bytes from users.isi.deterlab.net (192.168.253.1): icmp_req=1 ttl=63 time=2.02 ms
     7564 bytes from users.isi.deterlab.net (192.168.253.1): icmp_req=2 ttl=63 time=1.39 ms
     76}}}
     77
     78Now you have a functional, if minimal VM, and you can update the template in place.  E.g:
     79
     80{{{
     81root@pnode-0000:/# apt-get update
     82}}}
     83
     84
     85
     86In the host, add the
     87}}}