Preparing Machine Images for qemu/KVM

Поділитися
Вставка
  • Опубліковано 2 лип 2024
  • Building on our previous video around libvirt/qemu/kvm, now we'll explore the idea of creating base images we can clone. This enabled us to quickly create base images that are easy to replicate!
    0:00 - Intro & Machine Images
    5:43 - Image Setup
    12:41 - Base Image Prep
    27:48 - Cloning Images
    33:28 - Summary
    octetz site post: octetz.com/docs/2020/2020-10-...
    libvirt/qemu/kvm post: octetz.com/docs/2020/2020-05-...
  • Наука та технологія

КОМЕНТАРІ • 45

  • @harunafaruk2971
    @harunafaruk2971 23 дні тому +1

    This is the best video on youtube about this topic I have found. It has help save me a ton of work. Thanks a lot

  • @ericgorder1
    @ericgorder1 2 місяці тому

    Thank you Josh! You did a well job of explaining everything. I never got bored and it was well worth my time!

  • @lamka02sk
    @lamka02sk 3 роки тому +3

    Amazing video as always!
    Thank you for more in-depth explanation how all this works. This is certainly better way than "binding" the IP address to the server's MAC address.

  • @munir32
    @munir32 3 роки тому +8

    This is really COOL. I can't thank you enough to prepare such a video. Please keep doing :)

  • @varenneriocha8712
    @varenneriocha8712 3 роки тому +1

    Very valuable. Many thanks!
    On a side note, your video technique is perfect: Terminal full-size and the talking-head with transparent background. ;-)

  • @krishnachaitanya1164
    @krishnachaitanya1164 3 роки тому

    Excellent Video! Taught me more in 20 mins than over 2 days of reading blogs and articles from google search. And a great companion blog to follow through.

  • @StarFireG3
    @StarFireG3 2 роки тому

    Very helpful videos. I got into libvirt with your videos and had it up and running in no time. Bye bye to VirtualBox and expensive commercial tools I cannot afford. Thanks a lot and keep up the good work!

  • @davidllanes7884
    @davidllanes7884 3 роки тому

    "pretty freaking cool" but very instructive and with a lot of different topics which show how you master them. Complementary web post is really appreciated. A cool feature would be to create a script that would be able not only to clone the image but also to automatically boot up the k8s cluster with one admin and the rest workers. Congratulations and thanks!

  • @wolfwingx1
    @wolfwingx1 Рік тому +1

    You can use hostnamectl to set the hostname without rebooting. For example you can set a hostname to "cool-new-vm" by running `sudo hostnamectl --transient hostname cool-new-vm`.

  • @anasir514
    @anasir514 3 роки тому +2

    amazing explanation, easy, clear, and right on point. thanks a million

  • @hammerheadlemon
    @hammerheadlemon 3 роки тому

    I'm very new to visualisation and this and your other video on libvirt really helped me understand what's going on. Great delivery, really clear and we'll prepared - and thanks for using a sensible font size on your terminal so we can read it! So many UA-camrs omit that.
    Would love to see a video on networking options in QEMU/KVM and/or libvirt. Thanks again and all the very best.

  • @Mrhennayo
    @Mrhennayo Рік тому

    been struggling with the reason for like 2 weeks now!
    thanks mate for the info

  • @scottseymour8855
    @scottseymour8855 3 роки тому

    totally new to all of this, another great video! cheers :)

  • @diegoclavijoflores4113
    @diegoclavijoflores4113 3 роки тому

    Awesome, pretty good explanation 👍

  • @arborrell
    @arborrell 3 роки тому

    Thanks again for a wonderful tutorial. The level of content, the exposition and quality production are very, very good. You've mentioned some kubernetes/ansible possible videos, I'll be looking for that, and would also like a video about migrating vm's to another machine.

  • @emmanuelaboagye4624
    @emmanuelaboagye4624 3 роки тому

    Great Video. Thanks very much for the in-depth explanation. I would like to also request that you give a tutorial on automating the image preparation process as you mentioned during this video. It will be very helpful to me. Kudos..., the Best so far videos I have seen on libvirt-Qemu-KVM is from you.

  • @GrahamAtDesk
    @GrahamAtDesk 2 роки тому

    Awesome video, thank you! You've literally saved me hours with these two vids on libvirt.

  • @mortezaabbaspour
    @mortezaabbaspour Рік тому

    Thank you Josh

  • @PiperUsmc
    @PiperUsmc 2 роки тому

    Very informative brosif! :P

  • @vandanasippy4970
    @vandanasippy4970 2 роки тому

    As usual, very informative. Simple workaround will be to clone the VM from existing VM. empty the /etc/machine-id file. change hostnamectl set-hostname and restart the cloned machine. We have so many versions of VMs running, will be difficult to manage so many base images.

  • @naziajahan1657
    @naziajahan1657 3 роки тому

    Thanks a lot.

  • @hustephen5134
    @hustephen5134 3 роки тому

    WoW, Very helpfull, Subscrided.

  • @forrestkong3455
    @forrestkong3455 Рік тому

    🎉🎉🎉nice

  • @shand7074
    @shand7074 2 роки тому

    Man this is amazing. Do you have something plan with Ansible and the Qemu/KVM/Libvirt stack or maybe with Packer?

  • @micleh
    @micleh 3 роки тому

    Good or bad? - definitely good or rather excellent. Just seeing you tinker with kvm is awesome, and I learned a lot. If you intend to extend the kvm series, perhaps you can do a more ordinary example of setting up a vm correctly. In my workplace I need to use Windows or a Mac, but I don't want to install those on my machine. Perhaps you can show how to set them up with passthrough.

  • @fusca14tube
    @fusca14tube 3 роки тому

    Awesome!! What about deleting the SSH keys in /etc/sshd in the Base Image Prep step? Is it a good idea? Thanks in advance.

  • @daxcor
    @daxcor 2 роки тому

    ok you are one of the best presenters I have seen a long time. Well done. I had this question as well so this is good. So the idea then is to make unique vms, is to start with a image that you can clone, and then have an after install script to do all heaving lifting after the fact. I am guessing this is how the big boys create the vm's when they allow you to add "user data". One thing I need to do is to be able to pass into the cloning process a hostname, that equates to the unique username for each of my customers. Any thoughts how to do that from the cli? Virsh. Again thanks this has been awesome.

  • @igielv
    @igielv Рік тому

    What about using 'virt-sysprep' for cleaning up stuff from base image? ...otherwise pretty good job and still lot of cool ideas to take from your videos, really like them, keep up. 👍

  • @syedsami6416
    @syedsami6416 3 роки тому

    Hi, excellent video in series! we would be grateful if you can explain as how we can move the existing storage to the new cloned VM. for example, we have volgroup1 assigned to VM1, we clone it to vm2 and wanted to assign the same volgroup1 to VM2 ??

  • @Oswee
    @Oswee 3 роки тому

    Would be great to cover the topic about the kickstart.cfg installations. And then iPXE (my favorite part) setups with things like CoreOS, Matchbox, Tftp, etc.
    I personally use simple Pi Bastion (DHCP) server which provides all the configs for paticular mac addresses. Virt-install takes an --mac(--network) argument. You specify the MAC and the VM will get the config from the DHCP. Same for hostname etc. This way via DHCP you have centralized place to manage the network layout. Then you can extend it further into iPXE setup.
    I believe, you can integrate that into pfSense router directly as well if you wish.
    Bastion itself can be automated with Ansible.
    And isn't there a 'hostnamectl set-hostmame' utility?

  • @vlmath314
    @vlmath314 3 роки тому

    great video.
    could also use vagrant to set up the machines based upon a custom box (equivalent of the base image model), and ansible to configure them (no need to worry about the ip and the hostname, managed by vagrant, but still love to know how to do it manually).

    • @MarkConstable
      @MarkConstable 3 роки тому

      Even bettter would be an orchestration-free plain shell method so we can see how it all really works and then we can then bolt on whatever management layers we each need.

  • @aliakbarhemmati31
    @aliakbarhemmati31 Рік тому

    Hey, thanks for the good stuff. Is it possible to create a video about cloud-init? I think it is more flexible and exactly does this customizations.

    • @joshrosso
      @joshrosso  Рік тому

      Great idea, I'd love to cover cloud-init in the future. As you said, cloud-init can be more flexible.
      I believe the really interesting concept, when looking at cloud-init, that is considering what is best baking into an image relative to cloud-init. In other words, I believe there's a case for certain things being baked/versioned within the image while others (and far fewer) can be initialized using cloud-init.

    • @aliakbarhemmati31
      @aliakbarhemmati31 Рік тому

      @@joshrosso Yes, exactly. Like creating a template VM for Kubernetes with all needed binaries and files (kubeadm, kubelet, containerd/CRI-O, etc.) and using cloud-init for other stuff

  • @michaelsegel8758
    @michaelsegel8758 Рік тому

    Josh great video.
    While you're using Ubuntu, have you ever tried using KVM to create an instance of a different distro? Like running Rocky/Centos in a VM instance with Ubuntu as your main OS?
    Would it be the same except that you would specify a different iso image? (And of course use different linux command to modify the packages (yum vs apt) )

    • @joshrosso
      @joshrosso  Рік тому +1

      Yeah, it should work just fine. My hypervisor is typically arch and runs anything atop, ubuntu, windows, etc 👍

  • @MarkConstable
    @MarkConstable 3 роки тому

    Excellent Josh. Now how about adding a full networking tutorial without kubernetes being involved? I'm still unclear how to access all the cloned VMs via a host bridge and setting up Pods just seems to muddy the waters (for me atm).

    • @MarkConstable
      @MarkConstable 3 роки тому

      Doh, really simple. I already had a host bridge setup so all I had to do was add "--network bridge=br0" to the virt-install invocation. Also, I'd like to thank you again for this particular video because it would have taken me forever to figure out the core tricks you outlined on how to clone an embryonic master image.

    • @MarkConstable
      @MarkConstable 3 роки тому

      @@joshrosso FWIW I just tripped over virt-sysprep which seems like it could do a lot of this work preparing a VM for cloning. Just testing it out now.

  • @jumpman1823
    @jumpman1823 3 роки тому +1

    Bruh where you been?

  • @michaczerwonka8720
    @michaczerwonka8720 2 роки тому

    Whats about cloud-init images? Meta data userdata vendordata

  • @paulmaydaynight9925
    @paulmaydaynight9925 3 роки тому

    how might you set up (the Live cd/USB script writer) Tomas's tiny Debian 'slax customize.php' as a primary virtual libvirt/qemu/kvm net pxe (v)lan boot server including apt dependencies so as too br0 boot any new vm (or even real hw) from it's faster web server transfer images you put there?
    use case :perhaps a home slax iSCSI with bods serving a bunch of vm's storage over 2.5Gb/10Gb direct lan br01Gb local wan

  • @beardyface8492
    @beardyface8492 2 роки тому

    Systemd is there, & *you've* learned to live with it.. I fought with it for some years, never found a good escape route or workable Linux alternative, & returned to Windows... Just saying.

    • @beardyface8492
      @beardyface8492 2 роки тому

      @@joshrosso Perhaps.
      I did briefly have Debian Buster (LXDE) installed & working with Open RC instead, which involved switching to using elogind, skipping a few unimportant packages from the base system, backporting (and patching) policykit from experimental, then hacking the depends on one of the LXDE packages to substitute elogind for systemd to get LXDE to install.
      Which was both too much effort to do, too much pain to maintain with pinned packages, and struck me as potentially too fragile for a system I actually use.
      Maybe I'll have another look at whatever Debian Stable is now Buster is Old-stable, if it's easier again maybe you will.
      As it was it was *PAINFUL* to escape after Jessie.