Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Libvirt support #35

Merged
merged 2 commits into from
Aug 30, 2018
Merged

Conversation

enxebre
Copy link
Member

@enxebre enxebre commented Aug 30, 2018

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 30, 2018
@enxebre
Copy link
Member Author

enxebre commented Aug 30, 2018

cc @frobware @ingvagabund @bison

@bison
Copy link
Contributor

bison commented Aug 30, 2018

Looks like a reasonable start to me. /lgtm

@bison
Copy link
Contributor

bison commented Aug 30, 2018

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 30, 2018
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bison, enxebre

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 4295414 into openshift:master Aug 30, 2018
wking added a commit to wking/machine-api-operator that referenced this pull request Sep 23, 2018
The actuator looks up the baseVolumeID in the configured pool [1].
That lookup works with both the volume name and full volume path:

  $ virsh -c qemu:///system vol-info --vol coreos_base --pool default
  Name:           coreos_base
  Type:           file
  Capacity:       16.00 GiB
  Allocation:     1.55 GiB

  $ virsh -c qemu:///system vol-info --vol /home/trking/VirtualMachines/coreos_base --pool default
  Name:           coreos_base
  Type:           file
  Capacity:       16.00 GiB
  Allocation:     1.55 GiB

But it fails if you use the wrong full path:

  $ virsh -c qemu:///system vol-info --vol /var/lib/libvirt/images/coreos_base --pool default
  error: failed to get vol '/var/lib/libvirt/images/coreos_base'
  error: Storage volume not found: no storage vol with matching path '/var/lib/libvirt/images/coreos_base'

My default pool happens to be in my home directory:

  $ virsh -c qemu:///system pool-dumpxml default
  <pool type='dir'>
    <name>default</name>
    <uuid>c20a2154-aa60-44cf-bf37-cd8b7818a4e4</uuid>
    <capacity unit='bytes'>105554829312</capacity>
    <allocation unit='bytes'>44134699008</allocation>
    <available unit='bytes'>61420130304</available>
    <source>
    </source>
    <target>
      <path>/home/trking/VirtualMachines</path>
      <permissions>
        <mode>0777</mode>
        <owner>114032</owner>
        <group>114032</group>
        <label>system_u:object_r:virt_image_t:s0</label>
      </permissions>
    </target>
  </pool>

This commit allows configutions like mine by dropping our opinions
about the default pool location and just using the volume names:

  $ virsh -c qemu:///system vol-list --pool default
   Name                 Path
  ------------------------------------------------------------------------------
   bootstrap            /home/trking/VirtualMachines/bootstrap
   bootstrap.ign        /home/trking/VirtualMachines/bootstrap.ign
   coreos_base          /home/trking/VirtualMachines/coreos_base
   master-0.ign         /home/trking/VirtualMachines/master-0.ign
   master0              /home/trking/VirtualMachines/master0
   worker.ign           /home/trking/VirtualMachines/worker.ign

We've been using the full-path approach since the templates landed in
2522d0f (add libvirt support, 2018-08-30, openshift#35), but there's no
discussion there about why the path approach was chosen instead of the
name approach I'm switching to here.

Longer-term, it would be nice to pull both the pool and volume names
from information pushed by the installer [2].  But I'm punting on
*that* for this commit.

Reported-by: Matt Rogers <[email protected]>

[1]: https://github.com/openshift/cluster-api-provider-libvirt/blob/2e5a516afc704c6c94d7b7cde74e78c43bbfeaa5/cloud/libvirt/actuators/machine/utils/volume.go#L174
[2]: https://github.com/openshift/installer/blob/dc4764dc603cea5da0e54f575b7ae1a2c26d3102/pkg/types/machinepools.go#L53-L58
ingvagabund pushed a commit to ingvagabund/machine-api-operator that referenced this pull request Jul 11, 2019
add support for filters on sg and subnet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants