Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: OpenStack: Dev

Questions on VM Lifecycle

 

 

OpenStack dev RSS feed   Index | Next | Previous | View Threaded


moseleymark at gmail

May 3, 2012, 4:50 PM

Post #1 of 3 (236 views)
Permalink
Questions on VM Lifecycle

This is almost certainly RTFM territory, so I ask at my own peril.
Just be assured that repeated days of googling hasn't told me what I
want to know.

Quick background: I'm looking to use OpenStack Nova (Essex, Ubuntu
12.04 packages, 64-bit) to build a large pool of persistent KVM VMs,
though used on-demand -- that is, not necessarily always on. These VMs
could then be used to augment existing physical server pools during
high resource usage. I need to have *really* fixed IPs, i.e. the IP on
the vm will be registered with DNS and should be on that same VM
forever. To get things working with our imaging system, the VM also
needs to have a specific MAC address (at least the first time it
runs), so the imaging system's DHCP+PXE can recognize the new node and
image accordingly. I'm subclassing FlatManager to manage the MAC
address (it's taking the IP passed in with "nova boot ... --nic=" and
converting the last 3 octets into the last 3 octets of the MAC address
-- ugly, not very portable, but works for now), since this all needs
to live in existing networks. It's entirely possible what I'm trying
to do just isn't a good fit for Nova, but it already takes care of a
lot of other things for me (like volume mgmt, etc) that I'd otherwise
have to solve myself. If it isn't a good fit, if anyone has any
alternative suggestions for projects I should look at, I'd definitely
appreciate it!


* What is the right way to stop/start a persistent instance? So far
I've been using 'nova boot' to start and 'nova delete' to stop. E.g.:

> nova boot --flavor=1 --image c5cecc17-295c-4ebc-9019-2ccc222d3f52 --key_name=key3 --nic net-id=63743ee0-f8a1-45f8-888a-cce38d09cca2,v4-fixed-ip=192.168.1.2 --block_device_mapping vda=11 --block_device_mapping vdb=12 --nic=net-id=63743ee0-f8a1-45f8-888a-cce38d09cca2 myvm1

> nova delete myvm1

This has the drawbacks that subsequent uses of 'nova boot' for that VM
want to recreate all the various entries in the various tables, so if
I call 'nova boot' again, the 'virtual_interface' table still has an
entry in it with that MAC address, so the startup will fail unless I
delete that entry (MAC field is unique). And 'fixed_ips' for
subsequent startups will grab a different IP address, unless I update
that entry in 'fixed_ips' and set instance_id=NULL. That is, doing a
'nova delete' doesn't change anything in the mysql entries for that
instance's 'fixed_ips' or 'virtual_interfaces'. Or should 'nova
delete' actually be doing those things (like setting the
virtual_interfaces entry's 'deleted' to 1 or setting instance_id to
NULL) and I've just broken them? :)

So I'm hoping/guessing that there's a smarter way to do this that
tells Nova that it can start up a shut-off instance, instead of a
fresh one, in which case it'd presumably pick up its old entries in
virtual_interfaces/fixed_ips. Though then I suppose there'd have to be
a way to boot with something like "nova boot ... --instance=## ...".
For powering on/off, 'nova host-action' looked promising, but hasn't
been implemented yet for libvirt.


* Not really a question, but if I'm using persistent storage, it'd be
nice if I didn't have to specify "--image", since I'm not actually
using the image.


* Is there a way to add an interface, but without Nova trying to
configure it? That is, add an eth1 to the vm but do nothing else (yes,
I realize I'll have to muck with ebtables/iptables on the compute
node). Our imaging process will take care of the network
configuration, so it'd be one less thing to add to Nova's management
overhead. I can probably accomplish the same thing with a dummy
network on the VM's eth1, since it's not actually being injected.


* Any plans to add a mac= subarg to the "--nic" option in 'nova boot'?


* Anybody else using Nova like this, esp on existing networks?


Sorry for the long and rambling email!

_______________________________________________
Mailing list: https://launchpad.net/~openstack
Post to : openstack [at] lists
Unsubscribe : https://launchpad.net/~openstack
More help : https://help.launchpad.net/ListHelp


vishvananda at gmail

May 4, 2012, 1:34 PM

Post #2 of 3 (206 views)
Permalink
Re: Questions on VM Lifecycle [In reply to]

On May 3, 2012, at 4:50 PM, Mark Moseley wrote:

>
> * What is the right way to stop/start a persistent instance? So far
> I've been using 'nova boot' to start and 'nova delete' to stop. E.g.:
>
>> nova boot --flavor=1 --image c5cecc17-295c-4ebc-9019-2ccc222d3f52 --key_name=key3 --nic net-id=63743ee0-f8a1-45f8-888a-cce38d09cca2,v4-fixed-ip=192.168.1.2 --block_device_mapping vda=11 --block_device_mapping vdb=12 --nic=net-id=63743ee0-f8a1-45f8-888a-cce38d09cca2 myvm1

You might try

nova suspend/resume

(does a hypervisor-level suspend where all memory is written to disk and the vm is stopped)

or

nova pause/unpause

(stops emulation of the vm

or

api.openstack.org -- stop/start

(this one is not exposed to novaclient, but it will shutdown the instance but not delete any files)

>
> * Not really a question, but if I'm using persistent storage, it'd be
> nice if I didn't have to specify "--image", since I'm not actually
> using the image.

the image should only be necessary for the initial boot

>
>
> * Is there a way to add an interface, but without Nova trying to
> configure it? That is, add an eth1 to the vm but do nothing else (yes,
> I realize I'll have to muck with ebtables/iptables on the compute
> node). Our imaging process will take care of the network
> configuration, so it'd be one less thing to add to Nova's management
> overhead. I can probably accomplish the same thing with a dummy
> network on the VM's eth1, since it's not actually being injected.

not now

>
>
> * Any plans to add a mac= subarg to the "--nic" option in 'nova boot'?

this was discussed at some point, but no active development that i know of



_______________________________________________
Mailing list: https://launchpad.net/~openstack
Post to : openstack [at] lists
Unsubscribe : https://launchpad.net/~openstack
More help : https://help.launchpad.net/ListHelp


moseleymark at gmail

May 4, 2012, 1:49 PM

Post #3 of 3 (249 views)
Permalink
Re: Questions on VM Lifecycle [In reply to]

On Fri, May 4, 2012 at 1:34 PM, Vishvananda Ishaya
<vishvananda [at] gmail> wrote:
>
> On May 3, 2012, at 4:50 PM, Mark Moseley wrote:
>
>>
>> * What is the right way to stop/start a persistent instance? So far
>> I've been using 'nova boot' to start and 'nova delete' to stop. E.g.:
>>
>>> nova boot --flavor=1 --image c5cecc17-295c-4ebc-9019-2ccc222d3f52 --key_name=key3 --nic net-id=63743ee0-f8a1-45f8-888a-cce38d09cca2,v4-fixed-ip=192.168.1.2 --block_device_mapping vda=11 --block_device_mapping vdb=12 --nic=net-id=63743ee0-f8a1-45f8-888a-cce38d09cca2 myvm1
>
> You might try
>
> nova suspend/resume
>
> (does a hypervisor-level suspend where all memory is written to disk and the vm is stopped)
>
> or
>
> nova pause/unpause
>
> (stops emulation of the vm
>
> or
>
> api.openstack.org -- stop/start
>
> (this one is not exposed to novaclient, but it will shutdown the instance but not delete any files)

Yup, suspend/resume are exactly what I was looking for. I would've put
money down that I'd tried suspend and it'd left the kvm running. I
must've been trying pause/unpause (or just confusing it with virsh
suspend, which basically pauses the vm but leaves the process
running).


>> * Not really a question, but if I'm using persistent storage, it'd be
>> nice if I didn't have to specify "--image", since I'm not actually
>> using the image.
>
> the image should only be necessary for the initial boot

Hmm, I forget if it was saying this before, but when I try to boot
without --image (using the same nova boot invocation as above, but
without the "--image <image uuid>" part), I get:

ERROR: 'NoneType' object has no attribute 'isdigit'

I can dig into it more if it'd be helpful (opengrok has been amazingly
useful for working with nova source code). Though in light of your and
Mandar's suggestion to use 'nova suspend/resume', I shouldn't be
reusing 'nova boot' anyway, so I guess it's moot.


>> * Is there a way to add an interface, but without Nova trying to
>> configure it? That is, add an eth1 to the vm but do nothing else (yes,
>> I realize I'll have to muck with ebtables/iptables on the compute
>> node). Our imaging process will take care of the network
>> configuration, so it'd be one less thing to add to Nova's management
>> overhead. I can probably accomplish the same thing with a dummy
>> network on the VM's eth1, since it's not actually being injected.
>
> not now

Ok, good to know I'm not just overlooking something. Having the
ability to attach unconfigured-but-present devices, even beyond NICs,
might be useful.


>> * Any plans to add a mac= subarg to the "--nic" option in 'nova boot'?
>
> this was discussed at some point, but no active development that i know of

Ok, also good to know. Maybe I'll muck with it -- though my python is
just barely passable, so it'd be a rough first cut at best.

I also figured out my IP reuse issue: I added to /etc/nova/nova.conf
"--fixed_ip_disassociate_timeout=1". Any nasty side effects of setting
that?

_______________________________________________
Mailing list: https://launchpad.net/~openstack
Post to : openstack [at] lists
Unsubscribe : https://launchpad.net/~openstack
More help : https://help.launchpad.net/ListHelp

OpenStack dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.