[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] RE: [Xen-API] How Pygrub work on VHD
> > > > > What I'm doing is, > > > > > > 1. Create a lvm vdi on iscsi SR, > > > 2. dd a vhd file to this vdi, > > > 3. attach this vdi to a (empty)PV vm as device 0(vbd), > > > 4. mark this vbd bootable, > > > 5. then start this vm > > > > Unfortunately this isn't going to work. The choice of whether to use blktap > > (vhd-capable) or blkback (raw device only) is a function of the SR's > > content_type. The 'iscsi' SR uses blkback :( > > > > To see what I mean, try something like this instead: > > > > 1. Create an 'lvmoiscsi' SR > > 2. create a VDI in the new SR > > 3. look inside the new LV -- it should have vhd metadata > > > > Are you trying to import disks in .vhd format? The most future-proof way of > > doing this is to: > > * create a VDI using the API > > * hotplug the VDI into a VM (eg dom0 or a domU) > > * decode the .vhd data, write() it to the raw block device and use seek() > > to preserve sparseness > > > > Simply dd'ing an existing .vhd is risky because XCP is expecting the .vhd > > to have a particular, optimized layout. In particular: > > * extra space is left at the beginning of the file for later resizing > > * parent locators have a particular naming convention > > * blocks are carefully aligned for performance > > > > I understand all you said, but the volume in lvmoiscsi SR seems have the > exact format as VHD file. I'll get back to you after some experimentals Just gave it a try, my way works. I just dd a hvm VHD file to a vdi(volume) in lvmoiscsi SR, and attach this vdi to a VM, this VM boots successfully. But it doesn't work for PV VM, the issue is pygrub can't grab kernel and initrd from VHD image. if it is HVM VM, all accesses to VHD image is from inside VM, blktap will handle all accesses. The only question is, how pygrub grab kernel and initrd from VHD image? Thanks, Anthony > > > - Anthony > > _______________________________________________ xen-api mailing list xen-api@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/mailman/listinfo/xen-api
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |