vm_id generation

Use queue to generate unique vm_id for each VM.