Comment 2 for bug 1008866

Revision history for this message
Jaroslav Pulchart (jaroslav-pulchart-4) wrote :

I prepared solution of this issue in my OpenSack Nova fork on GitHUB at https://github.com/pulchart/nova/commit/76e59b9628153b6c71150797f7fe35804502624d

How it works:
- each new snapshot is exported via iSCSI (like volumes)
- nova-volume, on which we creating the new volume from snapshot, register this iSCSI export into local system (if iscsi_ip_preffix filter pass)
- nova-volume can now use local copy
- after that the iSCSI snapshot is unregistered from local system

Unfortunately "host" and "provider_location" are missing in DB schema so I created some hacks:
- "host" is used from snapshot's volume (LVM snapshot is on same host as volume), there is a new API call "snapshot_get_host"
- iSCSI discovery is used instead of using location from database

Fixes:
- "_run_iscsiadm" from nova/volume/driver.py is synchronized with same function from libvirt