Ubuntu Pastebin

Paste from smoser at Tue, 12 Dec 2017 16:59:44 +0000

Download as text
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
                      \userdata/
platform               | Y | N | image
gce                    | X | X | /ubuntu-os-cloud/ubuntu-1604-xenial-v20160627
azure                  | X | X | Ubuntu_DAILY_BUILD-xenial-16_04-LTS-amd64-server-20160627-en-us-30GB
nocloud network config |   | X | daily cloud-image download 20160627
nocloud                |   | X | daily cloud-image download 20160627
openstack config drive | X | X | ubuntu-released/ubuntu-xenial-16.04-amd64-server-20160627-disk1.img
openstack md service   | X | X | ubuntu-released/ubuntu-xenial-16.04-amd64-server-20160627-disk1.img
lxd                    | X | X | ubuntu 16.04 LTS amd64 (daily) (20160627)
joyent                 | X | X | ubuntu-certified-15.10 (20160627)
dreamcompute           | X | X | Ubuntu-16.04 (12f6a911-00a2-42eb-8712-d930da2da81f) (serial 20160223-165330)
MAAS                   | X | X | ubuntu/xenial amd64/hwe-x 20160627 daily


gce:
  project="smoser-00"    
  img="/ubuntu-os-cloud/ubuntu-1604-xenial-v20160627"
  name="smfoo2"          
  zone="us-east1-b"
  mtype="f1-micro"
  gcloud compute "--project=$project" instances create "$name" \
  "--zone=$zone" "--machine-type=$mtype" --network=default \
  "--maintenance-policy=MIGRATE" \
   --image="$img" \
   --boot-disk-size=10 --boot-disk-type=pd-standard \
   "--boot-disk-device-name=$name" \
   [--metadata-from-file user-data=/tmp/userdata]

azure:
  azure vm create --vm-size=Basic_A0 \
     --vm-name=smx-stock "--location=East US" \
     --ssh-cert=id_rsa-smoser-azure@brickies.pem --no-ssh-password \
     --ssh=22 smx-stock \
     [--custom-data=/tmp/userdata]
     b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu_DAILY_BUILD-xenial-16_04-LTS-amd64-server-20160627-en-us-30GB \
     smoser


openstack md:
  nova boot --key-name=brickies --flavor=m1.small \
     --nic=net-id=db6a8975-5ca2-49d6-8ca7-f8747a163e58 \
     --image=ubuntu-released/ubuntu-xenial-16.04-amd64-server-20160627-disk1.img 
     [--user-data=/tmp/userdata] \
     os-md-stock

openstack config drive:
  nova boot --key-name=brickies --flavor=m1.small \
     --nic=net-id=db6a8975-5ca2-49d6-8ca7-f8747a163e58 \
     --image=ubuntu-released/ubuntu-xenial-16.04-amd64-server-20160627-disk1.img 
     [--user-data=/tmp/userdata] \
     os-md-stock

dreamcompute:
  openstack server create --key-name=brickies --flavor=gp1.semisonic \
    --config-drive=1 --image=Ubuntu-16.04 \
    [--user-data=/tmp/userdata]
    dreamcompute-cfgdrv-userdata
  ssh dhc-user@208.113.128.126

  Notes:
   * dreamcompute's xenial images have a very old version of cloud-init
     (0.7.7~bzr1160-0ubuntu1).  As such, on upgrade from this older version
     cloud-init's networking features get disabled for safety.

     Thus, we tested 2 paths of upgrade here:
     a.) directly from 0.7.7~bzr1160-0ubuntu1 to xenial-proposed
     b.) 0.7.7~bzr1160-0ubuntu1 -> xenial -> xenial-proposed
         (xenial = 0.7.7~bzr1212-0ubuntu1)

   In order to test "fresh", in addition to removing /var/lib/cloud
   we have to also set a sane expected system, undoing some of the
   changes they made to the image.
    $ [ -e /etc/network/interfaces.dist ] ||
        sudo mv /etc/network/interfaces /etc/network/interfaces.dist
    $ printf "%s\n%s\n%s\n" "auto lo" "iface lo inet loopback" \
      "source /etc/network/interfaces.d/*.cfg" |
      sudo tee /etc/network/interfaces
    # do not mount config drive in /etc/fstab
    $ sudo sed -i '/[^#].*sr0.*config_drive/s,^,#,' /etc/fstab


lxd:
   lxc image copy ubuntu-daily:xenial local: --alias xenial --auto-update
   lxc launch xenial lxd-stock
   lxc launch xenial lxd-user-data "--config=user.user-data=$(cat user-data)"
   # enable ssh keys
   lxc exec lxd-stock -- sudo -Hu ubuntu ssh-import-id smoser

joyent:
   # ubuntu-certified-15.10
   # img=14b4ff36-d0f8-11e5-a8b1-e343c129d7f0
   img=$(joyent sdc-listimages |
         joyent json -c 'this.name == "ubuntu-certified-15.10"' \
          -a version  id | tail -n 1 | awk '{print $2}')
   # package is k4-highcpu-kvm-750M
   package=14b5760a-d0f8-11e5-9cb1-23c9c232c00e
   userdata="$(cat ~/data/my-userdata-mini)"

   # https://github.com/joyent/node-smartdc
   sdc-createmachine  \
      --image=$img --package=$package \
      --metadata-file "cloud-init:user-data=/tmp/my-userdata" \
      --name=joyent-user-data

   Notes:
    * Joyent does not have 16.04 images, so we launched a 15.10 image
      and add the xenial-proposed archive and get cloud-init from there.
      Additionally, they have some workarounds to configure networking
      that should no longer be necessary.

      To do a "fresh" install then we also had to do the following:
        sudo mv /usr/local/sbin/ephemeral_eth.sh $f.dist
        sudo ln -sf /bin/true /usr/local/sbin/ephemeral_eth.sh
        sudo rm -f /etc/network/interfaces.d/*.cfg

nocloud network config:
  $ disk=xenial-server-cloudimg-amd64-disk1.raw
  $ mac=52:54:00:12:34:99
  $ pubkey=$(cat ~/.ssh/id_rsa.pub)
  $ cat > my-user-data <<EOF
  #cloud-config
  password: passw0rd
  chpasswd: { expire: False }
  ssh_pwauth: True
  EOF

  $ cat > my-meta-data <<EOF
  instance-id: abcd1234
  public-keys: ["$pubkey"]
  EOF

  $ cat > my-network-config <<EOF
  version: 1
  config:
    - type: physical
      name: interface0
      mac_address: $mac
      subnets:
         - type: static
           address: 10.0.2.4/24
           gateway: 10.0.2.2
    - type: namserver
      address: [10.0.2.3]
  EOF

  $ cloud-localds seed-netcfg-userdata.img \
      --network-config=my-network-config my-user-data my-meta-data
  $ xkvm --netdev=user,mac=$mac,hostfwd=tcp::2222-:22 \
     --disk=$disk --disk=seed-nonetcfg-userdata.img -- \
     -nographic -echr 0x05 -snapshot -m 512
  $ ssh -p 2222 ubuntu@localhost

nocloud: 
  cloud-localds seed-nonetcfg-userdata.img my-user-data my-meta-data
Download as text