Differences between revisions 10 and 11
Revision 10 as of 2017-11-12 04:11:47
Size: 1813
Editor: PieterSmit
Comment:
Revision 11 as of 2017-11-12 10:37:57
Size: 2351
Editor: PieterSmit
Comment:
Deletions are marked like this. Additions are marked like this.
Line 23: Line 23:
   * Setup config file    * Setup config file, must start with #cloud-config, file name: ubuntu-cloudimg-seed.txt
Line 26: Line 26:
# Add groups to the system
# The following example adds the ubuntu group with members 'root' and 'sys'
# and the empty group cloud-users.
groups:
  - ubuntu: [root,sys]
  - cloud-users
output: {all: '| tee -a /var/log/cloud-init-output.log'}
password: ubuntu
chpasswd: { expire: False }
ssh_pwauth: True
ssh_authorized_keys:
 - ssh-rsa AAAAxxxxxxxxxxxxx
Line 34: Line 34:
# - default = the 'ubuntu' user in addition to other users
Line 35: Line 36:
  #- default #the 'ubuntu' user in addition to other users   - default
Line 37: Line 38:
    password: vagrant     passwd: $6$vxxxxx<hash generated see comment below>xxxxxx
    ### python3 -c 'import crypt,getpass; print(crypt.crypt(getpass.getpass(), crypt.mksalt(crypt.METHOD_SHA512)))'
    lock-passwd: False
Line 41: Line 44:
    groups: users, sudo     groups: sudo
Line 44: Line 47:
    ssh-import-id: vagrant     #ssh-import-id: vagrant
Line 46: Line 49:
    lock_passwd: false
    passwd: vagrant

write_files:
  - path: /test-pes-create.txt
    content: |
      Here is a line.
      Another line is here.

runcmd:
  - touch /test-pes.txt
Line 49: Line 60:
    * now use cloud-localds to create a iso/cdrom file to boot the ubuntu-cloud image with, the iso contains the config
      {{{ cloud-localds -vv ~/seed00.img ubuntu-cloudimg-seed.txt }}}

KVM - Linux kernel virtualization manager

  • Links: docker containers

  • Similar in function to VMware, it uses linux as a hypervisor for guest virtual machines.
  • Makes use of hardware virtualization built into most CPU's.
  • Gui - Virtual Machine Manager
  • Memory dedup with KSM

    • Monitor ksm with
      •      watch -d "tail  /sys/kernel/mm/ksm/* | sed -e :a -e 's/\(.*[0-9]\)\([0-9]\{3\}\)/\1,\2/;ta'"

Storage virsh/kvm

  • Disk storage is a pool, volumes is created from the pool and assigned to individual VM's.
    •  virsh vol-list default 

Ubuntu cloud images on KVM

  • Need a config iso to configure user and ssh keys on boot
    •  sudo apt install cloud-image-utils 

    • Setup config file, must start with #cloud-config, file name: ubuntu-cloudimg-seed.txt
      • #cloud-config
        output: {all: '| tee -a /var/log/cloud-init-output.log'}
        password: ubuntu
        chpasswd: { expire: False }
        ssh_pwauth: True
        ssh_authorized_keys:
         - ssh-rsa AAAAxxxxxxxxxxxxx
        
        # Add users to the system. Users are added after groups are added.
        #  - default = the 'ubuntu' user in addition to other users
        users:
          - default
          - name: vagrant
            passwd: $6$vxxxxx<hash generated see comment below>xxxxxx
            ### python3 -c 'import crypt,getpass; print(crypt.crypt(getpass.getpass(), crypt.mksalt(crypt.METHOD_SHA512)))'
            lock-passwd: False 
            chpasswd: { expire: False }
            gecos: Default dev username vagrant
            primary-group: vagrant
            groups: sudo
            #selinux-user: staff_u
            #expiredate: 2012-09-01
            #ssh-import-id: vagrant
            ssh_pwauth: True
        
        write_files:
          - path: /test-pes-create.txt
            content: |
              Here is a line.
              Another line is here.
        
        runcmd:
          - touch /test-pes.txt
      • now use cloud-localds to create a iso/cdrom file to boot the ubuntu-cloud image with, the iso contains the config
        •  cloud-localds -vv ~/seed00.img ubuntu-cloudimg-seed.txt 

VBox - Oracle virtual box

  • Create physical disk drive
    •  \Program Files\Oracle\VirtualBox\VBoxManage.exe" internalcommands createrawvmdk -filename "C:\Users\<user_name>\VirtualBox VMs\<VM_folder_name>\<file_name>.vmdk" -rawdisk \\.\PhysicalDrive# 

...

linux/KVM (last edited 2017-11-12 22:18:05 by PieterSmit)