[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [atomic-devel] Direct LVM by default



On Tue, Sep 23, 2014, at 09:31 AM, Karanbir Singh wrote:
>
> 8G disk is considered default/normal in most cloud vendor ecosystems,
> and then layer in cloud-utils-growpart to consume whatever disk size is
> allocatred to the instance. I wouldnt go too far away from 8G, it at all.

This patch should do it.  Any other opinions?
From ab3318c58b1207dd0bf64f18927f314a960b212c Mon Sep 17 00:00:00 2001
From: Colin Walters <walters verbum org>
Date: Thu, 25 Sep 2014 13:15:28 -0400
Subject: [PATCH] Revert back to 8GB disk size, also drop swap space

Per discussion on atomic-devel, cloud images are expected to be 8GB.
Because it's LVM, one can resize dynamically.

We're dropping swap to match the Fedora cloud image default.
---
 src/js/libqa.js                                 | 13 ++++---------
 src/scripts/trivial-autocompose-create-disks.sh |  2 +-
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/js/libqa.js b/src/js/libqa.js
index a1d91e8..ecbd5ea 100644
--- a/src/js/libqa.js
+++ b/src/js/libqa.js
@@ -31,7 +31,6 @@ const FileUtil = imports.fileutil;
 
 const BOOT_UUID = "fdcaea3b-2775-45ef-b441-b46a4a18e8c4";
 const ROOT_UUID = "d230f7f0-99d3-4244-8bd9-665428054831";
-const SWAP_UUID = "61f066e3-ac18-464e-bcc7-e7c3a623cec1";
 
 const DEFAULT_GF_PARTITION_OPTS = ['-m', '/dev/atomicos/root', '-m', '/dev/sda1:/boot'];
 
@@ -119,10 +118,9 @@ function _installSyslinux(gfHandle, cancellable) {
 }
 
 function createDisk(diskpath, cancellable, params) {
-    params = Params.parse(params, { sizeMb: 16 * 1024,
+    params = Params.parse(params, { sizeMb: 8 * 1024,
 				    bootsizeMb: 200,
-				    swapsizeMb: 128,
-				    rootfsLVPercent: 20,
+				    rootfsLVPercent: 30,
 				    dockerMetaPercent: 8,
 				    dockerDataPercent: 100});
     let guestfishProcess;
@@ -151,13 +149,11 @@ function createDisk(diskpath, cancellable, params) {
 	gfHandle.set_e2uuid("/dev/sda1", BOOT_UUID);
     }
     let lvsizeMb = params.sizeMb - params.bootsizeMb;
-    let rootsizeMb = lvsizeMb - params.swapsizeMb;
+    let rootsizeMb = lvsizeMb;
     let rootPV = "/dev/sda2";
     gfHandle.pvcreate(rootPV);
     gfHandle.vgcreate("atomicos", [rootPV]);
 
-    gfHandle.lvcreate("swap", "atomicos", params.swapsizeMb);
-    gfHandle.mkswap_U(SWAP_UUID, "/dev/atomicos/swap");
     gfHandle.lvcreate_free("root", "atomicos", params.rootfsLVPercent);
     gfHandle.lvcreate_free("docker-meta", "atomicos", params.dockerMetaPercent);
     gfHandle.lvcreate_free("docker-data", "atomicos", params.dockerDataPercent);
@@ -393,8 +389,7 @@ function pullDeploy(mntdir, srcrepo, osname, target, revision, originRepoUrl, ca
     let newDeploymentDirectory = sysroot.get_deployment_directory(newDeployment);
 
     let defaultFstab = 'UUID=' + ROOT_UUID + ' / xfs defaults 1 1\n\
-UUID=' + BOOT_UUID + ' /boot ext4 defaults 1 2\n\
-UUID=' + SWAP_UUID + ' swap swap defaults 0 0\n';
+UUID=' + BOOT_UUID + ' /boot ext4 defaults 1 2\n';
     let fstabPath = newDeploymentDirectory.resolve_relative_path('etc/fstab');
     fstabPath.replace_contents(defaultFstab, null, false, Gio.FileCreateFlags.REPLACE_DESTINATION, cancellable);
 
diff --git a/src/scripts/trivial-autocompose-create-disks.sh b/src/scripts/trivial-autocompose-create-disks.sh
index d9a3a2c..528d35e 100755
--- a/src/scripts/trivial-autocompose-create-disks.sh
+++ b/src/scripts/trivial-autocompose-create-disks.sh
@@ -150,7 +150,7 @@ cat > metadata.json <<EOF
 {
   "provider"     : "libvirt",
   "format"       : "qcow2",
-  "virtual_size" : 16
+  "virtual_size" : 8
 }
 EOF
 
-- 
1.8.3.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]