Code Monkey home page Code Monkey logo

Comments (7)

nilsmeyer avatar nilsmeyer commented on June 22, 2024 1

I see, that would require a few modification since I haven't thought about that particular use-case, so for example:

layout:
  - device: '/dev/vg0/testvm-root'
    fs: ext4
    mount: /

This doesn't work currently but shouldn't be too difficult to add.

from ansible-debootstrap.

nilsmeyer avatar nilsmeyer commented on June 22, 2024

Do you want to bootstrap the VM from the host system, without booting into a VM? I think this may be possible, you would specify the layout with the logical volume as underlying device, e.g.:

layout:
  - device: '/dev/vg0/testvm-root'
    partitions:
      - num: 1
        size: 1M
        type: ef02
      - num: 2
        size: 1022M
        type: 8300
      - num: 3
        type: 8300

What could be difficult is that the partition table may not be detected automatically (one would need to add a step to call partprobe) and perhaps the detection of device names is off - devices would probably be named /dev/maper/vg0-testvm--root--part1 etc.. I think I already wrote some code to better determine the device names when putting in nvme support.

Creating the fstab and finding the boot device should work already since it uses UUID.

Does this help at all?

from ansible-debootstrap.

uumas avatar uumas commented on June 22, 2024

I should have been clearer. Yes, bootstrapping from the host would be ideal. I don't want multiple partitions, just one with no partition table so the root partition would be just /dev/vg0/testvm-root (/dev/vda, not /dev/vda1 on the vm). I use direct kernel boot, so a bootloader isn't needed at all.

from ansible-debootstrap.

uumas avatar uumas commented on June 22, 2024

Would it be possible to implement it so that the lvm volume could be created automatically too, something like this maybe:

layout:
  - lvm:
      lv: "testvm-root"  
      vg: vg0  
      size: 5G  
      mount: /  
      fs: ext4

This isn't a great syntax, but you get the point.

from ansible-debootstrap.

nilsmeyer avatar nilsmeyer commented on June 22, 2024

I think that would be somewhat out of scope for this ansible role, you can easily create the volume in your playbook beforehand. There are two additional caveats that I just now remembered:

  • You can only install one VM at a time
  • The role may not fully clean up after itself.

from ansible-debootstrap.

uumas avatar uumas commented on June 22, 2024

Yeah, you're right.
Installing one vm at a time is okay.
What do you mean by may not fully clean up after itself

from ansible-debootstrap.

nilsmeyer avatar nilsmeyer commented on June 22, 2024

I mean that it may create things on the host system that don't get removed, I've just looked at the cleanup task and it seems like at the very least I forgot to remove the bootstrap user and its SSH configuration from the host system. I haven't yet tried running this twice from the same box.

from ansible-debootstrap.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.