Task #7761: uncloud v2
Write a django command to migrate opennebula VMs to regular VMs
- Basically take all Opennebula VMs that are in the DB and migrate them to uncloud_vm.VM and related models
- need to create diskproducts and co.
- Also create network cards
- Long term: also create orders for it, but not now
When converting to an uncloud VM, be sure to include a reference to the
source type (ceph, file) and the name (
Updated by Ahmed Bilal over 1 year ago
Another thing, nico is that VMProduct is based on Product which is related to Order. So, how should I populate the Order field?
class VMProduct(Product): vmhost = models.ForeignKey( VMHost, on_delete=models.CASCADE, editable=False, blank=True, null=True ) cores = models.IntegerField() ram_in_gb = models.FloatField() class Product(models.Model): uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) owner = models.ForeignKey(get_user_model(), on_delete=models.CASCADE, editable=False) description = "" status = models.CharField(max_length=256, choices = ( ('pending', 'Pending'), ('being_created', 'Being created'), ('active', 'Active'), ('deleted', 'Deleted') ), default='pending' ) order = models.ForeignKey(Order, on_delete=models.CASCADE, editable=False) class Meta: abstract = True