resizeVolume of a running system VM's volume is accepted but the VM never sees the new size

Aberta Para iniciantes
#14,645 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
72/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
java
Domínio
backend, cloud

Direção de pesquisa

Comece por VolumeApiServiceImpl.orchestrateResizeVolume e acompanhe como ele identifica a VM e aplica as verificações de estado existentes para o redimensionamento. Confira os testes relacionados ao redimensionamento de volumes que altera apenas o tamanho e aos estados de VMs do sistema; a alteração estará concluída quando o redimensionamento de um volume de uma VM do sistema for recusado, a menos que a VM esteja parada, enquanto o redimensionamento de uma VM parada continua funcionando.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

problem

A size-only resizeVolume of a running system VM's volume, for example a virtual router's ROOT, is accepted and resizes the volume on the storage. The running system VM is never told, so the guest keeps seeing the old size until it next starts. The API, the database and the storage all report the new size while the VM still runs on the old one.

VolumeApiServiceImpl.orchestrateResizeVolume only looks the VM up as a user VM (_userVmDao.findById). For a system VM that returns null, so the resize is sent with the instance name none and no host. On KVM the image is grown, but virsh blockresize is never run for the running domain. The per-hypervisor checks in the same method (XenServer can only resize a stopped VM's disk; on KVM the VM's host must be Up and Enabled) are skipped for the same reason.

Other paths already treat system VM volumes differently:

  • volume snapshots of system VM volumes are refused;
  • attach and detach accept only user VMs;
  • a ROOT resize through a new disk offering is refused unless the VM is Stopped.

The size-only path has no such check.

versions

4.22, and main.

The steps to reproduce the bug

Seen on KVM with Ceph RBD primary storage:

  1. Take a running virtual router whose ROOT disk offering is not size-strict.
  2. Call resizeVolume id=<router ROOT volume> size=<larger size in GB>.
  3. The call succeeds. listVolumes and rbd info show the new size.
  4. On the host, virsh domblkinfo <router> vda still shows the old size, and so does lsblk in the router. The new size only appears after the router is restarted.
What to do about it?

Refuse to resize the volume of a system VM that is not Stopped, with an error telling the admin to stop it first. Resizing it while it is stopped keeps working as before, and the VM sees the new size when it starts.

Doing the resize live instead would mean running the system VM's resize through the VM work queue and notifying the hypervisor, as is done for user VMs, and checking that on each hypervisor. Refusing is the smaller, safer change.

Linguagem predominante
Java
Estrelas
3.1k
Forks
1.4k
Merge médio
6d 20h
PRs com merge (30d)
17

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de apache/cloudstack

Todas as issues de apache/cloudstack

Issues semelhantes

Mais issues de Java

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.