Skip to content

Commit

Permalink
virt-install: don't fail on storage pools without targets.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlanyon committed Mar 26, 2013
1 parent dca5a4d commit bad518b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion virtinst/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ def lookup_pool_by_path(conn, path):
def check_pool(poolname, path):
pool = conn.storagePoolLookupByName(poolname)
xml_path = get_xml_path(pool.XMLDesc(0), "/pool/target/path")
if os.path.abspath(xml_path) == path:
if xml_path is not None and os.path.abspath(xml_path) == path:
return pool

running_list = conn.listStoragePools()
Expand Down

3 comments on commit bad518b

@zultron
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were you actually able to to use virtinst to create VMs with RBD-backed storage? I see this patch in virt-manager (which absorbed python-virtinst), but no anecdotes of anyone actually succeeding with RBD. Thanks-

John

@tomlanyon
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we have a number of VMs still running RBD backed disks. Without this patch, you can't use virt-install to attach disks, so I ended up with a shell script to build a new VM which ran virt-install with --nodisks and --noautoconsole, and then immediately called 'virsh attach-device ...' to attach the RBD disk from an XML definition. This meant the RBD disk would still be attached to the machine by the time the OS started to boot/install.

@zultron
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't quite understand. Without this patch virt-install can't attach RBD disks, so you use the shell script hack. With this patch, could virt-install attach RBD disks? I haven't gotten it to work, but I haven't started debugging seriously yet.

Otherwise, thanks for the idea for the hack; that might work, too. I'm making small changes to put RBD into cobbler, which runs virt-install. I might just wrap virt-install with a script like that.

Please sign in to comment.