All of lore.kernel.org
 help / color / mirror / Atom feed
* persistent or "steady-state" style disks
@ 2012-02-16 20:09 Matthew Hook
  2012-02-17 21:21 ` Dave Scott
  0 siblings, 1 reply; 3+ messages in thread
From: Matthew Hook @ 2012-02-16 20:09 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1324 bytes --]

Hi,

I have a requirement (and a limited timeframe) to make a Windows 7 VM
domain roll back to a fixed state on restart, shutdown etc.
Something like a Kiosk Mode.  I think this is a very needed part of the
core of xen and this functionality does
not appear to be part of xen already.  So I've been trying various ways to
make this work.

Has anyone already implemented something like this successfully before?

What I've been experimenting unsuccessfully with currently is the following:

1) Add hooks into the blktap2 code to roll back a VHD (currently based on
the name ending in -persist.vhd).
However, it's not working out as it should.

2) Second attempt was to write an external script and call it periodically.
The idea was to call vhd-snapshot on the parent disk to a new disk (temp
name).  Then do an atomic rename on existing vhd
and unlink the old vhd.  When it restarts you would think it would open up
the new snapshot.  Unfortunately, a reboot seems to
detect that the file is different and so it's not re-started as desired but
instead the domain is shutdown.

I don't like either of the above methods.  They are hacks in my opinion but
I'm not currently familiar enough with xen internals.
Can someone propose a method and/or suggest where I could hook into the xen
tools to implement it?

Regards,
Matthew

[-- Attachment #1.2: Type: text/html, Size: 1614 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: persistent or "steady-state" style disks
  2012-02-16 20:09 persistent or "steady-state" style disks Matthew Hook
@ 2012-02-17 21:21 ` Dave Scott
  2012-02-21  2:27   ` Matthew Hook
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Scott @ 2012-02-17 21:21 UTC (permalink / raw)
  To: 'Matthew Hook', xen-devel

Hi,

Matthew Hook wrote:
> I have a requirement (and a limited timeframe) to make a Windows 7 VM domain roll back to a fixed state on restart, shutdown etc.
> Something like a Kiosk Mode.  I think this is a very needed part of the core of xen and this functionality does 
> not appear to be part of xen already.  So I've been trying various ways to make this work.

XCP has a feature which might do what you need.

If you are using .vhd file based storage (SR types 'ext' or 'nfs') then you can do the following: (for a VM called "myvm")

# 1. Ensure the .vhd chain has length 2 (a current restriction)
xe vm-copy vm=myvm new-name-label=nonpersistent.parent
xe vm-clone vm=nonpersistent.parent new-name-label=nonpersistent

# 2. Set the VDI on-boot=reset
xe vm-disk-list vm=nonpersistent
 ... note the VDI uuid of the disk you want to reset ...
xe vdi-param-set uuid=... on-boot=reset

# 3. Start the VM
xe vm-start vm=nonpersistent

HTH,
Dave

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: persistent or "steady-state" style disks
  2012-02-17 21:21 ` Dave Scott
@ 2012-02-21  2:27   ` Matthew Hook
  0 siblings, 0 replies; 3+ messages in thread
From: Matthew Hook @ 2012-02-21  2:27 UTC (permalink / raw)
  To: Dave Scott; +Cc: xen-devel

Thanks for that information.

It isn't obvious in the XCP code how this feature is being done and
I'm not wanting to use XCP at this point as it's behind without the
latest hypervisor included.

I actually created a patch where you can can set the temporary flag on
the VHD features footer through vhd-util.
Traditionally in the MS world is used to omdocated that the VHD can be
removed on close.
I'm using it for reset-on-boot where if the flag is set during
_vhd_open it tests the flag and if set will regenerate the snapshot
from the parent VHD.

If anyone is interested in this patch right now I can send it through
as is.  However, I'll submit it properly once I've done a bit
more testing.

Comments are welcome.

Matt

On 17 February 2012 13:21, Dave Scott <Dave.Scott@eu.citrix.com> wrote:
>
> Hi,
>
> Matthew Hook wrote:
> > I have a requirement (and a limited timeframe) to make a Windows 7 VM domain roll back to a fixed state on restart, shutdown etc.
> > Something like a Kiosk Mode.  I think this is a very needed part of the core of xen and this functionality does
> > not appear to be part of xen already.  So I've been trying various ways to make this work.
>
> XCP has a feature which might do what you need.
>
> If you are using .vhd file based storage (SR types 'ext' or 'nfs') then you can do the following: (for a VM called "myvm")
>
> # 1. Ensure the .vhd chain has length 2 (a current restriction)
> xe vm-copy vm=myvm new-name-label=nonpersistent.parent
> xe vm-clone vm=nonpersistent.parent new-name-label=nonpersistent
>
> # 2. Set the VDI on-boot=reset
> xe vm-disk-list vm=nonpersistent
>  ... note the VDI uuid of the disk you want to reset ...
> xe vdi-param-set uuid=... on-boot=reset
>
> # 3. Start the VM
> xe vm-start vm=nonpersistent
>
> HTH,
> Dave

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-21  2:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-16 20:09 persistent or "steady-state" style disks Matthew Hook
2012-02-17 21:21 ` Dave Scott
2012-02-21  2:27   ` Matthew Hook

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.